5656 */
5757class PHP_CodeCoverage_Report_HTML_Renderer_File extends PHP_CodeCoverage_Report_HTML_Renderer
5858{
59- /**
60- * @var boolean
61- */
62- protected $ highlight ;
63-
6459 /**
6560 * Constructor.
6661 *
@@ -69,9 +64,8 @@ class PHP_CodeCoverage_Report_HTML_Renderer_File extends PHP_CodeCoverage_Report
6964 * @param string $date
7065 * @param integer $lowUpperBound
7166 * @param integer $highLowerBound
72- * @param boolean $highlight
7367 */
74- public function __construct ($ templatePath , $ generator , $ date , $ lowUpperBound , $ highLowerBound, $ highlight )
68+ public function __construct ($ templatePath , $ generator , $ date , $ lowUpperBound , $ highLowerBound )
7569 {
7670 parent ::__construct (
7771 $ templatePath ,
@@ -80,8 +74,6 @@ public function __construct($templatePath, $generator, $date, $lowUpperBound, $h
8074 $ lowUpperBound ,
8175 $ highLowerBound
8276 );
83-
84- $ this ->highlight = $ highlight ;
8577 }
8678
8779 /**
@@ -394,7 +386,7 @@ protected function renderSource(PHP_CodeCoverage_Report_Node_File $node)
394386 $ i ,
395387 $ i ,
396388 $ i ,
397- ! $ this -> highlight ? htmlspecialchars ( $ line ) : $ line
389+ $ line
398390 );
399391
400392 $ i ++;
@@ -409,26 +401,10 @@ protected function renderSource(PHP_CodeCoverage_Report_Node_File $node)
409401 */
410402 protected function loadFile ($ file )
411403 {
412- $ buffer = file_get_contents ($ file );
413- $ lines = explode ("\n" , str_replace ("\t" , ' ' , $ buffer ));
414- $ result = array ();
415-
416- if (count ($ lines ) == 0 ) {
417- return $ result ;
418- }
419-
420- $ lines = array_map ('rtrim ' , $ lines );
421-
422- if (!$ this ->highlight ) {
423- unset($ lines [count ($ lines )-1 ]);
424-
425- return $ lines ;
426- }
427-
428- $ tokens = token_get_all ($ buffer );
429- $ stringFlag = false ;
404+ $ tokens = token_get_all (file_get_contents ($ file ));
405+ $ result = array ('' );
430406 $ i = 0 ;
431- $ result [ $ i ] = '' ;
407+ $ stringFlag = false ;
432408
433409 foreach ($ tokens as $ j => $ token ) {
434410 if (is_string ($ token )) {
0 commit comments