| Conditions | 3 |
| Paths | 3 |
| Total Lines | 22 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 50 | public static function exception_handler($exception, $template = null) |
||
| 51 | { |
||
| 52 | global $oi_import; |
||
| 53 | |||
| 54 | // Keeping secrets |
||
| 55 | if (error_reporting() === 0) |
||
| 56 | { |
||
| 57 | return; |
||
| 58 | } |
||
| 59 | |||
| 60 | // Tell just your friends |
||
| 61 | if ($template === null) |
||
| 62 | { |
||
| 63 | $template = $oi_import->template ?? new Template(null); |
||
| 64 | } |
||
| 65 | |||
| 66 | $message = $exception->getMessage(); |
||
| 67 | $trace = $exception->getTrace(); |
||
| 68 | $line = $exception->getLine(); |
||
| 69 | $file = $exception->getFile(); |
||
| 70 | |||
| 71 | $template->error($message, $trace[0]['args'][1] ?? null, $line, $file); |
||
| 72 | } |
||
| 74 |