mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
Fix element type inference for DOMNodeList
This commit is contained in:
parent
6d5c995458
commit
c83afc1af2
@ -742,10 +742,6 @@ class ForeachAnalyzer
|
||||
return;
|
||||
}
|
||||
|
||||
if ($generic_storage->stubbed && !$iterator_atomic_type instanceof Type\Atomic\TGenericObject) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($generic_storage->template_types
|
||||
|| $iterator_atomic_type instanceof Type\Atomic\TGenericObject
|
||||
) {
|
||||
|
@ -825,6 +825,12 @@ class ForeachTest extends \Psalm\Tests\TestCase
|
||||
|
||||
if ($a) {}',
|
||||
],
|
||||
'domNodeListIterator' => [
|
||||
'<?php
|
||||
function foo(DOMNodeList $list) : void {
|
||||
foreach ($list as $item) {}
|
||||
}'
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user