| Conditions | 2 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | 3 | protected function format(Throwable $exception) : string |
|
| 12 | { |
||
| 13 | $errorInfo = [ |
||
| 14 | 3 | 'type' => get_class($exception), |
|
| 15 | 3 | 'message' => $exception->getMessage(), |
|
| 16 | 3 | 'file' => $exception->getFile(), |
|
| 17 | 3 | 'line' => $exception->getLine(), |
|
| 18 | 3 | 'trace' => $exception->getTrace(), |
|
| 19 | ]; |
||
| 20 | |||
| 21 | 3 | return json_encode([ |
|
| 22 | 3 | 'error' => $errorInfo, |
|
| 23 | 3 | ], defined('JSON_PARTIAL_OUTPUT_ON_ERROR') ? JSON_PARTIAL_OUTPUT_ON_ERROR : 0); |
|
| 24 | } |
||
| 25 | |||
| 31 |