function ExceptionCaster::castSilencedErrorContext
File
-
vendor/
symfony/ var-dumper/ Caster/ ExceptionCaster.php, line 87
Class
- ExceptionCaster
- Casts common Exception classes to array representation.
Namespace
Symfony\Component\VarDumper\CasterCode
public static function castSilencedErrorContext(SilencedErrorContext $e, array $a, Stub $stub, bool $isNested) : array {
$sPrefix = "\x00" . SilencedErrorContext::class . "\x00";
if (!isset($a[$s = $sPrefix . 'severity'])) {
return $a;
}
if (isset(self::$errorTypes[$a[$s]])) {
$a[$s] = new ConstStub(self::$errorTypes[$a[$s]], $a[$s]);
}
$trace = [
[
'file' => $a[$sPrefix . 'file'],
'line' => $a[$sPrefix . 'line'],
],
];
if (isset($a[$sPrefix . 'trace'])) {
$trace = array_merge($trace, $a[$sPrefix . 'trace']);
}
unset($a[$sPrefix . 'file'], $a[$sPrefix . 'line'], $a[$sPrefix . 'trace']);
$a[Caster::PREFIX_VIRTUAL . 'trace'] = new TraceStub($trace, self::$traceArgs);
return $a;
}