From e397726d6253ce736aafa822d742f669bc23bd37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Niedzielski?= Date: Fri, 17 Sep 2021 16:37:55 +0200 Subject: [PATCH] Added PHPStan level 0 static analysis --- .github/workflows/ci.yaml | 3 +++ composer.json | 6 ++++-- phpstan.neon | 4 ++++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 phpstan.neon diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 13dee97a42..f7669c3157 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -45,5 +45,8 @@ jobs: - name: Run code style check run: composer run-script check-cs -- --format=checkstyle | cs2pr + - name: Run PHPStan analysis + run: composer run-script phpstan + - name: Run test suite run: composer run-script --timeout=600 test diff --git a/composer.json b/composer.json index 7f43af59c3..6632d47787 100644 --- a/composer.json +++ b/composer.json @@ -55,12 +55,14 @@ "phpunit/phpunit": "^8.1", "matthiasnoback/symfony-dependency-injection-test": "^4.0", "ezsystems/doctrine-dbal-schema": "^1.0@dev", - "ezsystems/ezplatform-code-style": "^1.0" + "ezsystems/ezplatform-code-style": "^1.0", + "phpstan/phpstan": "^0.12.99" }, "scripts": { "fix-cs": "php-cs-fixer fix --config=.php-cs-fixer.php --show-progress=dots", "check-cs": "@fix-cs --dry-run", - "test": "phpunit -c phpunit.xml" + "test": "phpunit -c phpunit.xml", + "phpstan": "phpstan analyse -c phpstan.neon" }, "extra": { "branch-alias": { diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000000..35123d6cc1 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,4 @@ +parameters: + level: 0 + paths: + - src