Skip to content

Commit 09fcd20

Browse files
committed
FNSR
1 parent b78be9b commit 09fcd20

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Analyser/Fiber/FiberNodeScopeResolver.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
use PHPStan\Analyser\NoopNodeCallback;
1414
use PHPStan\DependencyInjection\AutowiredService;
1515
use PHPStan\ShouldNotHappenException;
16+
use function get_class;
1617
use function get_debug_type;
18+
use function sprintf;
1719

1820
#[AutowiredService(as: FiberNodeScopeResolver::class)]
1921
final class FiberNodeScopeResolver extends NodeScopeResolver
@@ -84,6 +86,9 @@ protected function processPendingFibers(ExpressionResultStorage $storage): void
8486
new NoopNodeCallback(),
8587
ExpressionContext::createTopLevel(),
8688
);
89+
if ($storage->findResult($request->expr) === null) {
90+
throw new ShouldNotHappenException(sprintf('processExprNode should have stored the result of %s on line %s', get_class($request->expr), $request->expr->getStartLine()));
91+
}
8792
$this->processPendingFibers($storage);
8893

8994
// Break and restart the loop since the array may have been modified

0 commit comments

Comments
 (0)