File tree Expand file tree Collapse file tree 4 files changed +78
-8
lines changed
Expand file tree Collapse file tree 4 files changed +78
-8
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ printf ("Executing php_cs!!! \n\n" );
3+ $ finder = Symfony \CS \Finder \DefaultFinder::create ()
4+ ->in (__DIR__ )
5+ ->ignoreDotFiles (true )
6+ ->filter (function (SplFileInfo $ file ) {
7+ $ path = $ file ->getPathname ();
8+
9+ switch (true ) {
10+ case (strrpos ($ path , '/bin/ ' )):
11+ return false ;
12+ case (strrpos ($ path , '/test/Bootstrap.php ' )):
13+ return false ;
14+ case (strrpos ($ path , '/vendor/ ' )):
15+ return false ;
16+ default :
17+ return true ;
18+ }
19+ });
20+
21+ return Symfony \CS \Config \Config::create ()
22+ ->fixers (array (
23+ 'controls_spaces ' ,
24+ 'braces ' ,
25+ 'elseif ' ,
26+ 'eof_ending ' ,
27+ 'function_declaration ' ,
28+ 'include ' ,
29+ 'indentation ' ,
30+ 'linefeed ' ,
31+ 'php_closing_tag ' ,
32+ 'psr0 ' ,
33+ 'short_tag ' ,
34+ 'trailing_spaces ' ,
35+ 'unused_use ' ,
36+ 'visibility ' ,
37+ ))
38+ ->finder ($ finder );
Original file line number Diff line number Diff line change 11language : php
22
33php :
4- - " 5.3"
5- - " 5.4"
6-
7- before_install :
8- - wget http://cs.sensiolabs.org/get/php-cs-fixer.phar
4+ - 5.3
5+ - 5.4
6+ - 5.5
97
108before_script :
11- - composer install --dev
9+ - composer self-update
10+ - composer install --dev --prefer-source
1211
1312script :
14- - (cd test ; ../vendor/bin/phpunit -c phpunit.xml)
15- - output=$(php php-cs-fixer.phar fix -v --dry-run --level=psr2 .); if [[ $output ]]; then while read -r line; do echo -e "\e[00;31m$line\e[00m"; done <<< "$output"; false; fi;
13+ - ./vendor/bin/phpunit -c ./test --coverage-clover ./build/logs/clover.xml
14+ - ./bin/check-cs.sh
15+
16+ after_script :
17+ - php ./vendor/bin/coveralls -v
18+
19+ notifications :
20+ irc : " irc.freenode.org#apigility-dev"
21+ email : false
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ FIXER_CONFIG=" ` dirname $0 ` /../.php_cs"
4+ FIXER_PATH=" ` dirname $0 ` /../vendor/fabpot/php-cs-fixer/php-cs-fixer"
5+ CS=" "
6+
7+ (
8+ cd " ` dirname $0 ` /../" ;
9+ CS=$( php vendor/fabpot/php-cs-fixer/php-cs-fixer fix -v --dry-run .)
10+ )
11+
12+ if [[ " $CS " ]];
13+ then
14+ echo -en ' \E[31m' " $CS \033[1m\033[0m" ;
15+ printf " \n" ;
16+ echo -en ' \E[31;47m' " \033[1mCoding standards check failed!\033[0m"
17+ printf " \n" ;
18+ exit 2;
19+ fi
20+
21+ echo -en ' \E[32m' " \033[1mCoding standards check passed!\033[0m"
22+ printf " \n" ;
23+
24+ echo $CS
Original file line number Diff line number Diff line change 3333 "zendframework/zend-view" : " ~2.3"
3434 },
3535 "require-dev" : {
36+ "fabpot/php-cs-fixer" : " *@dev" ,
3637 "phpunit/PHPUnit" : " 3.7.*" ,
38+ "satooshi/php-coveralls" : " >=0.6.0" ,
3739 "zendframework/zend-console" : " ~2.3" ,
3840 "zendframework/zend-http" : " ~2.3" ,
3941 "zendframework/zend-loader" : " ~2.3"
You can’t perform that action at this time.
0 commit comments