@@ -30,7 +30,7 @@ class ConsoleFormatter implements FormatterInterface
3030 const SIMPLE_FORMAT = "%datetime% %start_tag%%level_name%%end_tag% <comment>[%channel%]</> %message%%context%%extra% \n" ;
3131 const SIMPLE_DATE = 'H:i:s ' ;
3232
33- private static $ levelColorMap = array (
33+ private static $ levelColorMap = [
3434 Logger::DEBUG => 'fg=white ' ,
3535 Logger::INFO => 'fg=green ' ,
3636 Logger::NOTICE => 'fg=blue ' ,
@@ -39,7 +39,7 @@ class ConsoleFormatter implements FormatterInterface
3939 Logger::CRITICAL => 'fg=red ' ,
4040 Logger::ALERT => 'fg=red ' ,
4141 Logger::EMERGENCY => 'fg=white;bg=red ' ,
42- ) ;
42+ ] ;
4343
4444 private $ options ;
4545 private $ cloner ;
@@ -53,28 +53,28 @@ class ConsoleFormatter implements FormatterInterface
5353 * * colors: If true, the log string contains ANSI code to add color;
5454 * * multiline: If false, "context" and "extra" are dumped on one line.
5555 */
56- public function __construct (array $ options = array () )
56+ public function __construct (array $ options = [] )
5757 {
58- $ this ->options = array_replace (array (
58+ $ this ->options = array_replace ([
5959 'format ' => self ::SIMPLE_FORMAT ,
6060 'date_format ' => self ::SIMPLE_DATE ,
6161 'colors ' => true ,
6262 'multiline ' => false ,
6363 'level_name_format ' => '%-9s ' ,
6464 'ignore_empty_context_and_extra ' => true ,
65- ) , $ options );
65+ ] , $ options );
6666
6767 if (class_exists (VarCloner::class)) {
6868 $ this ->cloner = new VarCloner ();
69- $ this ->cloner ->addCasters (array (
70- '* ' => array ( $ this , 'castObject ' ) ,
71- ) );
69+ $ this ->cloner ->addCasters ([
70+ '* ' => [ $ this , 'castObject ' ] ,
71+ ] );
7272
7373 $ this ->outputBuffer = fopen ('php://memory ' , 'r+b ' );
7474 if ($ this ->options ['multiline ' ]) {
7575 $ output = $ this ->outputBuffer ;
7676 } else {
77- $ output = array ( $ this , 'echoLine ' ) ;
77+ $ output = [ $ this , 'echoLine ' ] ;
7878 }
7979
8080 $ this ->dumper = new CliDumper ($ output , null , CliDumper::DUMP_LIGHT_ARRAY | CliDumper::DUMP_COMMA_SEPARATOR );
@@ -114,7 +114,7 @@ public function format(array $record)
114114 $ extra = '' ;
115115 }
116116
117- $ formatted = strtr ($ this ->options ['format ' ], array (
117+ $ formatted = strtr ($ this ->options ['format ' ], [
118118 '%datetime% ' => $ record ['datetime ' ]->format ($ this ->options ['date_format ' ]),
119119 '%start_tag% ' => sprintf ('<%s> ' , $ levelColor ),
120120 '%level_name% ' => sprintf ($ this ->options ['level_name_format ' ], $ record ['level_name ' ]),
@@ -123,7 +123,7 @@ public function format(array $record)
123123 '%message% ' => $ this ->replacePlaceHolder ($ record )['message ' ],
124124 '%context% ' => $ context ,
125125 '%extra% ' => $ extra ,
126- ) );
126+ ] );
127127
128128 return $ formatted ;
129129 }
@@ -149,7 +149,7 @@ public function castObject($v, array $a, Stub $s, $isNested)
149149
150150 if ($ isNested && !$ v instanceof \DateTimeInterface) {
151151 $ s ->cut = -1 ;
152- $ a = array () ;
152+ $ a = [] ;
153153 }
154154
155155 return $ a ;
@@ -165,7 +165,7 @@ private function replacePlaceHolder(array $record)
165165
166166 $ context = $ record ['context ' ];
167167
168- $ replacements = array () ;
168+ $ replacements = [] ;
169169 foreach ($ context as $ k => $ v ) {
170170 // Remove quotes added by the dumper around string.
171171 $ v = trim ($ this ->dumpData ($ v , false ), '" ' );
0 commit comments