You are here

public function FlattenException::setTrace in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/debug/Exception/FlattenException.php \Symfony\Component\HttpKernel\Exception\FlattenException::setTrace()
1 call to FlattenException::setTrace()
FlattenException::setTraceFromException in vendor/symfony/debug/Exception/FlattenException.php

File

vendor/symfony/debug/Exception/FlattenException.php, line 219

Class

FlattenException
FlattenException wraps a PHP Exception to be able to serialize it.

Namespace

Symfony\Component\HttpKernel\Exception

Code

public function setTrace($trace, $file, $line) {
  $this->trace = array();
  $this->trace[] = array(
    'namespace' => '',
    'short_class' => '',
    'class' => '',
    'type' => '',
    'function' => '',
    'file' => $file,
    'line' => $line,
    'args' => array(),
  );
  foreach ($trace as $entry) {
    $class = '';
    $namespace = '';
    if (isset($entry['class'])) {
      $parts = explode('\\', $entry['class']);
      $class = array_pop($parts);
      $namespace = implode('\\', $parts);
    }
    $this->trace[] = array(
      'namespace' => $namespace,
      'short_class' => $class,
      'class' => isset($entry['class']) ? $entry['class'] : '',
      'type' => isset($entry['type']) ? $entry['type'] : '',
      'function' => isset($entry['function']) ? $entry['function'] : null,
      'file' => isset($entry['file']) ? $entry['file'] : null,
      'line' => isset($entry['line']) ? $entry['line'] : null,
      'args' => isset($entry['args']) ? $this
        ->flattenArgs($entry['args']) : array(),
    );
  }
}