@@ -16,14 +16,14 @@ final class ErrorHandler
1616 private $ logErrors ;
1717 private $ logVariables = true ;
1818 private $ emailCallback ;
19- private $ scream = array () ;
19+ private $ scream = [] ;
2020
21- private static $ colors = array (
21+ private static $ colors = [
2222 '<error> ' => "\033[37;41m " ,
2323 '</error> ' => "\033[0m " ,
24- ) ;
24+ ] ;
2525
26- private static $ errors = array (
26+ private static $ errors = [
2727 \E_COMPILE_ERROR => 'E_COMPILE_ERROR ' ,
2828 \E_COMPILE_WARNING => 'E_COMPILE_WARNING ' ,
2929 \E_CORE_ERROR => 'E_CORE_ERROR ' ,
@@ -39,7 +39,7 @@ final class ErrorHandler
3939 \E_USER_NOTICE => 'E_USER_NOTICE ' ,
4040 \E_USER_WARNING => 'E_USER_WARNING ' ,
4141 \E_WARNING => 'E_WARNING ' ,
42- ) ;
42+ ] ;
4343
4444 public function __construct (callable $ emailCallback )
4545 {
@@ -145,8 +145,8 @@ public function getScreamSilencedErrors(): array
145145
146146 public function register (): void
147147 {
148- \set_error_handler (array ( $ this , 'errorHandler ' ) , \error_reporting ());
149- \set_exception_handler (array ( $ this , 'exceptionHandler ' ) );
148+ \set_error_handler ([ $ this , 'errorHandler ' ] , \error_reporting ());
149+ \set_exception_handler ([ $ this , 'exceptionHandler ' ] );
150150 }
151151
152152 public function errorHandler ($ errno , $ errstr = '' , $ errfile = '' , $ errline = 0 ): void
@@ -168,13 +168,13 @@ public function exceptionHandler(\Throwable $exception): void
168168 $ currentEx = $ exception ;
169169 do {
170170 $ width = $ this ->getTerminalWidth () ? $ this ->getTerminalWidth () - 3 : 120 ;
171- $ lines = array (
171+ $ lines = [
172172 'Message: ' . $ currentEx ->getMessage (),
173173 '' ,
174174 'Class: ' . \get_class ($ currentEx ),
175175 'Code: ' . $ this ->getExceptionCode ($ currentEx ),
176176 'File: ' . $ currentEx ->getFile () . ': ' . $ currentEx ->getLine (),
177- ) ;
177+ ] ;
178178 $ lines = \array_merge ($ lines , \explode (\PHP_EOL , $ this ->purgeTrace ($ currentEx ->getTraceAsString ())));
179179
180180 $ i = 0 ;
@@ -286,18 +286,18 @@ public function emailException(\Throwable $exception): void
286286 return ;
287287 }
288288
289- $ bodyArray = array (
289+ $ bodyArray = [
290290 'Data ' => \date (\DATE_RFC850 ),
291291 'REQUEST_URI ' => $ _SERVER ['REQUEST_URI ' ] ?? '' ,
292292 'HTTP_REFERER ' => $ _SERVER ['HTTP_REFERER ' ] ?? '' ,
293293 'USER_AGENT ' => $ _SERVER ['HTTP_USER_AGENT ' ] ?? '' ,
294294 'REMOTE_ADDR ' => $ _SERVER ['REMOTE_ADDR ' ] ?? '' ,
295- ) ;
295+ ] ;
296296 if ($ this ->isCli ()) {
297- $ bodyArray = array (
297+ $ bodyArray = [
298298 'Data ' => \date (\DATE_RFC850 ),
299299 'Comando ' => \sprintf ('$ php %s ' , \implode (' ' , $ _SERVER ['argv ' ])),
300- ) ;
300+ ] ;
301301 }
302302
303303 $ bodyText = '' ;
@@ -307,12 +307,12 @@ public function emailException(\Throwable $exception): void
307307
308308 $ currentEx = $ exception ;
309309 do {
310- $ bodyArray = array (
310+ $ bodyArray = [
311311 'Class ' => \get_class ($ currentEx ),
312312 'Code ' => $ this ->getExceptionCode ($ currentEx ),
313313 'Message ' => $ currentEx ->getMessage (),
314314 'File ' => $ currentEx ->getFile () . ': ' . $ currentEx ->getLine (),
315- ) ;
315+ ] ;
316316
317317 foreach ($ bodyArray as $ key => $ val ) {
318318 $ bodyText .= \sprintf ('%-15s%s%s ' , $ key , $ val , \PHP_EOL );
0 commit comments