Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ExceptionCaster.php

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\Caster

Code

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal