Skip to content

Commit

Permalink
Update NodeScopeResolver.php
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Mar 6, 2022
1 parent c52547a commit 1345f32
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Analyser/NodeScopeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
use PHPStan\Type\UnionType;
use PHPStan\Type\VoidType;
use Throwable;
use Traversable;
use function array_fill_keys;
use function array_filter;
use function array_key_exists;
Expand Down Expand Up @@ -823,7 +824,7 @@ private function processStmtNode(
if (!$isIterableAtLeastOnce->no()) {
$throwPoints = array_merge($throwPoints, $finalScopeResult->getThrowPoints());
}
if (!(new ObjectType(ArrayAccess::class))->isSuperTypeOf($scope->getType($stmt->expr))->no()) {
if (!(new ObjectType(Traversable::class))->isSuperTypeOf($scope->getType($stmt->expr))->no()) {
$throwPoints[] = ThrowPoint::createImplicit($scope, $stmt->expr);
}

Expand Down

0 comments on commit 1345f32

Please sign in to comment.