File tree 4 files changed +25
-1
lines changed
4 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 3
3
Vagrantfile
4
4
build /
5
5
vendor /
6
+ .php_cs.cache
6
7
box.phar
7
8
composer.lock
8
9
composer.phar
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ $ finder = PhpCsFixer \Finder::create ()->in (__DIR__ );
4
+
5
+ $ cacheDir = getenv ('TRAVIS ' ) ? getenv ('HOME ' ) . '/.php-cs-fixer ' : __DIR__ ;
6
+
7
+ return PhpCsFixer \Config::create ()
8
+ ->setCacheFile ($ cacheDir . '/.php_cs.cache ' )
9
+ ->setFinder ($ finder )
10
+ ->setRules (array (
11
+ '@PSR2 ' => true ,
12
+ 'array_syntax ' => array (
13
+ 'syntax ' => 'long ' ,
14
+ ),
15
+ ));
Original file line number Diff line number Diff line change 7
7
- php : 5.3
8
8
env : WITH_LOWEST=true
9
9
- php : 5.3
10
- env : WITH_HIGHEST=true WITH_PHAR=true
10
+ env : WITH_HIGHEST=true WITH_CS=true WITH_PHAR=true
11
11
- php : 5.4
12
12
env : WITH_LOWEST=true
13
13
- php : 5.4
@@ -32,6 +32,7 @@ matrix:
32
32
cache :
33
33
directories :
34
34
- $HOME/.composer/cache
35
+ - $HOME/.php-cs-fixer
35
36
36
37
before_install :
37
38
- source .travis/travis.sh
@@ -45,8 +46,10 @@ install:
45
46
before_script :
46
47
- git config --global user.email "travis-ci@codeclimate.com"
47
48
- git config --global user.name "Travis CI"
49
+ - mkdir -p "$HOME/.php-cs-fixer"
48
50
49
51
script :
52
+ - if [[ "$WITH_CS" == "true" ]]; then vendor/bin/php-cs-fixer fix --config=.php_cs --verbose --diff --dry-run; fi
50
53
- run-tests
51
54
52
55
after_success :
Original file line number Diff line number Diff line change 27
27
"symfony/console" : " ^2.0 || ^3.0"
28
28
},
29
29
"require-dev" : {
30
+ "friendsofphp/php-cs-fixer" : " ^2.0.0" ,
30
31
"phpunit/phpunit" : " ^4.8.31"
31
32
},
32
33
"autoload" : {
48
49
" curl -LSs https://box-project.github.io/box2/installer.php | php" ,
49
50
" php box.phar --version" ,
50
51
" php box.phar build -v"
52
+ ],
53
+ "cs" : [
54
+ " composer install --prefer-dist" ,
55
+ " php-cs-fixer fix --config=.php_cs --verbose --diff"
51
56
]
52
57
},
53
58
"extra" : {
You can’t perform that action at this time.
0 commit comments