@@ -47,12 +47,12 @@ discard block |
||
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
50 | - * handler for errors |
|
51 | - * use set_error_handler([$instance, 'errorHandler']); |
|
52 | - * |
|
53 | - * https://www.php.net/manual/en/function.set-error-handler |
|
54 | - * |
|
55 | - */ |
|
50 | + * handler for errors |
|
51 | + * use set_error_handler([$instance, 'errorHandler']); |
|
52 | + * |
|
53 | + * https://www.php.net/manual/en/function.set-error-handler |
|
54 | + * |
|
55 | + */ |
|
56 | 56 | public function errorHandler(int $level, string $message, string $file = '', int $line = 0): bool |
57 | 57 | { |
58 | 58 | $loglevel = self::mapErrorLevelToLogLevel($level); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | return self::$level_mapping[$level]; |
110 | 110 | } |
111 | 111 | |
112 | - /** Error level meaning , from \Psr\Log\LogLevel.php |
|
112 | + /** Error level meaning , from \Psr\Log\LogLevel.php |
|
113 | 113 | * Error level mapping from \Psr\Log\LogLevel.php & http://php.net/manual/en/errorfunc.constants.php |
114 | 114 | * |
115 | 115 | * const EMERGENCY = 'emergency'; |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | } |
83 | 83 | } elseif (in_array($level, [LogLevel::ERROR, LogLevel::CRITICAL, LogLevel::ALERT, LogLevel::EMERGENCY])) { |
84 | 84 | if (isset($context['exception']) && $context['exception'] instanceof \Throwable) { |
85 | - Debugger::visualDump($context['exception'], 'Uncaught ' . get_class($context['exception']), true); |
|
85 | + Debugger::visualDump($context['exception'], 'Uncaught '.get_class($context['exception']), true); |
|
86 | 86 | } else { |
87 | 87 | Debugger::visualDump($message, $level, true); |
88 | 88 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | http_response_code(500); |
91 | 91 | die; |
92 | 92 | } else { |
93 | - throw new \Psr\Log\InvalidArgumentException('UNDEFINED_LOGLEVEL_' . $level); |
|
93 | + throw new \Psr\Log\InvalidArgumentException('UNDEFINED_LOGLEVEL_'.$level); |
|
94 | 94 | } |
95 | 95 | } |
96 | 96 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | } |
104 | 104 | |
105 | 105 | if (!isset(self::$level_mapping[$level])) { |
106 | - throw new \Exception(__FUNCTION__ . "($level): $level is unknown"); |
|
106 | + throw new \Exception(__FUNCTION__."($level): $level is unknown"); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | return self::$level_mapping[$level]; |
@@ -142,10 +142,10 @@ discard block |
||
142 | 142 | ); |
143 | 143 | |
144 | 144 | $debug = array_fill_keys( |
145 | - [E_NOTICE, E_USER_NOTICE, E_STRICT,E_DEPRECATED,E_USER_DEPRECATED,E_ALL], |
|
145 | + [E_NOTICE, E_USER_NOTICE, E_STRICT, E_DEPRECATED, E_USER_DEPRECATED, E_ALL], |
|
146 | 146 | LogLevel::DEBUG |
147 | 147 | ); |
148 | 148 | |
149 | - self::$level_mapping = $critical + $error + $debug; |
|
149 | + self::$level_mapping = $critical+$error+$debug; |
|
150 | 150 | } |
151 | 151 | } |