From 7096e3af0b08e15333dd4156fc244423c50c75d2 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Tue, 17 Nov 2026 16:53:34 +0100 Subject: [PATCH] [Naming] Remove deprecated RenameForeachValueVariableToMatchMethodCallReturnTypeRector --- ...iableToMatchMethodCallReturnTypeRector.php | 77 ------------------- 1 file changed, 77 deletions(-) delete mode 100644 rules/Naming/Rector/Foreach_/RenameForeachValueVariableToMatchMethodCallReturnTypeRector.php diff --git a/rules/Naming/Rector/Foreach_/RenameForeachValueVariableToMatchMethodCallReturnTypeRector.php b/rules/Naming/Rector/Foreach_/RenameForeachValueVariableToMatchMethodCallReturnTypeRector.php deleted file mode 100644 index 2d0aa724caa..00000000000 --- a/rules/Naming/Rector/Foreach_/RenameForeachValueVariableToMatchMethodCallReturnTypeRector.php +++ /dev/null @@ -1,77 +0,0 @@ -getMethods() as $property) { - $array[] = $property; - } - } -} -CODE_SAMPLE - - , - <<<'CODE_SAMPLE' -class SomeClass -{ - public function run() - { - $array = []; - foreach ($object->getMethods() as $method) { - $array[] = $method; - } - } -} -CODE_SAMPLE - ), - ] - ); - } - - /** - * @return array> - */ - public function getNodeTypes(): array - { - return [ClassMethod::class, Closure::class, Function_::class]; - } - - /** - * @param ClassMethod|Closure|Function_ $node - */ - public function refactor(Node $node): ?Node - { - throw new ShouldNotHappenException(sprintf( - '"%s" rule is deprecated, as it is risky and can clobber meaningful local variable names', - self::class - )); - } -}