Skip to content

Commit be38eed

Browse files
committed
Do not throw an error if an expr has already been analysed
1 parent 7c49de5 commit be38eed

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

src/Analyser/NodeScopeResolver.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2545,13 +2545,6 @@ public function processExprNode(
25452545
ExpressionContext $context,
25462546
): ExpressionResult
25472547
{
2548-
$existingBeforeScope = $storage->findBeforeScope($expr);
2549-
if ($existingBeforeScope !== null) {
2550-
if (!$nodeCallback instanceof ShallowNodeCallback) {
2551-
throw new ShouldNotHappenException(sprintf('Expr %s on line %d has already been analysed', get_class($expr), $expr->getStartLine()));
2552-
}
2553-
}
2554-
25552548
if ($expr instanceof Expr\CallLike && $expr->isFirstClassCallable()) {
25562549
if ($expr instanceof FuncCall) {
25572550
$newExpr = new FunctionCallableNode($expr->name, $expr);

0 commit comments

Comments
 (0)