mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Fix #733 - DomNodeList implements ArrayAccess
This commit is contained in:
parent
b9b2a909a1
commit
071558ec83
@ -454,6 +454,10 @@ class ClassLikes
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($interface_id === 'arrayaccess' && $fq_class_name === 'domnodelist') {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isset(ClassLikeChecker::$SPECIAL_TYPES[$interface_id])
|
||||
|| isset(ClassLikeChecker::$SPECIAL_TYPES[$fq_class_name])
|
||||
) {
|
||||
|
@ -135,6 +135,12 @@ class ArrayAccessTest extends TestCase
|
||||
$x[] = 5;
|
||||
takesInt($x[0]);',
|
||||
],
|
||||
'domNodeListAccessible' => [
|
||||
'<?php
|
||||
$doc = new DOMDocument();
|
||||
$doc->loadXML("<node key=\"value\"/>");
|
||||
$doc->getElementsByTagName("node")[0];'
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user