diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96bdb7ba..407d7152 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,6 +47,9 @@ jobs: - name: Run vimeo/psalm on internal code run: ./vendor/bin/psalm --config=psalm.xml --no-progress --shepherd --show-info=false --stats + - name: Run phpstan on internal code + run: ./vendor/bin/phpstan analyze -c phpstan.neon src tests + tests: name: Tests runs-on: ubuntu-latest diff --git a/composer.json b/composer.json index 4a1266e6..6527e784 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,8 @@ "phpunit/phpunit": "^9.5", "vimeo/psalm": "^4.6", "friendsofphp/php-cs-fixer": "^2.18", - "symfony/var-dumper": "^5.2" + "symfony/var-dumper": "^5.2", + "phpstan/phpstan": "^0.12.88" }, "autoload": { "psr-4": { @@ -46,12 +47,14 @@ ], "test-quality": [ "@csrun", - "@psalm" + "@psalm", + "@phpstan" ], "test-unit": "./vendor/bin/phpunit --testsuite=unit", "test-integration": "./vendor/bin/phpunit --testsuite=integration", "test-coverage": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --testsuite=unit,integration --coverage-html=coverage", "psalm": "./vendor/bin/psalm", + "phpstan": "./vendor/bin/phpstan analyze -c phpstan.neon src tests", "csfix": "./vendor/bin/php-cs-fixer fix --allow-risky=yes", "csrun": "./vendor/bin/php-cs-fixer fix --allow-risky=yes --dry-run" } diff --git a/composer.lock b/composer.lock index 2052a9e5..14914860 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "405995b0e40ba2cb663ce106031ae3ce", + "content-hash": "bca08720d7cf241b53d2abfc0ff58205", "packages": [ { "name": "psr/container", @@ -2248,6 +2248,66 @@ }, "time": "2021-03-17T13:42:18+00:00" }, + { + "name": "phpstan/phpstan", + "version": "0.12.88", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "464d1a81af49409c41074aa6640ed0c4cbd9bb68" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/464d1a81af49409c41074aa6640ed0c4cbd9bb68", + "reference": "464d1a81af49409c41074aa6640ed0c4cbd9bb68", + "shasum": "" + }, + "require": { + "php": "^7.1|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.12-dev" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "support": { + "issues": "https://github.com/phpstan/phpstan/issues", + "source": "https://github.com/phpstan/phpstan/tree/0.12.88" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://www.patreon.com/phpstan", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", + "type": "tidelift" + } + ], + "time": "2021-05-17T12:24:49+00:00" + }, { "name": "phpunit/php-code-coverage", "version": "9.2.5", diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 00000000..a2b3ad88 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,2 @@ +parameters: + level: 5