Better exception handling to dump()
This commit is contained in:
parent
7ca6602c08
commit
d94ba96ae3
|
|
@ -113,9 +113,12 @@ class DebugExtension extends Twig_Extension
|
||||||
elseif (is_array($var)) {
|
elseif (is_array($var)) {
|
||||||
$caption = static::ARRAY_CAPTION;
|
$caption = static::ARRAY_CAPTION;
|
||||||
}
|
}
|
||||||
else {
|
elseif (is_object($var)) {
|
||||||
$caption = [static::OBJECT_CAPTION, get_class($var)];
|
$caption = [static::OBJECT_CAPTION, get_class($var)];
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
$caption = [static::OBJECT_CAPTION, gettype($var)];
|
||||||
|
}
|
||||||
|
|
||||||
$result .= $this->dump($var, $caption);
|
$result .= $this->dump($var, $caption);
|
||||||
}
|
}
|
||||||
|
|
@ -443,6 +446,9 @@ class DebugExtension extends Twig_Extension
|
||||||
|
|
||||||
$vars = [];
|
$vars = [];
|
||||||
foreach ($info->getProperties() as $property) {
|
foreach ($info->getProperties() as $property) {
|
||||||
|
if ($property->isStatic()) {
|
||||||
|
continue; // Only non-static
|
||||||
|
}
|
||||||
if (!$property->isPublic()) {
|
if (!$property->isPublic()) {
|
||||||
continue; // Only public
|
continue; // Only public
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue