From 893660c6206d751dd0e7d024df5f101777f57b56 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Mon, 16 Nov 2026 17:59:01 +0100 Subject: [PATCH] [TypeDeclaration] Remove 2 deprecated rules --- ...turnArrayDocblockBasedOnArrayMapRector.php | 72 ------------------ .../StrictStringParamConcatRector.php | 74 ------------------- 2 files changed, 146 deletions(-) delete mode 100644 rules/TypeDeclaration/Rector/ClassMethod/AddReturnArrayDocblockBasedOnArrayMapRector.php delete mode 100644 rules/TypeDeclaration/Rector/ClassMethod/StrictStringParamConcatRector.php diff --git a/rules/TypeDeclaration/Rector/ClassMethod/AddReturnArrayDocblockBasedOnArrayMapRector.php b/rules/TypeDeclaration/Rector/ClassMethod/AddReturnArrayDocblockBasedOnArrayMapRector.php deleted file mode 100644 index 0eaa19d5f04..00000000000 --- a/rules/TypeDeclaration/Rector/ClassMethod/AddReturnArrayDocblockBasedOnArrayMapRector.php +++ /dev/null @@ -1,72 +0,0 @@ -id; - }, $items); - } -} -CODE_SAMPLE - , - <<<'CODE_SAMPLE' -class SomeClass -{ - /** - * @return int[] - */ - public function getItems(array $items) - { - return array_map(function ($item): int { - return $item->id; - }, $items); - } -} -CODE_SAMPLE - )], - ); - } - - public function getNodeTypes(): array - { - return [ClassMethod::class, Function_::class]; - } - - /** - * @param ClassMethod|Function_ $node - */ - public function refactor(Node $node): null|Function_|ClassMethod - { - throw new ShouldNotHappenException(sprintf( - '"%s" rule is deprecated, as too niche and of little practical value. The item type is already known from the inline closure return type', - self::class - )); - } -} diff --git a/rules/TypeDeclaration/Rector/ClassMethod/StrictStringParamConcatRector.php b/rules/TypeDeclaration/Rector/ClassMethod/StrictStringParamConcatRector.php deleted file mode 100644 index c61f837349e..00000000000 --- a/rules/TypeDeclaration/Rector/ClassMethod/StrictStringParamConcatRector.php +++ /dev/null @@ -1,74 +0,0 @@ -> - */ - public function getNodeTypes(): array - { - return [ClassMethod::class, Function_::class, Closure::class]; - } - - public function provideMinPhpVersion(): int - { - return PhpVersion::PHP_70; - } - - /** - * @param ClassMethod|Function_|Closure $node - */ - public function refactor(Node $node): ?Node - { - throw new ShouldNotHappenException(sprintf( - '"%s" is deprecated as it produces too many false positives. Add the type manually where needed instead', - self::class - )); - } -}