Add phpstan PHP Static Analysis Tool

This commit is contained in:
Jeremiah VALERIE 2018-08-23 08:34:49 +02:00
parent d5b4d446ce
commit 0d63d74cbb
No known key found for this signature in database
GPG Key ID: 668676FD50ADF244
4 changed files with 17 additions and 4 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@ composer.phar
composer.lock
vendor/
bin/
phpstan.phar

View File

@ -9,7 +9,13 @@ php:
- 7.2
- nightly
matrix:
jobs:
include:
- stage: Code Quality
php: 7.2
env: STATIC_ANALYSIS
install: travis_retry composer install --prefer-dist
script: composer static-analysis
allow_failures:
- php: nightly

View File

@ -18,9 +18,6 @@
},
"config": {
"bin-dir": "bin",
"platform": {
"php": "5.6.0"
},
"preferred-install": "dist",
"sort-packages": true
},
@ -36,6 +33,15 @@
"GraphQL\\Examples\\Blog\\": "examples/01-blog/Blog/"
}
},
"scripts": {
"static-analysis": [
"rm phpstan.phar || true",
"@composer req --ansi --no-interaction --dev phpstan/phpstan-shim",
"cp -f vendor/phpstan/phpstan-shim/phpstan.phar .",
"@composer rem --ansi --dev phpstan/phpstan-shim",
"@php phpstan.phar analyse --ansi -l 1 -c phpstan.neon src"
]
},
"suggest": {
"react/promise": "To leverage async resolving on React PHP platform",
"psr/http-message": "To use standard GraphQL server"

0
phpstan.neon Normal file
View File