diff --git a/composer.json b/composer.json index b9a49d4..490f0d0 100644 --- a/composer.json +++ b/composer.json @@ -108,6 +108,8 @@ "masterminds/html5": "^2.7.5", "phpstan/extension-installer": "*", "phpstan/phpstan": "*", + "phpstan/phpstan-deprecation-rules": "*", + "phpstan/phpstan-phpunit": "*", "phpstan/phpstan-doctrine": "*", "phpstan/phpstan-symfony": "*", "phpunit/phpunit": "^10.5|^11|^12|^13", diff --git a/phpstan.neon b/phpstan.neon index 16f44c1..fac13b9 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -3,22 +3,36 @@ parameters: paths: - src - tests + # Same ignores in all the process bundles: not all of them match in each bundle + reportUnmatchedIgnoredErrors: false ignoreErrors: + # PHPUnit 13 deprecates expectExceptionMessage() (sebastianbergmann/phpunit#6560), still needed with PHPUnit 11 and 12 + - message: '#^Call to deprecated method expectExceptionMessage\(\) of class PHPUnit\\Framework\\TestCase#' + path: tests/* + # Symfony 8.1 deprecates HttpKernel\Bundle\BundleInterface: its replacement does not exist in Symfony 6.4 and 7.4 + - message: '#typehint with deprecated interface Symfony\\Component\\HttpKernel\\Bundle\\BundleInterface#' + path: tests/* + # The tests of the deprecated code of the bundles use it + - message: '#deprecated .*CleverAge\\#' + path: tests/* + # Assertions on values already known by PHPStan, kept as regression checks (or values changed by reference) + - identifier: staticMethod.alreadyNarrowedType + path: tests/* + - identifier: method.alreadyNarrowedType + path: tests/* + - identifier: staticMethod.impossibleType + path: tests/* + - identifier: method.impossibleType + path: tests/* # ProcessEvent::isProcessStopped() is only provided by the process bundle version following 5.4 (#220): remove # these entries once this version is required - - - identifier: function.alreadyNarrowedType - paths: - - src/EventSubscriber/ProcessEventSubscriber.php - - tests/EventSubscriber/ProcessEventSubscriberTest.php - reportUnmatched: false - - - identifier: function.impossibleType - paths: - - src/EventSubscriber/ProcessEventSubscriber.php - - tests/EventSubscriber/ProcessEventSubscriberTest.php - reportUnmatched: false - - - identifier: arguments.count - path: tests/EventSubscriber/ProcessEventSubscriberTest.php - reportUnmatched: false + - identifier: function.alreadyNarrowedType + paths: + - src/EventSubscriber/ProcessEventSubscriber.php + - tests/EventSubscriber/ProcessEventSubscriberTest.php + - identifier: function.impossibleType + paths: + - src/EventSubscriber/ProcessEventSubscriber.php + - tests/EventSubscriber/ProcessEventSubscriberTest.php + - identifier: arguments.count + path: tests/EventSubscriber/ProcessEventSubscriberTest.php