| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3.0067 |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | 3 | public function logException(Exception $ex) |
|
| 31 | { |
||
| 32 | 3 | $level = LogLevel::ALERT; |
|
| 33 | |||
| 34 | 3 | if ($ex instanceof ErrorException) { |
|
|
|
|||
| 35 | 1 | $level = LogLevel::ERROR; |
|
| 36 | } elseif ($ex instanceof RuntimeException) { |
||
| 37 | 1 | $level = LogLevel::EMERGENCY; |
|
| 38 | } |
||
| 39 | |||
| 40 | 3 | $this->logImpl($level, "({code}): {message}\n{stackTrace}", array( |
|
| 41 | 3 | 'code' => $ex->getCode(), |
|
| 42 | 3 | 'message' => $ex->getMessage(), |
|
| 43 | 3 | 'stackTrace' => $ex->getTraceAsString() |
|
| 44 | )); |
||
| 45 | 3 | } |
|
| 46 | } |
||
| 47 |