Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | 2 | public function render(mixed $data, mixed ...$args): string |
|
18 | { |
||
19 | 2 | assert($data instanceof Error); |
|
20 | |||
21 | 2 | $text = "Error: {$data->error}"; |
|
22 | |||
23 | 2 | if ($data->debug) { |
|
24 | 1 | $text .= "\n\nDescription: {$data->description}\n\n"; |
|
25 | 1 | $text .= "-------------------------------------------------------\n\n"; |
|
26 | 1 | $text .= "Traceback:\n\n"; |
|
27 | 1 | $text .= $data->traceback; |
|
28 | } |
||
29 | |||
30 | 2 | return $text; |
|
31 | } |
||
38 |