@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <? |
| 2 | 2 | |
| 3 | -use Particletree\Pqp\Console; |
|
| 3 | +use Particletree\Pqp\Console; |
|
| 4 | 4 | use Particletree\Pqp\PhpQuickProfiler; |
| 5 | 5 | |
| 6 | 6 | final class Debugger |
@@ -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; |