From efd67a132ed432b47a74c8b98211597557c419d5 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 13 Jul 2020 11:44:21 +0100 Subject: [PATCH] MemoryDump: fixed duplicated properties, reduce useless noise --- src/MemoryManager.php | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/MemoryManager.php b/src/MemoryManager.php index d0ccf4010..df1feac92 100644 --- a/src/MemoryManager.php +++ b/src/MemoryManager.php @@ -406,22 +406,16 @@ class MemoryManager{ "properties" => [] ]; - for($original = $reflection; $reflection !== false; $reflection = $reflection->getParentClass()){ - foreach($reflection->getProperties() as $property){ - if($property->isStatic()){ - continue; - } - - $name = $property->getName(); - if($reflection !== $original and !$property->isPublic()){ - $name = $reflection->getName() . ":" . $name; - } - if(!$property->isPublic()){ - $property->setAccessible(true); - } - - $info["properties"][$name] = self::continueDump($property->getValue($object), $objects, $refCounts, 0, $maxNesting, $maxStringSize); + foreach($reflection->getProperties() as $property){ + if($property->isStatic()){ + continue; } + + if(!$property->isPublic()){ + $property->setAccessible(true); + } + + $info["properties"][$property->getName()] = self::continueDump($property->getValue($object), $objects, $refCounts, 0, $maxNesting, $maxStringSize); } fwrite($obData, json_encode($info, JSON_UNESCAPED_SLASHES) . "\n");