diff --git a/src/Tracy/Dumper/Dumper.php b/src/Tracy/Dumper/Dumper.php index 49ca5ca23..4598a4f7f 100644 --- a/src/Tracy/Dumper/Dumper.php +++ b/src/Tracy/Dumper/Dumper.php @@ -9,6 +9,7 @@ namespace Tracy; +use Dom; use Ds; use Tracy\Dumper\Describer; use Tracy\Dumper\Exposer; @@ -81,6 +82,11 @@ class Dumper \DOMNode::class => [Exposer::class, 'exposeDOMNode'], \DOMNodeList::class => [Exposer::class, 'exposeDOMNodeList'], \DOMNamedNodeMap::class => [Exposer::class, 'exposeDOMNodeList'], + Dom\Node::class => [Exposer::class, 'exposeDOMNode'], + Dom\NodeList::class => [Exposer::class, 'exposeDOMNodeList'], + Dom\NamedNodeMap::class => [Exposer::class, 'exposeDOMNodeList'], + Dom\TokenList::class => [Exposer::class, 'exposeDOMNodeList'], + Dom\HTMLCollection::class => [Exposer::class, 'exposeDOMNodeList'], Ds\Collection::class => [Exposer::class, 'exposeDsCollection'], Ds\Map::class => [Exposer::class, 'exposeDsMap'], \WeakMap::class => [Exposer::class, 'exposeWeakMap'], diff --git a/src/Tracy/Dumper/Exposer.php b/src/Tracy/Dumper/Exposer.php index aaa87bb0b..eb14a504a 100644 --- a/src/Tracy/Dumper/Exposer.php +++ b/src/Tracy/Dumper/Exposer.php @@ -8,6 +8,7 @@ declare(strict_types=1); namespace Tracy\Dumper; +use Dom; use Ds; @@ -141,7 +142,7 @@ public static function exposeArrayObject(\ArrayObject $obj, Value $value, Descri } - public static function exposeDOMNode(\DOMNode $obj, Value $value, Describer $describer): void + public static function exposeDOMNode(\DOMNode|Dom\Node $obj, Value $value, Describer $describer): void { $props = preg_match_all('#^\s*\[([^\]]+)\] =>#m', print_r($obj, return: true), $tmp) ? $tmp[1] : []; sort($props); @@ -152,7 +153,7 @@ public static function exposeDOMNode(\DOMNode $obj, Value $value, Describer $des public static function exposeDOMNodeList( - \DOMNodeList|\DOMNamedNodeMap $obj, + \DOMNodeList|\DOMNamedNodeMap|Dom\NodeList|Dom\NamedNodeMap|Dom\TokenList|Dom\HTMLCollection $obj, Value $value, Describer $describer, ): void diff --git a/tests/Tracy/Dumper.toText().specials.dom.php84.phpt b/tests/Tracy/Dumper.toText().specials.dom.php84.phpt new file mode 100644 index 000000000..2df18400d --- /dev/null +++ b/tests/Tracy/Dumper.toText().specials.dom.php84.phpt @@ -0,0 +1,110 @@ +