From 87422af5c7f645dd129a74e802e740f9f6325a22 Mon Sep 17 00:00:00 2001 From: Meritoo Date: Wed, 3 Apr 2019 12:45:26 +0200 Subject: [PATCH] Implement PHPStan (https://github.com/phpstan/phpstan) --- CHANGELOG.md | 1 + composer.json | 1 + phing/properties.dist | 9 +++++++++ phing/tests.xml | 8 +++++++- phpstan.neon.dist | 5 +++++ 5 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 phpstan.neon.dist diff --git a/CHANGELOG.md b/CHANGELOG.md index 4844a74..c6e3ae8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ Common and useful classes, methods, exceptions etc. 3. Implement Mutation Testing Framework (infection/infection package) 4. Travis CI > run many tasks using Phing (instead of PHPUnit only) 5. Fix integration with [Coveralls](https://www.coveralls.io) (available as the badge in [README.md](README.md)) +6. Implement [PHPStan](https://github.com/phpstan/phpstan) # 1.0.1 diff --git a/composer.json b/composer.json index ca10efa..b54fece 100644 --- a/composer.json +++ b/composer.json @@ -24,6 +24,7 @@ "friendsofphp/php-cs-fixer": "^2.14", "infection/infection": "^0.11.4", "php-coveralls/php-coveralls": "^2.1", + "phpstan/phpstan": "^0.11.1", "phpunit/phpunit": "^8.0", "sebastian/phpcpd": "^4.1", "squizlabs/php_codesniffer": " ^2.9" diff --git a/phing/properties.dist b/phing/properties.dist index 3a49281..ee23c95 100644 --- a/phing/properties.dist +++ b/phing/properties.dist @@ -63,6 +63,15 @@ dir.docker = ${project.basedir}/docker dir.docker.data = ${dir.docker}/data/db dir.docker.logs = ${dir.docker}/logs/nginx +# -------------------------------------------------------------------------------- +# Static Analysis +# -------------------------------------------------------------------------------- + +# Paths of frameworks used to run analysis: +# - PHPStan +# +check.phpstan.command = ./vendor/bin/phpstan analyse + # -------------------------------------------------------------------------------- # Testing # -------------------------------------------------------------------------------- diff --git a/phing/tests.xml b/phing/tests.xml index 3f97f01..a02ab9f 100644 --- a/phing/tests.xml +++ b/phing/tests.xml @@ -43,7 +43,8 @@ @@ -69,6 +70,11 @@ + + + + + diff --git a/phpstan.neon.dist b/phpstan.neon.dist new file mode 100644 index 0000000..31f6166 --- /dev/null +++ b/phpstan.neon.dist @@ -0,0 +1,5 @@ +parameters: + level: 1 + paths: + - src + - tests