Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace Rector\Tests\DowngradePhp81\Rector\FunctionLike\DowngradeNeverTypeDeclarationRector\Fixture;

$callable = fn (): never => throw new \RuntimeException();

?>
-----
<?php

namespace Rector\Tests\DowngradePhp81\Rector\FunctionLike\DowngradeNeverTypeDeclarationRector\Fixture;

$callable = fn () => throw new \RuntimeException();

?>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Rector\DowngradePhp81\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_;
Expand All @@ -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
Expand Down Expand Up @@ -60,7 +61,7 @@ function someFunction()
}

/**
* @param ClassMethod|Closure|Function_ $node
* @param ArrowFunction|ClassMethod|Closure|Function_ $node
*/
public function refactor(Node $node): ?Node
{
Expand Down
Loading