Skip to content

Commit

Permalink
Fixes native class dumping [Closes #558]
Browse files Browse the repository at this point in the history
Reverts "Dumper: added ArrayIterator exposer" commit bdec6ae.
  • Loading branch information
dg committed Mar 28, 2023
1 parent e580b95 commit 9f3bdbc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
1 change: 0 additions & 1 deletion src/Tracy/Dumper/Dumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ class Dumper
\Closure::class => [Exposer::class, 'exposeClosure'],
\UnitEnum::class => [Exposer::class, 'exposeEnum'],
\ArrayObject::class => [Exposer::class, 'exposeArrayObject'],
\ArrayIterator::class => [Exposer::class, 'exposeArrayIterator'],
\SplFileInfo::class => [Exposer::class, 'exposeSplFileInfo'],
\SplObjectStorage::class => [Exposer::class, 'exposeSplObjectStorage'],
\__PHP_Incomplete_Class::class => [Exposer::class, 'exposePhpIncompleteClass'],
Expand Down
8 changes: 1 addition & 7 deletions src/Tracy/Dumper/Exposer.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class Exposer
{
public static function exposeObject(object $obj, Value $value, Describer $describer): void
{
$values = get_mangled_object_vars($obj);
$values = (array) $obj;
$props = self::getProperties($obj::class);

foreach (array_diff_key($values, $props) as $k => $v) {
Expand Down Expand Up @@ -136,12 +136,6 @@ public static function exposeArrayObject(\ArrayObject $obj, Value $value, Descri
}


public static function exposeArrayIterator(\ArrayIterator $obj, Value $value, Describer $describer): void
{
self::exposeObject((object) $obj->getArrayCopy(), $value, $describer);
}


public static function exposeDOMNode(\DOMNode $obj, Value $value, Describer $describer): void
{
$props = preg_match_all('#^\s*\[([^\]]+)\] =>#m', print_r($obj, true), $tmp) ? $tmp[1] : [];
Expand Down

0 comments on commit 9f3bdbc

Please sign in to comment.