| Conditions | 3 |
| Paths | 4 |
| Total Lines | 27 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 11 | function exit__($status = null) |
||
| 12 | { |
||
| 13 | $trace = debug_backtrace(); |
||
| 14 | $file = $trace[0]['file']; |
||
| 15 | $line = $trace[0]['line']; |
||
| 16 | $class = isset($trace[1]['class']) ? $trace[1]['class'] : null; |
||
| 17 | $method = $trace[1]['function']; |
||
| 18 | |||
| 19 | if ($class === null) |
||
| 20 | { |
||
| 21 | $message = 'exit() called in ' . $method . '() function'; |
||
| 22 | } |
||
| 23 | else |
||
| 24 | { |
||
| 25 | $message = 'exit() called in ' . $class . '::' . $method . '()'; |
||
| 26 | } |
||
| 27 | |||
| 28 | $exception_name = Kenjis\MonkeyPatch\MonkeyPatchManager::getExitExceptionClassname(); |
||
| 29 | $exception = new $exception_name($message); |
||
| 30 | $exception->file = $file; |
||
| 31 | $exception->line = $line; |
||
| 32 | $exception->class = $class; |
||
| 33 | $exception->method = $method; |
||
| 34 | $exception->exit_status = $status; |
||
| 35 | |||
| 36 | throw $exception; |
||
| 37 | } |
||
| 38 |