26 $trace = $e->getTrace();
27 foreach ($trace as $frame) {
28 if (isset($frame[
'file'])) {
29 $data[] = $frame[
'file'].
':'.$frame[
'line'];
31 $data[] = json_encode($frame);
40 if (version_compare(PHP_VERSION,
'5.4.0',
'>=')) {
41 return json_encode(
$data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
44 return json_encode(
$data);
49 $exception = new \Exception(
'foo');
50 $formatted = $this->formatter->format(
array(
54 'bam' =>
array(1, 2, 3),
55 'bat' =>
array(
'foo' =>
'bar'),
56 'bap' => \DateTime::createFromFormat(\DateTime::ISO8601,
'1970-01-01T00:00:00+0000'),
60 $this->assertSame(
array(
66 'bap' =>
'1970-01-01 00:00:00',
68 'class' => get_class($exception),
69 'message' => $exception->getMessage(),
70 'code' => $exception->getCode(),
71 'file' => $exception->getFile() .
':' . $exception->getLine(),
79 $context =
array(
'file' =>
'foo',
'line' => 1);
80 $formatted = $this->formatter->format(
array(
81 'context' => $context,
84 $this->assertSame(
array(
91 $exception = new \Exception(
'foo');
92 $formatted = $this->formatter->format(
array(
94 'exception' => $exception,
98 $this->assertSame(
array(
100 'exception' =>
array(
101 'class' => get_class($exception),
102 'message' => $exception->getMessage(),
103 'code' => $exception->getCode(),
104 'file' => $exception->getFile() .
':' . $exception->getLine(),
Create styles array
The data for the language used.