X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fdoctrine%2Fcommon%2Flib%2FDoctrine%2FCommon%2FUtil%2FDebug.php;fp=vendor%2Fdoctrine%2Fcommon%2Flib%2FDoctrine%2FCommon%2FUtil%2FDebug.php;h=065c1e6d03359b1faabd15bf6f45c99486871c71;hp=ae115edd7a2f9901be6933b4b84594d5459026ad;hb=5e458ff8cb4924fd5fa03b80d8edfcc52fe43479;hpb=9917807b03b64faf00f6a1f29dcb6eafc454efa5 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php b/vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php index ae115edd7..065c1e6d0 100644 --- a/vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php +++ b/vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php @@ -144,41 +144,26 @@ final class Debug /** * Fill the $return variable with class attributes + * Based on obj2array function from {@see http://php.net/manual/en/function.get-object-vars.php#47075} * * @param object $var - * @param stdClass $return + * @param \stdClass $return * @param int $maxDepth * * @return mixed */ private static function fillReturnWithClassAttributes($var, \stdClass $return, $maxDepth) { - $reflClass = ClassUtils::newReflectionObject($var); - $parsedAttributes = array(); - do { - $currentClassName = $reflClass->getName(); - - foreach ($reflClass->getProperties() as $reflProperty) { - $attributeKey = $reflProperty->isPrivate() ? $currentClassName . '#' : ''; - $attributeKey .= $reflProperty->getName(); - - if (isset($parsedAttributes[$attributeKey])) { - continue; - } - - $parsedAttributes[$attributeKey] = true; - - $name = - $reflProperty->getName() - . ($return->__CLASS__ !== $currentClassName || $reflProperty->isPrivate() ? ':' . $currentClassName : '') - . ($reflProperty->isPrivate() ? ':private' : '') - . ($reflProperty->isProtected() ? ':protected' : '') - ; - - $reflProperty->setAccessible(true); - $return->$name = self::export($reflProperty->getValue($var), $maxDepth - 1); + $clone = (array) $var; + + foreach (array_keys($clone) as $key) { + $aux = explode("\0", $key); + $name = end($aux); + if ($aux[0] === '') { + $name.= ':' . ($aux[1] === '*' ? 'protected' : $aux[1].':private'); } - } while ($reflClass = $reflClass->getParentClass()); + $return->$name = self::export($clone[$key], $maxDepth - 1);; + } return $return; }