From f584f0faea2dec06d38bef84f6dc14ba552e5be9 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Thu, 8 Oct 2026 22:32:59 +0200 Subject: [PATCH 1/2] [Configuration] Deprecate naming prepared set with a warning --- src/Configuration/RectorConfigBuilder.php | 5 +++++ src/Console/Notifier.php | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/src/Configuration/RectorConfigBuilder.php b/src/Configuration/RectorConfigBuilder.php index 3e85220adf4..622a72fc529 100644 --- a/src/Configuration/RectorConfigBuilder.php +++ b/src/Configuration/RectorConfigBuilder.php @@ -641,6 +641,7 @@ public function withPhp74Sets(): self // as we already use PHP 8.0 and should go with withPhpSets() instead /** + * @param bool $naming @deprecated The naming set often causes conflicting variable and param names; use a coding standard tool instead * @param bool $instanceOf @deprecated Use $codeQuality instead, as most instanceof rules were moved there * @param bool $if @deprecated Use $codeQuality and $codingStyle instead, as the if rules were moved there or deprecated * @param bool $earlyReturn @deprecated Use $codeQuality instead, as all early return rules were moved there @@ -668,6 +669,10 @@ public function withPreparedSets( ): self { Notifier::notifyNotSuitableMethodForPHP74(__METHOD__); + if ($naming) { + Notifier::notifyDeprecatedNamingSet(); + } + $setMap = [ SetList::DEAD_CODE => $deadCode, SetList::CODE_QUALITY => $codeQuality, diff --git a/src/Console/Notifier.php b/src/Console/Notifier.php index 06539f12f5b..347c3505f17 100644 --- a/src/Console/Notifier.php +++ b/src/Console/Notifier.php @@ -40,6 +40,15 @@ public static function notifyDeprecatedPhpSet(string $set): void $symfonyStyle->warning($message); } + public static function notifyDeprecatedNamingSet(): void + { + $message = 'The "naming" prepared set is deprecated, as it often causes conflicting variable and param names and removes context. ' + . 'Renaming to match types belongs to a coding standard tool rather than Rector.'; + + $symfonyStyle = new SymfonyStyle(new ArgvInput(), new ConsoleOutput()); + $symfonyStyle->warning($message); + } + public static function errorWithPhpSetsNotSuitableForPHP74AndLower(): void { if (PHP_VERSION_ID >= 80000) { From 010dafea3507e60284d455c151d930351cd5f105 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Thu, 8 Oct 2026 22:40:22 +0200 Subject: [PATCH 2/2] [Configuration] Drop deprecated naming set from own rector.php --- rector.php | 1 - 1 file changed, 1 deletion(-) diff --git a/rector.php b/rector.php index fda67e23fa8..b095ee50e63 100644 --- a/rector.php +++ b/rector.php @@ -17,7 +17,6 @@ typeDeclarations: true, typeDeclarationDocblocks: true, privatization: true, - naming: true, instanceOf: true, earlyReturn: true, rectorPreset: true,