mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
Prevent iterating over undefined class
This commit is contained in:
parent
6458aa2e91
commit
ecef628e21
@ -185,6 +185,10 @@ class ForeachChecker
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!$codebase->classlikes->classOrInterfaceExists($iterator_type->value)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($codebase->classImplements(
|
||||
$iterator_type->value,
|
||||
'Iterator'
|
||||
|
Loading…
x
Reference in New Issue
Block a user