1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Prevent iterating over undefined class

This commit is contained in:
Matthew Brown 2018-03-03 16:52:04 -05:00
parent 6458aa2e91
commit ecef628e21

View File

@ -185,6 +185,10 @@ class ForeachChecker
continue;
}
if (!$codebase->classlikes->classOrInterfaceExists($iterator_type->value)) {
continue;
}
if ($codebase->classImplements(
$iterator_type->value,
'Iterator'