Skip to content

Commit

Permalink
Merge pull request #201 from brambaud/issue/88/add-phpstan
Browse files Browse the repository at this point in the history
add phpstan check to ci
  • Loading branch information
weaverryan authored Oct 3, 2019
2 parents a992e79 + b9b9203 commit 852281d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ php:
matrix:
include:
- php: 7.3
env: DEPENDENCIES=dev
env: DEPENDENCIES=dev LINT=1
- php: 7.1
env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable'

Expand All @@ -27,4 +27,6 @@ install: composer update --prefer-dist $COMPOSER_FLAGS
# Fail CI if repo is in dirty state after bin/update_readme
before_script: ./bin/update_readme && git diff --exit-code README.md

script: ./vendor/bin/simple-phpunit
script:
- ./vendor/bin/simple-phpunit
- if [ "$LINT" = 1 ]; then ./vendor/bin/phpstan analyse; fi;
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"symfony/phpunit-bridge": "^4.3",
"symfony/security-guard": "^3.4|^4.0",
"symfony/yaml": "^3.4|^4.0",
"phpspec/prophecy": "^1.8"
"phpspec/prophecy": "^1.8",
"phpstan/phpstan": "^0.11.16"
},
"suggest": {
"symfony/security-guard": "For integration with Symfony's Guard Security layer"
Expand Down
19 changes: 19 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
parameters:
level: 1
inferPrivatePropertyTypeFromConstructor: true
paths:
- ./src/
excludes_analyse:
- */cache/*
ignoreErrors:
# False positive: clients are not dependencies of this project.
-
message: '#Return typehint of method KnpU\\OAuth2ClientBundle\\Client\\Provider\\[a-zA-Z0-9\\_]+::fetchUserFromToken\(\) has invalid type [a-zA-Z0-9\\_]#'
path: ./src/Client/Provider
-
message: '#Return typehint of method KnpU\\OAuth2ClientBundle\\Client\\Provider\\[a-zA-Z0-9\\_]+::fetchUser\(\) has invalid type [a-zA-Z0-9\\_]#'
path: ./src/Client/Provider
# False positive: using `::class` is not an error for those providers `::getProviderClass()` method.
-
message: '#Class [a-zA-Z0-9\\_]+ not found#'
path: ./src/DependencyInjection/Providers

0 comments on commit 852281d

Please sign in to comment.