Skip to content
This repository was archived by the owner on Feb 6, 2020. It is now read-only.

Commit a8d957a

Browse files
committed
Added phpstan in CI build
1 parent 1f890ac commit a8d957a

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
/phpcs.xml export-ignore
1111
/phpunit.xml.dist export-ignore
1212
/test/ export-ignore
13+
/phpstan.neon.dist export-ignore

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
/vendor/
66
/zf-mkdoc-theme.tgz
77
/zf-mkdoc-theme/
8+
/phpstan.neon

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ matrix:
2222
- CS_CHECK=true
2323
- BENCHMARKS=true
2424
- TEST_COVERAGE=true
25+
- PHPSTAN_TEST=true
2526
- php: 7.1
2627
env:
2728
- DEPS=latest
@@ -43,12 +44,14 @@ install:
4344
- if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi
4445
- if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi
4546
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi
47+
- if [[ $PHPSTAN_TEST == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $PHPSTAN_DEPS ; fi
4648
- stty cols 120 && composer show
4749

4850
script:
4951
- if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi
5052
- if [[ $BENCHMARKS == 'true' ]]; then vendor/bin/phpbench run --revs=2 --iterations=2 --report=aggregate ; fi
5153
- if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi
54+
- if [[ $PHPSTAN_TEST == 'true' ]]; then ./vendor/bin/phpstan analyse --no-progress . ; fi
5255

5356
after_script:
5457
- if [[ $TEST_COVERAGE == 'true' ]]; then vendor/bin/php-coveralls -v ; fi

phpstan.neon.dist

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
parameters:
2+
level: 7
3+
4+
fileExtensions:
5+
- php
6+
7+
excludes_analyse:
8+
- %currentWorkingDirectory%/benchmarks/*
9+
- %currentWorkingDirectory%/bin/*
10+
- %currentWorkingDirectory%/docs/*
11+
- %currentWorkingDirectory%/test/*
12+
- %currentWorkingDirectory%/vendor/*
13+
14+
ignoreErrors:
15+
- "#Casting to [a-z]+ something that's already [a-z]+#"
16+
- '#PHPDoc tag @throws with type Interop\\Container\\Exception\\ContainerException is not subtype of Throwable#'
17+
- '#PHPDoc tag @throws with type ([\w\\\|]+\|)?Psr\\Container\\ContainerExceptionInterface(\|[\w\\\|]+)? is not subtype of Throwable#'
18+
- '#Parameter \#2 \$search of function array_key_exists expects array, (array\|)?ArrayObject given#'
19+
# AbstractPluginManager::__construct() accepts more types:
20+
- '#Result of && is always false#'

0 commit comments

Comments
 (0)