@@ -33,7 +33,7 @@ class CodeExtension extends AbstractExtension
3333 public function __construct ($ fileLinkFormat , $ rootDir , $ charset )
3434 {
3535 $ this ->fileLinkFormat = $ fileLinkFormat ?: ini_get ('xdebug.file_link_format ' ) ?: get_cfg_var ('xdebug.file_link_format ' );
36- $ this ->rootDir = str_replace ('/ ' , DIRECTORY_SEPARATOR , dirname ($ rootDir )).DIRECTORY_SEPARATOR ;
36+ $ this ->rootDir = str_replace ('/ ' , DIRECTORY_SEPARATOR , \ dirname ($ rootDir )).DIRECTORY_SEPARATOR ;
3737 $ this ->charset = $ charset ;
3838 }
3939
@@ -92,7 +92,7 @@ public function formatArgs($args)
9292 $ short = array_pop ($ parts );
9393 $ formattedValue = sprintf ('<em>object</em>(<abbr title="%s">%s</abbr>) ' , $ item [1 ], $ short );
9494 } elseif ('array ' === $ item [0 ]) {
95- $ formattedValue = sprintf ('<em>array</em>(%s) ' , is_array ($ item [1 ]) ? $ this ->formatArgs ($ item [1 ]) : $ item [1 ]);
95+ $ formattedValue = sprintf ('<em>array</em>(%s) ' , \ is_array ($ item [1 ]) ? $ this ->formatArgs ($ item [1 ]) : $ item [1 ]);
9696 } elseif ('string ' === $ item [0 ]) {
9797 $ formattedValue = sprintf ("'%s' " , htmlspecialchars ($ item [1 ], ENT_QUOTES , $ this ->charset ));
9898 } elseif ('null ' === $ item [0 ]) {
@@ -105,7 +105,7 @@ public function formatArgs($args)
105105 $ formattedValue = str_replace ("\n" , '' , var_export (htmlspecialchars ((string ) $ item [1 ], ENT_QUOTES , $ this ->charset ), true ));
106106 }
107107
108- $ result [] = is_int ($ key ) ? $ formattedValue : sprintf ("'%s' => %s " , $ key , $ formattedValue );
108+ $ result [] = \ is_int ($ key ) ? $ formattedValue : sprintf ("'%s' => %s " , $ key , $ formattedValue );
109109 }
110110
111111 return implode (', ' , $ result );
@@ -142,7 +142,7 @@ public function fileExcerpt($file, $line)
142142 $ content = explode ('<br /> ' , $ code );
143143
144144 $ lines = array ();
145- for ($ i = max ($ line - 3 , 1 ), $ max = min ($ line + 3 , count ($ content )); $ i <= $ max ; ++$ i ) {
145+ for ($ i = max ($ line - 3 , 1 ), $ max = min ($ line + 3 , \ count ($ content )); $ i <= $ max ; ++$ i ) {
146146 $ lines [] = '<li ' .($ i == $ line ? ' class="selected" ' : '' ).'><code> ' .self ::fixCodeMarkup ($ content [$ i - 1 ]).'</code></li> ' ;
147147 }
148148
@@ -166,7 +166,7 @@ public function formatFile($file, $line, $text = null)
166166 if (null === $ text ) {
167167 $ text = str_replace ('/ ' , DIRECTORY_SEPARATOR , $ file );
168168 if (0 === strpos ($ text , $ this ->rootDir )) {
169- $ text = substr ($ text , strlen ($ this ->rootDir ));
169+ $ text = substr ($ text , \ strlen ($ this ->rootDir ));
170170 $ text = explode (DIRECTORY_SEPARATOR , $ text , 2 );
171171 $ text = sprintf ('<abbr title="%s%2$s">%s</abbr>%s ' , $ this ->rootDir , $ text [0 ], isset ($ text [1 ]) ? DIRECTORY_SEPARATOR .$ text [1 ] : '' );
172172 }
0 commit comments