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);
}
} while ($reflClass = $reflClass->getParentClass());
return $return;
}