diff --git a/composer.json b/composer.json index 83c6fe1c..b2c49cb5 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,6 @@ }, "require-dev": { "filp/whoops": "^2.7", - "pepakriz/phpstan-exception-rules": "^0.12", "phpstan/phpstan": "^1.0", "phpstan/phpstan-phpunit": "^1.0", "phpunit/phpunit": "^9.0", diff --git a/composer.lock b/composer.lock index c3139611..de18757d 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": "82ed2b5956bd8c599faeb3d1d1e8f1ed", + "content-hash": "a3de3375b7bd5909c16bdc77513e2d8f", "packages": [ { "name": "altorouter/altorouter", @@ -1095,63 +1095,6 @@ }, "time": "2021-11-30T19:35:32+00:00" }, - { - "name": "pepakriz/phpstan-exception-rules", - "version": "v0.12.0", - "source": { - "type": "git", - "url": "https://github.com/pepakriz/phpstan-exception-rules.git", - "reference": "c5f3fe501e5a6c57c33fb678ad9278131bc1b9bd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/pepakriz/phpstan-exception-rules/zipball/c5f3fe501e5a6c57c33fb678ad9278131bc1b9bd", - "reference": "c5f3fe501e5a6c57c33fb678ad9278131bc1b9bd", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.13", - "php": ">=7.1", - "phpstan/phpstan": "^1.0" - }, - "require-dev": { - "nette/utils": "^3.0", - "php-parallel-lint/php-console-highlighter": "^0.4.0", - "php-parallel-lint/php-parallel-lint": "^1.2.0", - "phpstan/phpstan-nette": "^1.0", - "phpstan/phpstan-phpunit": "^1.0", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^7.5.6 || ^9.4.2", - "slevomat/coding-standard": "^6.4.1", - "squizlabs/php_codesniffer": "~3.5.2" - }, - "type": "phpstan-extension", - "extra": { - "branch-alias": { - "dev-master": "0.12-dev" - }, - "phpstan": { - "includes": [ - "extension.neon" - ] - } - }, - "autoload": { - "psr-4": { - "Pepakriz\\PHPStanExceptionRules\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Exception rules for PHPStan", - "support": { - "issues": "https://github.com/pepakriz/phpstan-exception-rules/issues", - "source": "https://github.com/pepakriz/phpstan-exception-rules/tree/v0.12.0" - }, - "time": "2021-11-07T19:03:56+00:00" - }, { "name": "phar-io/manifest", "version": "2.0.3", @@ -3809,12 +3752,12 @@ "version": "3.6.2", "source": { "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a", "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a", "shasum": "" }, @@ -4668,13 +4611,13 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { "php": ">=7.4.0" }, - "platform-dev": [], + "platform-dev": {}, "platform-overrides": { "php": "7.4" }, diff --git a/phpstan.neon b/phpstan.neon index 1727e1e7..f43d4e8a 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,6 +1,5 @@ includes: - vendor/phpstan/phpstan-phpunit/extension.neon - - vendor/pepakriz/phpstan-exception-rules/extension.neon parameters: level: 5 @@ -12,13 +11,17 @@ parameters: - app/view/* dynamicConstantNames: - INTL_ICU_VERSION - exceptionRules: + exceptions: # ignore some exceptions and their chlidrens - uncheckedExceptions: + uncheckedExceptionClasses: - Error - LogicException - # ignore all exceptions errors in tests classes - methodWhitelist: - PHPUnit\Framework\TestCase: '#.*#i' + check: + missingCheckedExceptionInThrows: true tmpDir: build/phpstan treatPhpDocTypesAsCertain: false + + ignoreErrors: + - # ignore all exceptions errors in tests classes + message: '#missing from the PHPDoc @throws tag#' + path: tests/*