function ExceptionCaster::castThrowingCasterException
File
-
vendor/
symfony/ var-dumper/ Caster/ ExceptionCaster.php, line 69
Class
- ExceptionCaster
- Casts common Exception classes to array representation.
Namespace
Symfony\Component\VarDumper\CasterCode
public static function castThrowingCasterException(ThrowingCasterException $e, array $a, Stub $stub, bool $isNested) : array {
$trace = Caster::PREFIX_VIRTUAL . 'trace';
$prefix = Caster::PREFIX_PROTECTED;
$xPrefix = "\x00Exception\x00";
if (isset($a[$xPrefix . 'previous'], $a[$trace]) && $a[$xPrefix . 'previous'] instanceof \Exception) {
$b = (array) $a[$xPrefix . 'previous'];
$class = get_debug_type($a[$xPrefix . 'previous']);
self::traceUnshift($b[$xPrefix . 'trace'], $class, $b[$prefix . 'file'], $b[$prefix . 'line']);
$a[$trace] = new TraceStub($b[$xPrefix . 'trace'], false, 0, -\count($a[$trace]->value));
}
unset($a[$xPrefix . 'previous'], $a[$prefix . 'code'], $a[$prefix . 'file'], $a[$prefix . 'line']);
return $a;
}