Skip to content

Commit c2b18c9

Browse files
authored
Merge pull request #723 from cakephp/align-travis
Align travis config with cakephp
2 parents fb177fb + 9cff951 commit c2b18c9

5 files changed

Lines changed: 17 additions & 18 deletions

File tree

.travis.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ language: php
33
php:
44
- 7.2
55
- 7.3
6-
- 7.4snapshot
6+
- 7.4
77

88
dist: xenial
99

@@ -23,27 +23,24 @@ matrix:
2323
fast_finish: true
2424

2525
include:
26-
- php: 7.2
27-
env: STATIC_ANALYSIS=1 DEFAULT=0
26+
- php: 7.3
27+
env: CHECKS=1 DEFAULT=0
2828

2929
allow_failures:
30-
- php: 7.4snapshot
30+
- php: 7.4
3131

3232
install:
3333
- composer install --prefer-dist --no-interaction
3434

3535
before_script:
36-
- if [ $DB = 'mysql' ]; then mysql -u root -e 'CREATE DATABASE cakephp_test;'; fi
37-
- if [ $DB = 'pgsql' ]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi
38-
- if [[ $STATIC_ANALYSIS == 1 ]]; then composer require --dev psalm/phar:^3.6; fi
36+
- if [[ $DB == 'mysql' ]]; then mysql -u root -e 'CREATE DATABASE cakephp_test;'; fi
37+
- if [[ $DB == 'pgsql' ]]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi
38+
- if [[ $CHECKS == 1 ]]; then composer require --dev psalm/phar:^3.6; fi
3939

4040
script:
41-
- if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION = 7.1 ]]; then vendor/bin/phpunit --coverage-clover=clover.xml; fi
42-
- if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION != 7.1 ]]; then vendor/bin/phpunit; fi
43-
- if [[ $STATIC_ANALYSIS == 1 ]]; then vendor/bin/psalm.phar --show-info=false; fi
44-
45-
after_success:
46-
- if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION = 7.1 ]]; then bash <(curl -s https://codecov.io/bash); fi
41+
- if [[ $DEFAULT == 1 ]]; then vendor/bin/phpunit; fi
42+
- if [[ $CHECKS == 1 ]]; then vendor/bin/psalm.phar --show-info=false; fi
43+
- if [[ $CHECKS == 1 ]]; then vendor/bin/phpcs --colors --parallel=16 -p src/ tests/; fi
4744

4845
notifications:
4946
email: false

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"jdorn/sql-formatter": "^1.2"
3232
},
3333
"require-dev": {
34-
"cakephp/cakephp-codesniffer": "dev-next",
34+
"cakephp/cakephp-codesniffer": "^4.0",
3535
"phpunit/phpunit": "^8.0"
3636
},
3737
"autoload": {

src/Controller/DashboardController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?php
2+
declare(strict_types=1);
3+
24
/**
35
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
46
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)

src/View/Helper/ToolbarHelper.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,7 @@ public function makeNeatArray(
128128
$value = 'function';
129129
}
130130

131-
$isObject = is_object($value);
132-
if ($isObject && $ancestors->contains($value)) {
133-
$isObject = false;
131+
if (is_object($value) && $ancestors->contains($value)) {
134132
$value = ' - recursion';
135133
}
136134

@@ -139,7 +137,7 @@ public function makeNeatArray(
139137
$value instanceof ArrayAccess ||
140138
$value instanceof Iterator ||
141139
is_array($value) ||
142-
$isObject
140+
is_object($value)
143141
) && !empty($value)
144142
) {
145143
$out .= $this->makeNeatArray($value, $openDepth, $nextDepth, $doubleEncode, $ancestors);

tests/TestCase/Controller/DashboardControllerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?php
2+
declare(strict_types=1);
3+
24
/**
35
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
46
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)

0 commit comments

Comments
 (0)