Skip to content

Commit 16ff87b

Browse files
authored
Merge pull request #41 from tmilos/ci
Upgrade CI to latest php-cs-fixer
2 parents 0f75964 + 01e5b6a commit 16ff87b

2 files changed

Lines changed: 19 additions & 14 deletions

File tree

.php_cs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
$finder = Symfony\CS\Finder\DefaultFinder::create()
3+
$finder = PhpCsFixer\Finder::create()
44
->in('src')
55
;
66

@@ -13,10 +13,14 @@ This source file is subject to the MIT license that is bundled
1313
with this source code in the file LICENSE.
1414
EOT;
1515

16-
Symfony\CS\Fixer\Contrib\HeaderCommentFixer::setHeader($header);
17-
18-
return Symfony\CS\Config\Config::create()
19-
->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL)
20-
->fixers(array('-empty_return', '-phpdoc_no_empty_return', 'header_comment'))
21-
->finder($finder)
16+
return PhpCsFixer\Config::create()
17+
->setRules(array(
18+
'@Symfony' => true,
19+
'simplified_null_return' => false,
20+
'phpdoc_no_empty_return' => false,
21+
'no_mixed_echo_print' => ['use' => 'print'],
22+
'header_comment' => ['header' => $header],
23+
))
24+
->setUsingCache(false)
25+
->setFinder($finder)
2226
;

.travis.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
language: php
22

33
php:
4-
- 5.5
54
- 5.6
65
- 7.0
6+
- 7.1
77

88
cache:
99
directories:
10-
- $HOME/.composer/cache/files
10+
- $HOME/.composer/cache
1111

1212
matrix:
1313
include:
14-
- php: 5.5
14+
- php: 5.6
1515
env: COMPOSER_FLAGS="--prefer-lowest"
1616

1717
before_install:
@@ -20,14 +20,15 @@ before_install:
2020
- echo "session.gc_probability = 0" >> $INI_FILE
2121
- composer self-update
2222
- composer --version
23-
- wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v1.12.3/php-cs-fixer.phar -O php-cs-fixer.phar
23+
- if [ "$TRAVIS_PHP_VERSION" == "7.1" ]; then wget http://get.sensiolabs.org/php-cs-fixer.phar -O php-cs-fixer.phar; fi
24+
- if [ "$TRAVIS_PHP_VERSION" == "7.1" ]; then php php-cs-fixer.phar --version; fi
2425

2526
install:
2627
- COMPOSER_ROOT_VERSION=dev-master composer update --prefer-source $COMPOSER_FLAGS
2728

2829
script:
29-
- php php-cs-fixer.phar fix --dry-run -v
30-
- bin/phpunit --coverage-clover build/logs/clover.xml
30+
- if [ "$TRAVIS_PHP_VERSION" == "7.1" ]; then php php-cs-fixer.phar fix --dry-run -v; fi
31+
- if [ "$TRAVIS_PHP_VERSION" == "7.1" ]; then bin/phpunit --coverage-clover build/logs/clover.xml; else bin/phpunit; fi
3132

3233
after_script:
33-
- if [[ "$TRAVIS_PHP_VERSION" == "7.0" ]]; then php bin/coveralls -v; fi;
34+
- if [[ "$TRAVIS_PHP_VERSION" == "7.1" ]]; then php bin/coveralls -v; fi;

0 commit comments

Comments
 (0)