3 files changed +32
-8
lines changed Original file line number Diff line number Diff line change @@ -8,32 +8,43 @@ matrix:
8
8
include :
9
9
- php : 7.0
10
10
env : coverage=on
11
+ - php : 7.1
12
+ env : codingStandard=on
11
13
12
14
allow_failures :
13
15
- php : 7.0
14
16
env : coverage=on
15
17
16
18
script :
17
19
- vendor/bin/tester tests -s -c tests/php-unix.ini $coverageArgs
18
- - php temp/code-checker/src/code-checker.php --short-arrays --strict-types -i tests/Utils/files
20
+ - >
21
+ if [ "$codingStandard" ]; then
22
+ php temp/code-checker/src/code-checker.php --short-arrays --strict-types
23
+ && php temp/coding-standard/ecs check src tests --config tests/coding-standard.neon;
24
+ fi
19
25
20
26
after_failure :
21
27
# Print *.actual content
22
28
- for i in $(find tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done
23
29
24
30
before_script :
25
- # Install Nette Tester & Code Checker
31
+ # Install Nette Tester
26
32
- travis_retry composer install --no-interaction --prefer-dist
27
- - travis_retry composer create-project nette/code-checker temp/code-checker ~2.8 --no-interaction
28
- - if [ "$coverage" == "on" ]; then coverageArgs="-p phpdbg --coverage ./coverage.xml --coverage-src ./src"; fi
33
+ # Install Code Checkers
34
+ - >
35
+ if [ "$codingStandard" ]; then
36
+ travis_retry composer create-project nette/code-checker temp/code-checker ~2 --no-interaction;
37
+ travis_retry composer create-project nette/coding-standard temp/coding-standard --no-interaction;
38
+ fi
39
+ - if [ "$coverage" ]; then coverageArgs="-p phpdbg --coverage ./coverage.xml --coverage-src ./src"; fi
29
40
30
41
after_script :
31
42
# Report Code Coverage
32
43
- >
33
- if [ "$coverage" == "on" ]; then
44
+ if [ "$coverage" ]; then
34
45
wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar
35
- && php coveralls.phar --verbose --config tests/.coveralls.yml
36
- || true; fi
46
+ && php coveralls.phar --verbose --config tests/.coveralls.yml;
47
+ fi
37
48
38
49
sudo : false
39
50
Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ public static function flatten(array $arr, bool $preserveKeys = false): array
142
142
$ res = [];
143
143
$ cb = $ preserveKeys
144
144
? function ($ v , $ k ) use (&$ res ) { $ res [$ k ] = $ v ; }
145
- : function ($ v ) use (&$ res ) { $ res [] = $ v ; };
145
+ : function ($ v ) use (&$ res ) { $ res [] = $ v ; };
146
146
array_walk_recursive ($ arr , $ cb );
147
147
return $ res ;
148
148
}
Original file line number Diff line number Diff line change
1
+ includes :
2
+ - ../temp/coding-standard/coding-standard-php70.neon
3
+
4
+ parameters :
5
+ skip :
6
+ PHP_CodeSniffer\Standards\PSR1\Sniffs\Methods\CamelCapsMethodNameSniff :
7
+ - tests/Utils/FileSystem.phpt # RemoteStream extends streamWrapper
8
+
9
+ PhpCsFixer\Fixer\Import\SingleImportPerStatementFixer :
10
+ - src/Utils/Arrays.php # use function
11
+ - src/Utils/Callback.php # use function
12
+ - src/Utils/Html.php # use function
13
+ - src/Utils/Strings.php # use function
0 commit comments