public function FlattenException::setTrace

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/FlattenException.php, line 171

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' => $entry['function'],
      'file' => isset($entry['file']) ? $entry['file'] : null,
      'line' => isset($entry['line']) ? $entry['line'] : null,
      'args' => isset($entry['args']) ? $this
        ->flattenArgs($entry['args']) : array(),
    );
  }
}