File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717 typeDeclarations: true ,
1818 typeDeclarationDocblocks: true ,
1919 privatization: true ,
20- naming: true ,
2120 instanceOf: true ,
2221 earlyReturn: true ,
2322 rectorPreset: true ,
Original file line number Diff line number Diff line change @@ -641,6 +641,7 @@ public function withPhp74Sets(): self
641641 // as we already use PHP 8.0 and should go with withPhpSets() instead
642642
643643 /**
644+ * @param bool $naming @deprecated The naming set often causes conflicting variable and param names; use a coding standard tool instead
644645 * @param bool $instanceOf @deprecated Use $codeQuality instead, as most instanceof rules were moved there
645646 * @param bool $if @deprecated Use $codeQuality and $codingStyle instead, as the if rules were moved there or deprecated
646647 * @param bool $earlyReturn @deprecated Use $codeQuality instead, as all early return rules were moved there
@@ -668,6 +669,10 @@ public function withPreparedSets(
668669 ): self {
669670 Notifier ::notifyNotSuitableMethodForPHP74 (__METHOD__ );
670671
672+ if ($ naming ) {
673+ Notifier ::notifyDeprecatedNamingSet ();
674+ }
675+
671676 $ setMap = [
672677 SetList::DEAD_CODE => $ deadCode ,
673678 SetList::CODE_QUALITY => $ codeQuality ,
Original file line number Diff line number Diff line change @@ -40,6 +40,15 @@ public static function notifyDeprecatedPhpSet(string $set): void
4040 $ symfonyStyle ->warning ($ message );
4141 }
4242
43+ public static function notifyDeprecatedNamingSet (): void
44+ {
45+ $ message = 'The "naming" prepared set is deprecated, as it often causes conflicting variable and param names and removes context. '
46+ . 'Renaming to match types belongs to a coding standard tool rather than Rector. ' ;
47+
48+ $ symfonyStyle = new SymfonyStyle (new ArgvInput (), new ConsoleOutput ());
49+ $ symfonyStyle ->warning ($ message );
50+ }
51+
4352 public static function errorWithPhpSetsNotSuitableForPHP74AndLower (): void
4453 {
4554 if (PHP_VERSION_ID >= 80000 ) {
You can’t perform that action at this time.
0 commit comments