diff --git a/rules-tests/DowngradePhp80/Rector/FunctionLike/DowngradeStaticTypeDeclarationRector/config/configured_rule.php b/rules-tests/DowngradePhp80/Rector/FunctionLike/DowngradeStaticTypeDeclarationRector/config/configured_rule.php deleted file mode 100644 index fb6681d737a..00000000000 --- a/rules-tests/DowngradePhp80/Rector/FunctionLike/DowngradeStaticTypeDeclarationRector/config/configured_rule.php +++ /dev/null @@ -1,11 +0,0 @@ -services(); - $services->set(DowngradeStaticTypeDeclarationRector::class); -}; diff --git a/rules-tests/DowngradePhp80/Rector/FunctionLike/DowngradeUnionTypeDeclarationRector/Fixture/array_function.php.inc b/rules-tests/DowngradePhp80/Rector/FunctionLike/DowngradeUnionTypeDeclarationRector/Fixture/array_function.php.inc new file mode 100644 index 00000000000..190651b4930 --- /dev/null +++ b/rules-tests/DowngradePhp80/Rector/FunctionLike/DowngradeUnionTypeDeclarationRector/Fixture/array_function.php.inc @@ -0,0 +1,15 @@ + $obj; + +?> +----- + $obj; + +?> diff --git a/rules/DowngradePhp80/Rector/FunctionLike/DowngradeUnionTypeDeclarationRector.php b/rules/DowngradePhp80/Rector/FunctionLike/DowngradeUnionTypeDeclarationRector.php index a2eb24dec7d..80fe2d822ca 100644 --- a/rules/DowngradePhp80/Rector/FunctionLike/DowngradeUnionTypeDeclarationRector.php +++ b/rules/DowngradePhp80/Rector/FunctionLike/DowngradeUnionTypeDeclarationRector.php @@ -5,6 +5,7 @@ namespace Rector\DowngradePhp80\Rector\FunctionLike; use PhpParser\Node; +use PhpParser\Node\Expr\ArrowFunction; use PhpParser\Node\Expr\Closure; use PhpParser\Node\Stmt\ClassMethod; use PhpParser\Node\Stmt\Function_; @@ -31,7 +32,7 @@ public function __construct( */ public function getNodeTypes(): array { - return [Function_::class, ClassMethod::class, Closure::class]; + return [Function_::class, ClassMethod::class, Closure::class, ArrowFunction::class]; } public function getRuleDefinition(): RuleDefinition @@ -69,7 +70,7 @@ public function echoInput($input) } /** - * @param ClassMethod|Closure|Function_ $node + * @param ClassMethod|Closure|Function_|ArrowFunction $node */ public function refactor(Node $node): ?Node {