@@ -43,17 +43,17 @@ public function __construct($fileLinkFormat, $rootDir, $charset)
4343 */
4444 public function getFilters ()
4545 {
46- return array (
47- new TwigFilter ('abbr_class ' , array ( $ this , 'abbrClass ' ), array ( 'is_safe ' => array ( 'html ' )) ),
48- new TwigFilter ('abbr_method ' , array ( $ this , 'abbrMethod ' ), array ( 'is_safe ' => array ( 'html ' )) ),
49- new TwigFilter ('format_args ' , array ( $ this , 'formatArgs ' ), array ( 'is_safe ' => array ( 'html ' )) ),
50- new TwigFilter ('format_args_as_text ' , array ( $ this , 'formatArgsAsText ' ) ),
51- new TwigFilter ('file_excerpt ' , array ( $ this , 'fileExcerpt ' ), array ( 'is_safe ' => array ( 'html ' )) ),
52- new TwigFilter ('format_file ' , array ( $ this , 'formatFile ' ), array ( 'is_safe ' => array ( 'html ' )) ),
53- new TwigFilter ('format_file_from_text ' , array ( $ this , 'formatFileFromText ' ), array ( 'is_safe ' => array ( 'html ' )) ),
54- new TwigFilter ('format_log_message ' , array ( $ this , 'formatLogMessage ' ), array ( 'is_safe ' => array ( 'html ' )) ),
55- new TwigFilter ('file_link ' , array ( $ this , 'getFileLink ' ) ),
56- ) ;
46+ return [
47+ new TwigFilter ('abbr_class ' , [ $ this , 'abbrClass ' ], [ 'is_safe ' => [ 'html ' ]] ),
48+ new TwigFilter ('abbr_method ' , [ $ this , 'abbrMethod ' ], [ 'is_safe ' => [ 'html ' ]] ),
49+ new TwigFilter ('format_args ' , [ $ this , 'formatArgs ' ], [ 'is_safe ' => [ 'html ' ]] ),
50+ new TwigFilter ('format_args_as_text ' , [ $ this , 'formatArgsAsText ' ] ),
51+ new TwigFilter ('file_excerpt ' , [ $ this , 'fileExcerpt ' ], [ 'is_safe ' => [ 'html ' ]] ),
52+ new TwigFilter ('format_file ' , [ $ this , 'formatFile ' ], [ 'is_safe ' => [ 'html ' ]] ),
53+ new TwigFilter ('format_file_from_text ' , [ $ this , 'formatFileFromText ' ], [ 'is_safe ' => [ 'html ' ]] ),
54+ new TwigFilter ('format_log_message ' , [ $ this , 'formatLogMessage ' ], [ 'is_safe ' => [ 'html ' ]] ),
55+ new TwigFilter ('file_link ' , [ $ this , 'getFileLink ' ] ),
56+ ] ;
5757 }
5858
5959 public function abbrClass ($ class )
@@ -87,7 +87,7 @@ public function abbrMethod($method)
8787 */
8888 public function formatArgs ($ args )
8989 {
90- $ result = array () ;
90+ $ result = [] ;
9191 foreach ($ args as $ key => $ item ) {
9292 if ('object ' === $ item [0 ]) {
9393 $ parts = explode ('\\' , $ item [1 ]);
@@ -146,7 +146,7 @@ public function fileExcerpt($file, $line, $srcContext = 3)
146146 }, $ code );
147147 $ content = explode ('<br /> ' , $ code );
148148
149- $ lines = array () ;
149+ $ lines = [] ;
150150 if (0 > $ srcContext ) {
151151 $ srcContext = \count ($ content );
152152 }
@@ -205,7 +205,7 @@ public function formatFile($file, $line, $text = null)
205205 public function getFileLink ($ file , $ line )
206206 {
207207 if ($ fmt = $ this ->fileLinkFormat ) {
208- return \is_string ($ fmt ) ? strtr ($ fmt , array ( '%f ' => $ file , '%l ' => $ line) ) : $ fmt ->format ($ file , $ line );
208+ return \is_string ($ fmt ) ? strtr ($ fmt , [ '%f ' => $ file , '%l ' => $ line] ) : $ fmt ->format ($ file , $ line );
209209 }
210210
211211 return false ;
@@ -224,7 +224,7 @@ public function formatFileFromText($text)
224224 public function formatLogMessage ($ message , array $ context )
225225 {
226226 if ($ context && false !== strpos ($ message , '{ ' )) {
227- $ replacements = array () ;
227+ $ replacements = [] ;
228228 foreach ($ context as $ key => $ val ) {
229229 if (is_scalar ($ val )) {
230230 $ replacements ['{ ' .$ key .'} ' ] = $ val ;
0 commit comments