Conditions | 5 |
Paths | 5 |
Total Lines | 26 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
14 | 2 | public function formatTrace(ErrorInfo $error): array |
|
15 | { |
||
16 | 2 | $traces = []; |
|
17 | |||
18 | 2 | foreach ($error->getTrace() as $trace) |
|
19 | { |
||
20 | 2 | if (! isset($trace['file'])) |
|
21 | { |
||
22 | 1 | continue; |
|
23 | } |
||
24 | |||
25 | 2 | if (! isset($trace['line'])) |
|
26 | { |
||
27 | 1 | continue; |
|
28 | } |
||
29 | |||
30 | 1 | $traces[] = [ |
|
31 | 1 | 'file' => $trace['file'], |
|
32 | 1 | 'line' => $trace['line'], |
|
33 | 1 | 'func' => (isset($trace['class']) ? $trace['class'] . '::' : '') . $trace['function'], |
|
34 | 1 | 'code' => $this->getFileContent($trace['file'], $trace['line']), |
|
35 | ]; |
||
36 | } |
||
37 | |||
38 | 2 | return $traces; |
|
39 | } |
||
40 | |||
61 | } |