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

Breadcrumb

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

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

Code

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

API Navigation

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