From 6e387d3dea85563b00c44c380feb31df49237255 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sun, 9 Aug 2026 13:49:31 +0200 Subject: [PATCH 1/2] Remove DeprecatedAnnotationToDeprecatedAttributeRector from PHP 8.4 set The rule turns a `@deprecated` annotation into a `#[\Deprecated]` attribute, which escalates a documentation hint into a runtime deprecation warning. That is rarely the intent when upgrading to PHP 8.4, so the rule should be opt-in instead of part of the set. --- config/set/php84.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/config/set/php84.php b/config/set/php84.php index 582a9ec5780..2fb2433c360 100644 --- a/config/set/php84.php +++ b/config/set/php84.php @@ -3,7 +3,6 @@ declare(strict_types=1); use Rector\Config\RectorConfig; -use Rector\Php84\Rector\Class_\DeprecatedAnnotationToDeprecatedAttributeRector; use Rector\Php84\Rector\Foreach_\ForeachToArrayAllRector; use Rector\Php84\Rector\Foreach_\ForeachToArrayAnyRector; use Rector\Php84\Rector\Foreach_\ForeachToArrayFindKeyRector; @@ -19,7 +18,6 @@ RoundingModeEnumRector::class, AddEscapeArgumentRector::class, NewMethodCallWithoutParenthesesRector::class, - DeprecatedAnnotationToDeprecatedAttributeRector::class, ForeachToArrayFindRector::class, ForeachToArrayFindKeyRector::class, ForeachToArrayAllRector::class, From 7e63c4cf4b6e53e5a2d73dff1ae4d4e8c48f31d6 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sun, 9 Aug 2026 17:50:04 +0200 Subject: [PATCH 2/2] Ignore set-registration PHPStan rule for the deliberately unregistered rule --- phpstan.neon | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/phpstan.neon b/phpstan.neon index aa10f8f83ad..182522df8d4 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -123,6 +123,12 @@ parameters: identifier: rector.upgradeDowngradeRegisteredInSet path: rules/Php81/Rector/FuncCall/NullToStrictStringFuncCallArgRector.php + # deliberately kept out of the php84 set, as it turns a doc annotation into a runtime deprecation; + # it stays available to register directly with withRules() + - + identifier: rector.upgradeDowngradeRegisteredInSet + path: rules/Php84/Rector/Class_/DeprecatedAnnotationToDeprecatedAttributeRector.php + # is nested expr - message: '#Access to an undefined property PhpParser\\Node\\Expr\:\:\$expr#'