@@ -24,8 +24,9 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | public static function instance() |
| 26 | 26 | { |
| 27 | - if(!isset(self::$instance)) |
|
| 28 | - self::$instance = new Debugger(); |
|
| 27 | + if(!isset(self::$instance)) {
|
|
| 28 | + self::$instance = new Debugger(); |
|
| 29 | + } |
|
| 29 | 30 | return self::$instance; |
| 30 | 31 | } |
| 31 | 32 | |
@@ -52,12 +53,15 @@ discard block |
||
| 52 | 53 | |
| 53 | 54 | public static function internal_error($code, $string, $file = null, $line = null, $context = null) |
| 54 | 55 | { |
| 55 | - if($file == null) |
|
| 56 | - $file = self::$UNKNOWN_ERROR_FILE; |
|
| 57 | - if($line == null) |
|
| 58 | - $line = self::$UNKNOWN_ERROR_LINE; |
|
| 59 | - if($context == null) |
|
| 60 | - $context = self::$UNKNOWN_ERROR_CONTEXT; |
|
| 56 | + if($file == null) {
|
|
| 57 | + $file = self::$UNKNOWN_ERROR_FILE; |
|
| 58 | + } |
|
| 59 | + if($line == null) {
|
|
| 60 | + $line = self::$UNKNOWN_ERROR_LINE; |
|
| 61 | + } |
|
| 62 | + if($context == null) {
|
|
| 63 | + $context = self::$UNKNOWN_ERROR_CONTEXT; |
|
| 64 | + } |
|
| 61 | 65 | |
| 62 | 66 | self::instance()->console->logError(new Exception($string), "{$string}... TYPE: {$code}"); |
| 63 | 67 | |
@@ -68,8 +72,9 @@ discard block |
||
| 68 | 72 | { |
| 69 | 73 | $error = error_get_last(); |
| 70 | 74 | |
| 71 | - if(isset($error)) |
|
| 72 | - self::internal_error($error['type'], $error['message'], $error['file'], $error['line']); |
|
| 75 | + if(isset($error)) {
|
|
| 76 | + self::internal_error($error['type'], $error['message'], $error['file'], $error['line']); |
|
| 77 | + } |
|
| 73 | 78 | |
| 74 | 79 | self::display(); |
| 75 | 80 | return true; |