Skip to content

Commit 04f40ea

Browse files
authored
Updated travis config (#65)
* Updated travis config * Applied changes from StyleCI * Drop support for sf2.x * Added new line
1 parent e7d36b6 commit 04f40ea

File tree

3 files changed

+51
-21
lines changed

3 files changed

+51
-21
lines changed

.travis.yml

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,60 @@ branches:
99
- /^analysis-.*$/
1010
- /^patch-.*$/
1111

12-
php:
13-
- 5.5
14-
- 5.6
15-
- 7.0
16-
- 7.1
17-
1812
env:
1913
global:
2014
- TEST_COMMAND="composer test"
2115

2216
matrix:
23-
fast_finish: true
24-
include:
25-
- php: 5.5
26-
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci"
27-
- php: hhvm
28-
dist: trusty
17+
fast_finish: true
18+
include:
19+
# Test with lowest dependencies
20+
- php: 7.1
21+
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak"
22+
- php: 5.5
23+
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak"
24+
25+
# Test the latest stable release
26+
- php: 5.5
27+
- php: 5.6
28+
- php: 7.0
29+
- php: 7.1
30+
- php: 7.2
31+
env: COVERAGE=true TEST_COMMAND="composer test-ci"
32+
33+
# Force some major versions of Symfony
34+
- php: 7.2
35+
env: DEPENDENCIES="dunglas/symfony-lock:^3"
36+
- php: 7.2
37+
env: DEPENDENCIES="dunglas/symfony-lock:^4"
38+
39+
# Latest commit to master
40+
- php: 7.2
41+
env: STABILITY="dev"
42+
43+
allow_failures:
44+
# Dev-master is allowed to fail.
45+
- env: STABILITY="dev"
46+
47+
before_install:
48+
- if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi
49+
- if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi;
50+
- if ! [ -z "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi;
2951

3052
install:
31-
- travis_retry composer update --prefer-dist --no-interaction $COMPOSER_FLAGS
53+
# To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355
54+
- if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi
55+
- composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction
56+
- vendor/bin/simple-phpunit install
3257

3358
script:
59+
- composer validate --strict --no-check-lock
3460
- $TEST_COMMAND
3561

3662
after_success:
3763
- if [[ $COVERAGE = true ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi
3864
- if [[ $COVERAGE = true ]]; then php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml; fi
65+
66+
after_script:
67+
- wget http://tnyholm.se/reporter.phar
68+
- php reporter.phar build:upload

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
"require": {
1212
"php": "^5.5 || ^7.0",
1313
"nikic/php-parser": "^3.0",
14-
"symfony/finder": "^2.7 || ^3.0 || ^4.0",
14+
"symfony/finder": "^3.0 || ^4.0",
1515
"twig/twig": "^1.27 || ^2.0",
1616
"doctrine/annotations": "^1.2"
1717
},
1818
"require-dev": {
19-
"phpunit/phpunit": "^4.8.36 || ^5.5 || ^6.2",
19+
"symfony/phpunit-bridge": "^3.4 || ^4.0",
2020
"symfony/translation": "^3.0 || ^4.0",
21-
"symfony/validator": "^2.7 || ^3.0 || ^4.0",
21+
"symfony/validator": "^3.0 || ^4.0",
2222
"symfony/twig-bridge": "^3.0 || ^4.0"
2323
},
2424
"autoload": {
@@ -32,8 +32,8 @@
3232
}
3333
},
3434
"scripts": {
35-
"test": "vendor/bin/phpunit",
36-
"test-ci": "vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml"
35+
"test": "vendor/bin/simple-phpunit",
36+
"test-ci": "vendor/bin/simple-phpunit --coverage-text --coverage-clover=build/coverage.xml"
3737
},
3838
"extra": {
3939
"branch-alias": {

src/Visitor/Php/Symfony/FormTypeChoices.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ public function enterNode(Node $node)
4848
}
4949
}
5050

51-
if ($this->state === null && $node instanceof Node\Expr\Assign) {
51+
if (null === $this->state && $node instanceof Node\Expr\Assign) {
5252
$this->state = 'variable';
53-
} elseif ($this->state === 'variable' && $node instanceof Node\Expr\Variable) {
53+
} elseif ('variable' === $this->state && $node instanceof Node\Expr\Variable) {
5454
$this->variables['__variable-name'] = $node->name;
5555
$this->state = 'value';
56-
} elseif ($this->state === 'value' && $node instanceof Node\Expr\Array_) {
56+
} elseif ('value' === $this->state && $node instanceof Node\Expr\Array_) {
5757
$this->variables[$this->variables['__variable-name']] = $node;
5858
$this->state = null;
5959
} else {

0 commit comments

Comments
 (0)