Skip to content

Commit

Permalink
Add basic run of PHPStan (ref squizlabs#2201)
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood committed Jan 17, 2019
1 parent bff45d9 commit 3944212
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ matrix:
- php: 7.2
- php: 7.3
- php: nightly
env: PHPSTAN=1

allow_failures:
- php: nightly
Expand Down Expand Up @@ -56,3 +57,5 @@ script:
- if [[ $XMLLINT == "1" ]]; then diff -B ./src/Standards/PSR12/ruleset.xml <(xmllint --format "./src/Standards/PSR12/ruleset.xml"); fi
- if [[ $XMLLINT == "1" ]]; then diff -B ./src/Standards/Squiz/ruleset.xml <(xmllint --format "./src/Standards/Squiz/ruleset.xml"); fi
- if [[ $XMLLINT == "1" ]]; then diff -B ./src/Standards/Zend/ruleset.xml <(xmllint --format "./src/Standards/Zend/ruleset.xml"); fi
# Run PHPStan
- if [[ $PHPSTAN == "1" ]]; then composer require --dev phpstan/phpstan && php vendor/bin/phpstan analyse src --level=0 --configuration=phpstan.neon --autoload-file=tests/bootstrap.php; fi
13 changes: 13 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
parameters:
ignoreErrors:
-
message: '~^Undefined variable: \$phpCodeSnifferConfig$~'
path: %currentWorkingDirectory%/src/Config.php

dynamicConstantNames:
- PHP_CODESNIFFER_IN_TESTS
- PHP_CODESNIFFER_CBF
- PHP_CODESNIFFER_VERBOSITY

excludes_analyse:
- */Tests/*

0 comments on commit 3944212

Please sign in to comment.