Only install PHPStan when we need it

This is to avoid error when installing it on PHP < 7.1
pull/54/head
Jeremy Benoist 6 years ago
parent b1acc9ed73
commit 44bebfc3d6
No known key found for this signature in database
GPG Key ID: 84290C294324D304
  1. 3
      .travis.yml
  2. 4
      composer.json

@ -36,6 +36,9 @@ script:
- mkdir -p build/logs - mkdir -p build/logs
- php vendor/bin/simple-phpunit -v --coverage-clover build/logs/clover.xml - php vendor/bin/simple-phpunit -v --coverage-clover build/logs/clover.xml
- if [ "$CS_FIXER" = "run" ]; then php vendor/bin/php-cs-fixer fix --verbose --dry-run ; fi; - if [ "$CS_FIXER" = "run" ]; then php vendor/bin/php-cs-fixer fix --verbose --dry-run ; fi;
# only install phpstan when we need it
- if [ "$CS_FIXER" = "run" ]; then composer require phpstan/phpstan --no-progress --no-suggest ; fi;
- if [ "$CS_FIXER" = "run" ]; then composer require phpstan/phpstan-phpunit --no-progress --no-suggest ; fi;
- if [ "$CS_FIXER" = "run" ]; then php vendor/bin/phpstan analyse src tests --no-progress --level 1 ; fi; - if [ "$CS_FIXER" = "run" ]; then php vendor/bin/phpstan analyse src tests --no-progress --level 1 ; fi;
after_script: after_script:

@ -33,9 +33,7 @@
"php-coveralls/php-coveralls": "^2.1", "php-coveralls/php-coveralls": "^2.1",
"friendsofphp/php-cs-fixer": "^2.14", "friendsofphp/php-cs-fixer": "^2.14",
"monolog/monolog": "^1.24", "monolog/monolog": "^1.24",
"symfony/phpunit-bridge": "^4.2.3", "symfony/phpunit-bridge": "^4.2.3"
"phpstan/phpstan-phpunit": "^0.11",
"phpstan/phpstan": "^0.11"
}, },
"suggest": { "suggest": {
"ext-tidy": "Used to clean up given HTML and to avoid problems with bad HTML structure." "ext-tidy": "Used to clean up given HTML and to avoid problems with bad HTML structure."

Loading…
Cancel
Save