File
- drupal/core/vendor/symfony/debug/Symfony/Component/Debug/Exception/FlattenException.php, line 173
Class
- FlattenException
- FlattenException wraps a PHP Exception to be able to serialize it.
Namespace
Symfony\Component\Debug\Exception
Code
public function setTraceFromException(\Exception $exception) {
$trace = $exception
->getTrace();
if ($exception instanceof FatalErrorException) {
if (function_exists('xdebug_get_function_stack')) {
$trace = array_slice(array_reverse(xdebug_get_function_stack()), 4);
foreach ($trace as $i => $frame) {
if (!isset($frame['type'])) {
$trace[$i]['type'] = '??';
}
if ('dynamic' === $trace[$i]['type']) {
$trace[$i]['type'] = '->';
}
elseif ('static' === $trace[$i]['type']) {
$trace[$i]['type'] = '::';
}
if (isset($frame['params']) && !isset($frame['args'])) {
$trace[$i]['args'] = $frame['params'];
unset($trace[$i]['params']);
}
}
}
else {
$trace = array_slice(array_reverse($trace), 1);
}
}
$this
->setTrace($trace, $exception
->getFile(), $exception
->getLine());
}