From fc519e48e89059e0e6627b780f6868e3f6533047 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Tue, 17 Nov 2026 16:53:20 +0100 Subject: [PATCH] [Naming] Remove deprecated RenameVariableToMatchMethodCallReturnTypeRector --- ...iableToMatchMethodCallReturnTypeRector.php | 77 ------------------- 1 file changed, 77 deletions(-) delete mode 100644 rules/Naming/Rector/Assign/RenameVariableToMatchMethodCallReturnTypeRector.php diff --git a/rules/Naming/Rector/Assign/RenameVariableToMatchMethodCallReturnTypeRector.php b/rules/Naming/Rector/Assign/RenameVariableToMatchMethodCallReturnTypeRector.php deleted file mode 100644 index 16e1249f39e..00000000000 --- a/rules/Naming/Rector/Assign/RenameVariableToMatchMethodCallReturnTypeRector.php +++ /dev/null @@ -1,77 +0,0 @@ -getRunner(); - } - - public function getRunner(): Runner - { - return new Runner(); - } -} -CODE_SAMPLE - , - <<<'CODE_SAMPLE' -class SomeClass -{ - public function run() - { - $runner = $this->getRunner(); - } - - public function getRunner(): Runner - { - return new Runner(); - } -} -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 - )); - } -}