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

Commit

Permalink
Added phpstan in CI build
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasvargiu committed Oct 19, 2018
1 parent d91c56e commit 5d50d2d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
/phpcs.xml export-ignore
/phpunit.xml.dist export-ignore
/test/ export-ignore
/phpstan.neon.dist export-ignore
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
/vendor/
/zf-mkdoc-theme.tgz
/zf-mkdoc-theme/
/phpstan.neon
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ env:
global:
- COMPOSER_ARGS="--no-interaction --no-plugins"
- COVERAGE_DEPS="satooshi/php-coveralls"
- PHPSTAN_DEPS="phpstan/phpstan:^0.10.3"

matrix:
include:
Expand All @@ -30,6 +31,7 @@ matrix:
env:
- DEPS=locked
- LEGACY_DEPS="ocramius/proxy-manager phpbench/phpbench phpunit/phpunit"
- PHPSTAN_TEST=true
- php: 7
env:
- DEPS=latest
Expand Down Expand Up @@ -64,12 +66,14 @@ install:
- if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi
- if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi
- if [[ $PHPSTAN_TEST == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $PHPSTAN_DEPS ; fi
- stty cols 120 && composer show

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

after_script:
- if [[ $TEST_COVERAGE == 'true' ]]; then composer upload-coverage ; fi
Expand Down
20 changes: 20 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
parameters:
level: 7

fileExtensions:
- php

excludes_analyse:
- %currentWorkingDirectory%/benchmarks/*
- %currentWorkingDirectory%/bin/*
- %currentWorkingDirectory%/docs/*
- %currentWorkingDirectory%/test/*
- %currentWorkingDirectory%/vendor/*

ignoreErrors:
- "#Casting to [a-z]+ something that's already [a-z]+#"
- '#PHPDoc tag @throws with type Interop\\Container\\Exception\\ContainerException is not subtype of Throwable#'
- '#PHPDoc tag @throws with type ([\w\\\|]+\|)?Psr\\Container\\ContainerExceptionInterface(\|[\w\\\|]+)? is not subtype of Throwable#'
- '#Parameter \#2 \$search of function array_key_exists expects array, (array\|)?ArrayObject given#'
# AbstractPluginManager::__construct() accepts more types:
- '#Result of && is always false#'

0 comments on commit 5d50d2d

Please sign in to comment.