Skip to content

Commit 3944212

Browse files
committed
Add basic run of PHPStan (ref #2201)
1 parent bff45d9 commit 3944212

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ matrix:
2121
- php: 7.2
2222
- php: 7.3
2323
- php: nightly
24+
env: PHPSTAN=1
2425

2526
allow_failures:
2627
- php: nightly
@@ -56,3 +57,5 @@ script:
5657
- if [[ $XMLLINT == "1" ]]; then diff -B ./src/Standards/PSR12/ruleset.xml <(xmllint --format "./src/Standards/PSR12/ruleset.xml"); fi
5758
- if [[ $XMLLINT == "1" ]]; then diff -B ./src/Standards/Squiz/ruleset.xml <(xmllint --format "./src/Standards/Squiz/ruleset.xml"); fi
5859
- if [[ $XMLLINT == "1" ]]; then diff -B ./src/Standards/Zend/ruleset.xml <(xmllint --format "./src/Standards/Zend/ruleset.xml"); fi
60+
# Run PHPStan
61+
- 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

phpstan.neon

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: '~^Undefined variable: \$phpCodeSnifferConfig$~'
5+
path: %currentWorkingDirectory%/src/Config.php
6+
7+
dynamicConstantNames:
8+
- PHP_CODESNIFFER_IN_TESTS
9+
- PHP_CODESNIFFER_CBF
10+
- PHP_CODESNIFFER_VERBOSITY
11+
12+
excludes_analyse:
13+
- */Tests/*

0 commit comments

Comments
 (0)