From 72d549de737315b9a6aad5213fa5f2ccf9c9b341 Mon Sep 17 00:00:00 2001 From: ArrayIterator <37867551+ArrayIterator@users.noreply.github.com> Date: Thu, 18 Jul 2024 23:44:16 +0700 Subject: [PATCH] Update Consolidation.php --- src/Util/Filter/Consolidation.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/Util/Filter/Consolidation.php b/src/Util/Filter/Consolidation.php index 83afc65..04d6244 100644 --- a/src/Util/Filter/Consolidation.php +++ b/src/Util/Filter/Consolidation.php @@ -1157,9 +1157,23 @@ public static function debugInfo( bool $detectParent = true, ): array { $regexP = $regexP && DataType::isValidRegExP($regexP) ? $regexP : null; - $reflectionObject = new ReflectionObject($object); + $current = new ReflectionObject($object); + + $properties = []; + foreach ($current->getProperties() as $property) { + $properties[$property->getName()] = $property; + } + + while ($current = $current->getParentClass()) { + foreach ($current->getProperties() as $property) { + if (!isset($properties[$property->getName()])) { + $properties = [$property->getName() => $property] + $properties; + } + } + } + $info = []; - foreach ($reflectionObject->getProperties() as $property) { + foreach ($properties as $property) { // no display if not initialized if ($property->isStatic() || !$property->isInitialized($object) @@ -1185,6 +1199,7 @@ public static function debugInfo( : $key ); } + $info[$keyItem] = $value; if ($detectParent && in_array($key, $excludeKeys)) { continue;