Skip to content

Commit

Permalink
run PHPStan on Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
craue committed Jun 1, 2019
1 parent f859c55 commit deeb7aa
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
/composer.lock
/phpstan.neon
/phpunit.xml
/vendor
6 changes: 4 additions & 2 deletions .travis.yml
Expand Up @@ -14,7 +14,7 @@ matrix:
- php: 7.0
env: DEPS='lowest'
- php: 7.3
env: DEPS='unmodified'
env: DEPS='unmodified' WITH_STATIC_ANALYSIS='yes'
- php: 7.3
env: SYMFONY_VERSION='3.4.*' PARAM_DB_DRIVER='pdo_sqlite' SYMFONY_DEPRECATIONS_HELPER='9'
- php: 7.3
Expand Down Expand Up @@ -46,7 +46,9 @@ before_script:

script:
# validate composer.json
- composer validate --strict --no-check-lock
- if [ -n "${WITH_STATIC_ANALYSIS:-}" ]; then composer validate --strict --no-check-lock; fi;
# run PHPStan
- if [ -n "${WITH_STATIC_ANALYSIS:-}" ]; then vendor/bin/phpstan analyse; fi;
# run PHPUnit
- phpdbg -qrr vendor/phpunit/phpunit/phpunit -v --coverage-clover build/logs/clover.xml
# upload code coverage data
Expand Down
4 changes: 4 additions & 0 deletions .travis_install_dependencies.sh
Expand Up @@ -22,4 +22,8 @@ case "${DEPS:-}" in
fi
esac

if [ -n "${WITH_STATIC_ANALYSIS:-}" ]; then
composer require --no-update --dev phpstan/phpstan-shim
fi

composer update ${COMPOSER_UPDATE_ARGS:-}
24 changes: 24 additions & 0 deletions phpstan.neon.dist
@@ -0,0 +1,24 @@
parameters:
level: 5
paths:
- %currentWorkingDirectory%
excludes_analyse:
- %currentWorkingDirectory%/Tests/*
- %currentWorkingDirectory%/vendor/*
ignoreErrors:
-
message: '#^Result of || is always true\.$#'
path: %currentWorkingDirectory%/Form/Step.php
# TODO remove as soon as Symfony >= 4.1 is required
-
message: '#^Call to function property_exists\(\) with .+ and .size. will always evaluate to false\.$#'
path: %currentWorkingDirectory%/Storage/SerializableFile.php
# TODO remove as soon as Symfony >= 4.1 is required
- '#^Parameter \#5 \$test of class Symfony\\Component\\HttpFoundation\\File\\UploadedFile constructor expects bool, null given\.$#'
# TODO remove as soon as Symfony >= 4.3 is required
-
message: '#^Method Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface::dispatch\(\) invoked with 2 parameters, 1 required\.$#'
path: %currentWorkingDirectory%/Form/FormFlow.php
-
message: '#^Parameter \#1 \$event of method Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface::dispatch\(\) expects object, string given\.$#'
path: %currentWorkingDirectory%/Form/FormFlow.php

0 comments on commit deeb7aa

Please sign in to comment.