Skip to content

Commit 8191828

Browse files
committed
Guards against first class callables
1 parent 20539fc commit 8191828

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/Analyser/ExprHandler/FuncCallHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function __construct(
8686

8787
public function supports(Expr $expr): bool
8888
{
89-
return $expr instanceof FuncCall;
89+
return $expr instanceof FuncCall && !$expr->isFirstClassCallable();
9090
}
9191

9292
public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Expr $expr, MutatingScope $scope, ExpressionResultStorage $storage, callable $nodeCallback, ExpressionContext $context): ExpressionResult

src/Analyser/ExprHandler/MethodCallHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function __construct(
5959

6060
public function supports(Expr $expr): bool
6161
{
62-
return $expr instanceof MethodCall;
62+
return $expr instanceof MethodCall && !$expr->isFirstClassCallable();
6363
}
6464

6565
public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Expr $expr, MutatingScope $scope, ExpressionResultStorage $storage, callable $nodeCallback, ExpressionContext $context): ExpressionResult

src/Analyser/ExprHandler/NewHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function __construct(
5454

5555
public function supports(Expr $expr): bool
5656
{
57-
return $expr instanceof New_;
57+
return $expr instanceof New_ && !$expr->isFirstClassCallable();
5858
}
5959

6060
public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Expr $expr, MutatingScope $scope, ExpressionResultStorage $storage, callable $nodeCallback, ExpressionContext $context): ExpressionResult

src/Analyser/ExprHandler/StaticCallHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function __construct(
5656

5757
public function supports(Expr $expr): bool
5858
{
59-
return $expr instanceof StaticCall;
59+
return $expr instanceof StaticCall && !$expr->isFirstClassCallable();
6060
}
6161

6262
public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Expr $expr, MutatingScope $scope, ExpressionResultStorage $storage, callable $nodeCallback, ExpressionContext $context): ExpressionResult

0 commit comments

Comments
 (0)