From e96a1ae0c0d7f29ee3a1d9b10471f918a7568c7f Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Mon, 16 Nov 2026 21:50:01 +0100 Subject: [PATCH 1/2] [Set] Remove deprecated SetList::PHP_* constants --- .../e2e/dont-execute-code/rector.php | 3 +- .../e2e/parse-php7-code/rector.php | 3 +- .../e2e/parse-php8-code/rector.php | 3 +- config/set/level/up-to-php53.php | 3 +- config/set/level/up-to-php54.php | 3 +- config/set/level/up-to-php55.php | 3 +- config/set/level/up-to-php56.php | 3 +- config/set/level/up-to-php70.php | 3 +- config/set/level/up-to-php71.php | 3 +- config/set/level/up-to-php72.php | 3 +- config/set/level/up-to-php73.php | 3 +- config/set/level/up-to-php74.php | 3 +- config/set/level/up-to-php80.php | 3 +- config/set/level/up-to-php81.php | 3 +- config/set/level/up-to-php82.php | 3 +- config/set/level/up-to-php83.php | 3 +- config/set/level/up-to-php84.php | 3 +- config/set/level/up-to-php85.php | 3 +- config/set/level/up-to-php86.php | 3 +- phpstan-deprecated.neon | 7 -- src/Set/ValueObject/SetList.php | 85 ------------------- tests/Bridge/SetRectorsResolverTest.php | 3 +- 22 files changed, 20 insertions(+), 132 deletions(-) diff --git a/build/target-repository/e2e/dont-execute-code/rector.php b/build/target-repository/e2e/dont-execute-code/rector.php index 11af563f5c7..d7f74ccf7fb 100644 --- a/build/target-repository/e2e/dont-execute-code/rector.php +++ b/build/target-repository/e2e/dont-execute-code/rector.php @@ -3,10 +3,9 @@ declare(strict_types=1); use Rector\Config\RectorConfig; -use Rector\Set\ValueObject\SetList; return static function (RectorConfig $rectorConfig): void { $rectorConfig->paths([__DIR__.'/src']); - $rectorConfig->sets([SetList::PHP_53]); + $rectorConfig->sets([__DIR__ . '/vendor/rector/rector/config/set/php53.php']); }; diff --git a/build/target-repository/e2e/parse-php7-code/rector.php b/build/target-repository/e2e/parse-php7-code/rector.php index 11af563f5c7..d7f74ccf7fb 100644 --- a/build/target-repository/e2e/parse-php7-code/rector.php +++ b/build/target-repository/e2e/parse-php7-code/rector.php @@ -3,10 +3,9 @@ declare(strict_types=1); use Rector\Config\RectorConfig; -use Rector\Set\ValueObject\SetList; return static function (RectorConfig $rectorConfig): void { $rectorConfig->paths([__DIR__.'/src']); - $rectorConfig->sets([SetList::PHP_53]); + $rectorConfig->sets([__DIR__ . '/vendor/rector/rector/config/set/php53.php']); }; diff --git a/build/target-repository/e2e/parse-php8-code/rector.php b/build/target-repository/e2e/parse-php8-code/rector.php index 11af563f5c7..d7f74ccf7fb 100644 --- a/build/target-repository/e2e/parse-php8-code/rector.php +++ b/build/target-repository/e2e/parse-php8-code/rector.php @@ -3,10 +3,9 @@ declare(strict_types=1); use Rector\Config\RectorConfig; -use Rector\Set\ValueObject\SetList; return static function (RectorConfig $rectorConfig): void { $rectorConfig->paths([__DIR__.'/src']); - $rectorConfig->sets([SetList::PHP_53]); + $rectorConfig->sets([__DIR__ . '/vendor/rector/rector/config/set/php53.php']); }; diff --git a/config/set/level/up-to-php53.php b/config/set/level/up-to-php53.php index 19d2a5fc571..b9e834e6ddf 100644 --- a/config/set/level/up-to-php53.php +++ b/config/set/level/up-to-php53.php @@ -3,8 +3,7 @@ declare(strict_types=1); use Rector\Config\RectorConfig; -use Rector\Set\ValueObject\SetList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->sets([SetList::PHP_53, SetList::PHP_52]); + $rectorConfig->sets([__DIR__ . '/../php53.php', __DIR__ . '/../php52.php']); }; diff --git a/config/set/level/up-to-php54.php b/config/set/level/up-to-php54.php index 53cd450330e..b5c2075dd3a 100644 --- a/config/set/level/up-to-php54.php +++ b/config/set/level/up-to-php54.php @@ -4,8 +4,7 @@ use Rector\Config\RectorConfig; use Rector\Set\ValueObject\LevelSetList; -use Rector\Set\ValueObject\SetList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->sets([SetList::PHP_54, LevelSetList::UP_TO_PHP_53]); + $rectorConfig->sets([__DIR__ . '/../php54.php', LevelSetList::UP_TO_PHP_53]); }; diff --git a/config/set/level/up-to-php55.php b/config/set/level/up-to-php55.php index ae8dcfd2d18..058e38cc83c 100644 --- a/config/set/level/up-to-php55.php +++ b/config/set/level/up-to-php55.php @@ -4,8 +4,7 @@ use Rector\Config\RectorConfig; use Rector\Set\ValueObject\LevelSetList; -use Rector\Set\ValueObject\SetList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->sets([SetList::PHP_55, LevelSetList::UP_TO_PHP_54]); + $rectorConfig->sets([__DIR__ . '/../php55.php', LevelSetList::UP_TO_PHP_54]); }; diff --git a/config/set/level/up-to-php56.php b/config/set/level/up-to-php56.php index 749c54bbe46..597932db175 100644 --- a/config/set/level/up-to-php56.php +++ b/config/set/level/up-to-php56.php @@ -4,8 +4,7 @@ use Rector\Config\RectorConfig; use Rector\Set\ValueObject\LevelSetList; -use Rector\Set\ValueObject\SetList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->sets([SetList::PHP_56, LevelSetList::UP_TO_PHP_55]); + $rectorConfig->sets([__DIR__ . '/../php56.php', LevelSetList::UP_TO_PHP_55]); }; diff --git a/config/set/level/up-to-php70.php b/config/set/level/up-to-php70.php index 2849697ae9a..63180376cfd 100644 --- a/config/set/level/up-to-php70.php +++ b/config/set/level/up-to-php70.php @@ -4,8 +4,7 @@ use Rector\Config\RectorConfig; use Rector\Set\ValueObject\LevelSetList; -use Rector\Set\ValueObject\SetList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->sets([SetList::PHP_70, LevelSetList::UP_TO_PHP_56]); + $rectorConfig->sets([__DIR__ . '/../php70.php', LevelSetList::UP_TO_PHP_56]); }; diff --git a/config/set/level/up-to-php71.php b/config/set/level/up-to-php71.php index 25ca2ef960d..24450d5d010 100644 --- a/config/set/level/up-to-php71.php +++ b/config/set/level/up-to-php71.php @@ -4,8 +4,7 @@ use Rector\Config\RectorConfig; use Rector\Set\ValueObject\LevelSetList; -use Rector\Set\ValueObject\SetList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->sets([SetList::PHP_71, LevelSetList::UP_TO_PHP_70]); + $rectorConfig->sets([__DIR__ . '/../php71.php', LevelSetList::UP_TO_PHP_70]); }; diff --git a/config/set/level/up-to-php72.php b/config/set/level/up-to-php72.php index 5e08d491b99..5110d2e174d 100644 --- a/config/set/level/up-to-php72.php +++ b/config/set/level/up-to-php72.php @@ -4,8 +4,7 @@ use Rector\Config\RectorConfig; use Rector\Set\ValueObject\LevelSetList; -use Rector\Set\ValueObject\SetList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->sets([SetList::PHP_72, LevelSetList::UP_TO_PHP_71]); + $rectorConfig->sets([__DIR__ . '/../php72.php', LevelSetList::UP_TO_PHP_71]); }; diff --git a/config/set/level/up-to-php73.php b/config/set/level/up-to-php73.php index 3756c17e2ef..d8db748b849 100644 --- a/config/set/level/up-to-php73.php +++ b/config/set/level/up-to-php73.php @@ -4,8 +4,7 @@ use Rector\Config\RectorConfig; use Rector\Set\ValueObject\LevelSetList; -use Rector\Set\ValueObject\SetList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->sets([SetList::PHP_73, LevelSetList::UP_TO_PHP_72]); + $rectorConfig->sets([__DIR__ . '/../php73.php', LevelSetList::UP_TO_PHP_72]); }; diff --git a/config/set/level/up-to-php74.php b/config/set/level/up-to-php74.php index f8e09e8b075..7167a9a5217 100644 --- a/config/set/level/up-to-php74.php +++ b/config/set/level/up-to-php74.php @@ -4,8 +4,7 @@ use Rector\Config\RectorConfig; use Rector\Set\ValueObject\LevelSetList; -use Rector\Set\ValueObject\SetList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->sets([SetList::PHP_74, LevelSetList::UP_TO_PHP_73]); + $rectorConfig->sets([__DIR__ . '/../php74.php', LevelSetList::UP_TO_PHP_73]); }; diff --git a/config/set/level/up-to-php80.php b/config/set/level/up-to-php80.php index 55e3442ba03..9e59c83fad3 100644 --- a/config/set/level/up-to-php80.php +++ b/config/set/level/up-to-php80.php @@ -4,8 +4,7 @@ use Rector\Config\RectorConfig; use Rector\Set\ValueObject\LevelSetList; -use Rector\Set\ValueObject\SetList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->sets([SetList::PHP_80, LevelSetList::UP_TO_PHP_74]); + $rectorConfig->sets([__DIR__ . '/../php80.php', LevelSetList::UP_TO_PHP_74]); }; diff --git a/config/set/level/up-to-php81.php b/config/set/level/up-to-php81.php index b524056347b..50b364b522d 100644 --- a/config/set/level/up-to-php81.php +++ b/config/set/level/up-to-php81.php @@ -4,8 +4,7 @@ use Rector\Config\RectorConfig; use Rector\Set\ValueObject\LevelSetList; -use Rector\Set\ValueObject\SetList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->sets([SetList::PHP_81, LevelSetList::UP_TO_PHP_80]); + $rectorConfig->sets([__DIR__ . '/../php81.php', LevelSetList::UP_TO_PHP_80]); }; diff --git a/config/set/level/up-to-php82.php b/config/set/level/up-to-php82.php index d7f0431d1ae..dd781e06268 100644 --- a/config/set/level/up-to-php82.php +++ b/config/set/level/up-to-php82.php @@ -4,8 +4,7 @@ use Rector\Config\RectorConfig; use Rector\Set\ValueObject\LevelSetList; -use Rector\Set\ValueObject\SetList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->sets([SetList::PHP_82, LevelSetList::UP_TO_PHP_81]); + $rectorConfig->sets([__DIR__ . '/../php82.php', LevelSetList::UP_TO_PHP_81]); }; diff --git a/config/set/level/up-to-php83.php b/config/set/level/up-to-php83.php index 6b9040afd49..0702dc9287a 100644 --- a/config/set/level/up-to-php83.php +++ b/config/set/level/up-to-php83.php @@ -4,8 +4,7 @@ use Rector\Config\RectorConfig; use Rector\Set\ValueObject\LevelSetList; -use Rector\Set\ValueObject\SetList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->sets([SetList::PHP_83, LevelSetList::UP_TO_PHP_82]); + $rectorConfig->sets([__DIR__ . '/../php83.php', LevelSetList::UP_TO_PHP_82]); }; diff --git a/config/set/level/up-to-php84.php b/config/set/level/up-to-php84.php index a81c02efddf..96325425ae3 100644 --- a/config/set/level/up-to-php84.php +++ b/config/set/level/up-to-php84.php @@ -4,8 +4,7 @@ use Rector\Config\RectorConfig; use Rector\Set\ValueObject\LevelSetList; -use Rector\Set\ValueObject\SetList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->sets([SetList::PHP_84, LevelSetList::UP_TO_PHP_83]); + $rectorConfig->sets([__DIR__ . '/../php84.php', LevelSetList::UP_TO_PHP_83]); }; diff --git a/config/set/level/up-to-php85.php b/config/set/level/up-to-php85.php index 11503ac18c0..9c46ed9bbda 100644 --- a/config/set/level/up-to-php85.php +++ b/config/set/level/up-to-php85.php @@ -4,8 +4,7 @@ use Rector\Config\RectorConfig; use Rector\Set\ValueObject\LevelSetList; -use Rector\Set\ValueObject\SetList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->sets([SetList::PHP_85, LevelSetList::UP_TO_PHP_84]); + $rectorConfig->sets([__DIR__ . '/../php85.php', LevelSetList::UP_TO_PHP_84]); }; diff --git a/config/set/level/up-to-php86.php b/config/set/level/up-to-php86.php index abd47e742f1..b12566e0db8 100644 --- a/config/set/level/up-to-php86.php +++ b/config/set/level/up-to-php86.php @@ -4,8 +4,7 @@ use Rector\Config\RectorConfig; use Rector\Set\ValueObject\LevelSetList; -use Rector\Set\ValueObject\SetList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->sets([SetList::PHP_86, LevelSetList::UP_TO_PHP_85]); + $rectorConfig->sets([__DIR__ . '/../php86.php', LevelSetList::UP_TO_PHP_85]); }; diff --git a/phpstan-deprecated.neon b/phpstan-deprecated.neon index 02caadda8b9..784ccdfd16f 100644 --- a/phpstan-deprecated.neon +++ b/phpstan-deprecated.neon @@ -16,10 +16,3 @@ parameters: identifier: classConstant.deprecated paths: - src/Configuration/RectorConfigBuilder.php - - # the deprecated SetList::PHP_* constants are still resolved internally by the level sets and their tests - - - identifier: classConstant.deprecated - paths: - - config/set/level - - tests/Bridge/SetRectorsResolverTest.php diff --git a/src/Set/ValueObject/SetList.php b/src/Set/ValueObject/SetList.php index df0c412a209..cce352d9877 100644 --- a/src/Set/ValueObject/SetList.php +++ b/src/Set/ValueObject/SetList.php @@ -29,91 +29,6 @@ final class SetList */ public const string RECTOR_PRESET = __DIR__ . '/../../../config/set/rector-preset.php'; - /** - * @deprecated Use withPhpSets() or withPhpLevel() instead - */ - public const string PHP_52 = __DIR__ . '/../../../config/set/php52.php'; - - /** - * @deprecated Use withPhpSets() or withPhpLevel() instead - */ - public const string PHP_53 = __DIR__ . '/../../../config/set/php53.php'; - - /** - * @deprecated Use withPhpSets() or withPhpLevel() instead - */ - public const string PHP_54 = __DIR__ . '/../../../config/set/php54.php'; - - /** - * @deprecated Use withPhpSets() or withPhpLevel() instead - */ - public const string PHP_55 = __DIR__ . '/../../../config/set/php55.php'; - - /** - * @deprecated Use withPhpSets() or withPhpLevel() instead - */ - public const string PHP_56 = __DIR__ . '/../../../config/set/php56.php'; - - /** - * @deprecated Use withPhpSets() or withPhpLevel() instead - */ - public const string PHP_70 = __DIR__ . '/../../../config/set/php70.php'; - - /** - * @deprecated Use withPhpSets() or withPhpLevel() instead - */ - public const string PHP_71 = __DIR__ . '/../../../config/set/php71.php'; - - /** - * @deprecated Use withPhpSets() or withPhpLevel() instead - */ - public const string PHP_72 = __DIR__ . '/../../../config/set/php72.php'; - - /** - * @deprecated Use withPhpSets() or withPhpLevel() instead - */ - public const string PHP_73 = __DIR__ . '/../../../config/set/php73.php'; - - /** - * @deprecated Use withPhpSets() or withPhpLevel() instead - */ - public const string PHP_74 = __DIR__ . '/../../../config/set/php74.php'; - - /** - * @deprecated Use withPhpSets() or withPhpLevel() instead - */ - public const string PHP_80 = __DIR__ . '/../../../config/set/php80.php'; - - /** - * @deprecated Use withPhpSets() or withPhpLevel() instead - */ - public const string PHP_81 = __DIR__ . '/../../../config/set/php81.php'; - - /** - * @deprecated Use withPhpSets() or withPhpLevel() instead - */ - public const string PHP_82 = __DIR__ . '/../../../config/set/php82.php'; - - /** - * @deprecated Use withPhpSets() or withPhpLevel() instead - */ - public const string PHP_83 = __DIR__ . '/../../../config/set/php83.php'; - - /** - * @deprecated Use withPhpSets() or withPhpLevel() instead - */ - public const string PHP_84 = __DIR__ . '/../../../config/set/php84.php'; - - /** - * @deprecated Use withPhpSets() or withPhpLevel() instead - */ - public const string PHP_85 = __DIR__ . '/../../../config/set/php85.php'; - - /** - * @deprecated Use withPhpSets() or withPhpLevel() instead - */ - public const string PHP_86 = __DIR__ . '/../../../config/set/php86.php'; - public const string PRIVATIZATION = __DIR__ . '/../../../config/set/privatization.php'; public const string TYPE_DECLARATION = __DIR__ . '/../../../config/set/type-declaration.php'; diff --git a/tests/Bridge/SetRectorsResolverTest.php b/tests/Bridge/SetRectorsResolverTest.php index 24fb0508187..420b9c03565 100644 --- a/tests/Bridge/SetRectorsResolverTest.php +++ b/tests/Bridge/SetRectorsResolverTest.php @@ -7,7 +7,6 @@ use PHPUnit\Framework\TestCase; use Rector\Bridge\SetRectorsResolver; use Rector\Contract\Rector\RectorInterface; -use Rector\Set\ValueObject\SetList; final class SetRectorsResolverTest extends TestCase { @@ -33,7 +32,7 @@ public function testResolvePhpVersionBasedSet(): void public function testResolveWithConfiguration(): void { $rectorRulesWithConfiguration = $this->setRectorsResolver->resolveFromFilePathIncludingConfiguration( - SetList::PHP_73 + __DIR__ . '/../../config/set/php73.php' ); $this->assertCount(10, $rectorRulesWithConfiguration); From c2cc1f52a836ad049b3e6dac9065a43d1b6c3c34 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Mon, 16 Nov 2026 22:00:23 +0100 Subject: [PATCH 2/2] Bump symplify/phpstan-rules to ^14.19.4 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 64b9534f3b3..40d5df3c034 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,7 @@ "shipmonk/dead-code-detector": "^1.4", "symfony/process": "^8.1", "symplify/easy-coding-standard": "^13.3.11", - "symplify/phpstan-rules": "^14.19", + "symplify/phpstan-rules": "^14.19.4", "tomasvotruba/class-leak": "^2.3.4", "tomasvotruba/fast-unit": "^0.1", "tomasvotruba/type-coverage": "^2.5"