diff --git a/.gitattributes b/.gitattributes index 798103b..ba9bf4c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,7 +1,7 @@ /.docker export-ignore /.gitattributes export-ignore /.gitignore export-ignore -/.travis.yml export-ignore +/.phpstan.neon export-ignore /docker-compose.yml export-ignore /docs export-ignore /phpunit.xml export-ignore diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 782259a..a9c324d 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -33,4 +33,4 @@ jobs: uses: "ramsey/composer-install@v2" - name: Run PHPStan - run: vendor/bin/phpstan.phar analyze src --level 8 + run: composer run phpstan diff --git a/.phpstan.neon b/.phpstan.neon new file mode 100644 index 0000000..cdc94e3 --- /dev/null +++ b/.phpstan.neon @@ -0,0 +1,29 @@ +parameters: + level: 8 + + paths: + - src/ + + scanDirectories: + - vendor + + ignoreErrors: + - + message: "#^Class Art4\\\\JsonApiClient\\\\Helper\\\\AccessKey extends generic class SplStack but does not specify its types\\: TValue$#" + count: 1 + path: src/Helper/AccessKey.php + + - + message: "#^Property Art4\\\\JsonApiClient\\\\V1\\\\ResourceNull\\:\\:\\$data is never read, only written\\.$#" + count: 1 + path: src/V1/ResourceNull.php + + - + message: "#^Property Art4\\\\JsonApiClient\\\\V1\\\\ResourceNull\\:\\:\\$manager is never read, only written\\.$#" + count: 1 + path: src/V1/ResourceNull.php + + - + message: "#^Property Art4\\\\JsonApiClient\\\\V1\\\\ResourceNull\\:\\:\\$parent is never read, only written\\.$#" + count: 1 + path: src/V1/ResourceNull.php diff --git a/composer.json b/composer.json index 81629f7..ae83a95 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ } }, "scripts": { - "phpstan": "phpstan analyze src --memory-limit 512M --level 8", + "phpstan": "phpstan analyze --memory-limit 512M --configuration .phpstan.neon", "phpunit": "phpunit" }, "config": {