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