Skip to content

Commit

Permalink
Add support for internal classes that overload offset access
Browse files Browse the repository at this point in the history
  • Loading branch information
Girgias committed Dec 11, 2024
1 parent ad4f0c0 commit 1875d6c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Type/ObjectType.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,19 @@ class ObjectType implements TypeWithClassName, SubtractableType
use UndecidedComparisonTypeTrait;
use NonGeneralizableTypeTrait;

private const EXTRA_OFFSET_CLASSES = ['SimpleXMLElement', 'DOMNodeList', 'Threaded'];
private const EXTRA_OFFSET_CLASSES = [
'DOMNamedNodeMap', // Only read and existence
'Dom\NamedNodeMap', // Only read and existence
'DOMNodeList', // Only read and existence
'Dom\NodeList', // Only read and existence
'Dom\HTMLCollection', // Only read and existence
'Dom\DtdNamedNodeMap', // Only read and existence
'PDORow', // Only read and existence
'ResourceBundle', // Only read
'FFI\CData', // Very funky and weird
'SimpleXMLElement',
'Threaded',
];

private ?Type $subtractedType;

Expand Down

0 comments on commit 1875d6c

Please sign in to comment.