Skip to content

Commit 4cb8bcd

Browse files
committed
fix
1 parent 0200720 commit 4cb8bcd

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

rules/CodingStyle/Rector/FunctionLike/FunctionLikeToFirstClassCallableRector.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use PhpParser\Node;
88
use PhpParser\Node\Arg;
9+
use PhpParser\Node\Expr;
910
use PhpParser\Node\Expr\ArrowFunction;
1011
use PhpParser\Node\Expr\CallLike;
1112
use PhpParser\Node\Expr\Closure;
@@ -133,6 +134,11 @@ private function extractCallLike(Closure|ArrowFunction $node): FuncCall|MethodCa
133134
return null;
134135
}
135136

137+
// dynamic name? skip
138+
if ($callLike->name instanceof Expr) {
139+
return null;
140+
}
141+
136142
return $callLike;
137143
}
138144

0 commit comments

Comments
 (0)