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

Commit 5d50d2d

Browse files
committed
Added phpstan in CI build
1 parent d91c56e commit 5d50d2d

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ env:
1010
global:
1111
- COMPOSER_ARGS="--no-interaction --no-plugins"
1212
- COVERAGE_DEPS="satooshi/php-coveralls"
13+
- PHPSTAN_DEPS="phpstan/phpstan:^0.10.3"
1314

1415
matrix:
1516
include:
@@ -30,6 +31,7 @@ matrix:
3031
env:
3132
- DEPS=locked
3233
- LEGACY_DEPS="ocramius/proxy-manager phpbench/phpbench phpunit/phpunit"
34+
- PHPSTAN_TEST=true
3335
- php: 7
3436
env:
3537
- DEPS=latest
@@ -64,12 +66,14 @@ install:
6466
- if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi
6567
- if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi
6668
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi
69+
- if [[ $PHPSTAN_TEST == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $PHPSTAN_DEPS ; fi
6770
- stty cols 120 && composer show
6871

6972
script:
7073
- if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi
7174
- if [[ $BENCHMARKS == 'true' ]]; then vendor/bin/phpbench run --revs=2 --iterations=2 --report=aggregate ; fi
7275
- if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi
76+
- if [[ $PHPSTAN_TEST == 'true' ]]; then ./vendor/bin/phpstan analyse --no-progress . ; fi
7377

7478
after_script:
7579
- if [[ $TEST_COVERAGE == 'true' ]]; then composer upload-coverage ; 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)