From f12d0893c2ff8fdf4e06c38478d4af246ab6c851 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sat, 24 Oct 2026 01:10:38 +0200 Subject: [PATCH 1/2] remove deprecated withPhp53Sets() ... withPhp74Sets() methods --- src/Configuration/Option.php | 5 -- .../Parameter/SimpleParameterProvider.php | 1 - src/Configuration/RectorConfigBuilder.php | 61 ------------------- src/Console/Command/ProcessCommand.php | 1 - src/Console/Command/ValidateConfigCommand.php | 1 - src/Reporting/DeprecatedRulesReporter.php | 19 ------ .../Command/ValidateConfigCommandTest.php | 1 - 7 files changed, 89 deletions(-) diff --git a/src/Configuration/Option.php b/src/Configuration/Option.php index fcd6cdcc28a..604a5e14016 100644 --- a/src/Configuration/Option.php +++ b/src/Configuration/Option.php @@ -240,11 +240,6 @@ final class Option */ public const string SKIPPED_NON_RECTOR_CLASSES = 'skipped_non_rector_classes'; - /** - * @internal For reporting deprecated withPhp53Sets() ... withPhp74Sets() methods - */ - public const string DEPRECATED_PHP_SETS_METHODS = 'deprecated_php_sets_methods'; - /** * @internal For reporting deprecated withAttributesSets() arguments */ diff --git a/src/Configuration/Parameter/SimpleParameterProvider.php b/src/Configuration/Parameter/SimpleParameterProvider.php index df29ac160a2..b1dd3641cd5 100644 --- a/src/Configuration/Parameter/SimpleParameterProvider.php +++ b/src/Configuration/Parameter/SimpleParameterProvider.php @@ -40,7 +40,6 @@ final class SimpleParameterProvider Option::SKIPPED_RECTOR_RULES, Option::SKIPPED_NON_RECTOR_CLASSES, Option::SKIPPED_START_WITH_SHORT_OPEN_TAG_FILES, - Option::DEPRECATED_PHP_SETS_METHODS, Option::DEPRECATED_ATTRIBUTES_SETS_ARGS, Option::DEPRECATED_COMPOSER_BASED_ARGS, Option::LEVEL_OVERFLOWS, diff --git a/src/Configuration/RectorConfigBuilder.php b/src/Configuration/RectorConfigBuilder.php index 13620537266..0462a21ed36 100644 --- a/src/Configuration/RectorConfigBuilder.php +++ b/src/Configuration/RectorConfigBuilder.php @@ -583,60 +583,6 @@ public function withPhpSets( return $this->addPhpLevelSets($pickedPhpVersions[0]); } - #[Deprecated(message: 'Use "withPhpLevel()" instead, it raises PHP level one rule at a time.')] - public function withPhp53Sets(): self - { - return $this->reportDeprecatedPhpSetsMethod(__FUNCTION__); - } - - #[Deprecated(message: 'Use "withPhpLevel()" instead, it raises PHP level one rule at a time.')] - public function withPhp54Sets(): self - { - return $this->reportDeprecatedPhpSetsMethod(__FUNCTION__); - } - - #[Deprecated(message: 'Use "withPhpLevel()" instead, it raises PHP level one rule at a time.')] - public function withPhp55Sets(): self - { - return $this->reportDeprecatedPhpSetsMethod(__FUNCTION__); - } - - #[Deprecated(message: 'Use "withPhpLevel()" instead, it raises PHP level one rule at a time.')] - public function withPhp56Sets(): self - { - return $this->reportDeprecatedPhpSetsMethod(__FUNCTION__); - } - - #[Deprecated(message: 'Use "withPhpLevel()" instead, it raises PHP level one rule at a time.')] - public function withPhp70Sets(): self - { - return $this->reportDeprecatedPhpSetsMethod(__FUNCTION__); - } - - #[Deprecated(message: 'Use "withPhpLevel()" instead, it raises PHP level one rule at a time.')] - public function withPhp71Sets(): self - { - return $this->reportDeprecatedPhpSetsMethod(__FUNCTION__); - } - - #[Deprecated(message: 'Use "withPhpLevel()" instead, it raises PHP level one rule at a time.')] - public function withPhp72Sets(): self - { - return $this->reportDeprecatedPhpSetsMethod(__FUNCTION__); - } - - #[Deprecated(message: 'Use "withPhpLevel()" instead, it raises PHP level one rule at a time.')] - public function withPhp73Sets(): self - { - return $this->reportDeprecatedPhpSetsMethod(__FUNCTION__); - } - - #[Deprecated(message: 'Use "withPhpLevel()" instead, it raises PHP level one rule at a time.')] - public function withPhp74Sets(): self - { - return $this->reportDeprecatedPhpSetsMethod(__FUNCTION__); - } - // there is no withPhp80Sets() and above, // as we already use PHP 8.0 and should go with withPhpSets() instead @@ -1165,13 +1111,6 @@ private function addPhpLevelSets(int $phpVersion): self return $this; } - private function reportDeprecatedPhpSetsMethod(string $methodName): self - { - SimpleParameterProvider::addParameter(Option::DEPRECATED_PHP_SETS_METHODS, $methodName); - - return $this; - } - /** * @param array> $availableRules */ diff --git a/src/Console/Command/ProcessCommand.php b/src/Console/Command/ProcessCommand.php index 43dbea9fd1b..c2af0b54ad0 100644 --- a/src/Console/Command/ProcessCommand.php +++ b/src/Console/Command/ProcessCommand.php @@ -195,7 +195,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int // 4. Deprecations reporter $this->deprecatedRulesReporter->reportDeprecatedRules(); $this->deprecatedRulesReporter->reportDeprecatedSkippedRules(); - $this->deprecatedRulesReporter->reportDeprecatedPhpSetsMethods(); $this->deprecatedRulesReporter->reportDeprecatedAttributesSetsArgs(); $this->deprecatedRulesReporter->reportDeprecatedComposerBasedArgs(); diff --git a/src/Console/Command/ValidateConfigCommand.php b/src/Console/Command/ValidateConfigCommand.php index eff7bf20b4c..66fe3d548eb 100644 --- a/src/Console/Command/ValidateConfigCommand.php +++ b/src/Console/Command/ValidateConfigCommand.php @@ -59,7 +59,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int $issueCount += $this->deprecatedRulesReporter->reportDeprecatedRules(); $issueCount += $this->deprecatedRulesReporter->reportDeprecatedSkippedRules(); - $issueCount += $this->deprecatedRulesReporter->reportDeprecatedPhpSetsMethods(); $issueCount += $this->deprecatedRulesReporter->reportDeprecatedAttributesSetsArgs(); $issueCount += $this->deprecatedRulesReporter->reportDeprecatedComposerBasedArgs(); diff --git a/src/Reporting/DeprecatedRulesReporter.php b/src/Reporting/DeprecatedRulesReporter.php index 322d01cb22c..373c20f1295 100644 --- a/src/Reporting/DeprecatedRulesReporter.php +++ b/src/Reporting/DeprecatedRulesReporter.php @@ -57,25 +57,6 @@ public function reportDeprecatedSkippedRules(): int return $reportedCount; } - public function reportDeprecatedPhpSetsMethods(): int - { - /** @var string[] $deprecatedPhpSetsMethods */ - $deprecatedPhpSetsMethods = SimpleParameterProvider::provideArrayParameter( - Option::DEPRECATED_PHP_SETS_METHODS - ); - - $reportedCount = 0; - foreach (array_unique($deprecatedPhpSetsMethods) as $deprecatedPhpSetsMethod) { - $this->symfonyStyle->warning(sprintf( - 'The "->%s()" method is deprecated and no longer applied. Use "->withPhpLevel()" instead, to raise PHP level one rule at a time.', - $deprecatedPhpSetsMethod - )); - ++$reportedCount; - } - - return $reportedCount; - } - public function reportDeprecatedAttributesSetsArgs(): int { /** @var string[] $deprecatedAttributesSetsArgs */ diff --git a/tests/Console/Command/ValidateConfigCommandTest.php b/tests/Console/Command/ValidateConfigCommandTest.php index f15f79ba1e4..18b723548b1 100644 --- a/tests/Console/Command/ValidateConfigCommandTest.php +++ b/tests/Console/Command/ValidateConfigCommandTest.php @@ -36,7 +36,6 @@ protected function setUp(): void Option::SKIPPED_NON_RECTOR_CLASSES, Option::SKIPPED_RECTOR_RULES, Option::SKIPPED_START_WITH_SHORT_OPEN_TAG_FILES, - Option::DEPRECATED_PHP_SETS_METHODS, Option::DEPRECATED_ATTRIBUTES_SETS_ARGS, Option::DEPRECATED_COMPOSER_BASED_ARGS, Option::ROOT_STANDALONE_REGISTERED_RULES, From 72ee330c1db65e26f3df5c9ac9f5283deb0160ec Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 23 Oct 2026 23:21:50 +0000 Subject: [PATCH 2/2] [ci-review] Rector Rectify --- src/Configuration/RectorConfigBuilder.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Configuration/RectorConfigBuilder.php b/src/Configuration/RectorConfigBuilder.php index 0462a21ed36..23199b2f1b0 100644 --- a/src/Configuration/RectorConfigBuilder.php +++ b/src/Configuration/RectorConfigBuilder.php @@ -4,7 +4,6 @@ namespace Rector\Configuration; -use Deprecated; use DrupalRector\Set\DrupalSetList; use Nette\Utils\Strings; use PhpParser\NodeVisitor;