File tree Expand file tree Collapse file tree 3 files changed +44
-38
lines changed Expand file tree Collapse file tree 3 files changed +44
-38
lines changed Original file line number Diff line number Diff line change @@ -715,6 +715,8 @@ private function getLinesToBeIgnored($filename)
715715 case 'PHP_Token_FUNCTION ' : {
716716 $ docblock = $ token ->getDocblock ();
717717
718+ $ this ->ignoredLines [$ filename ][] = $ token ->getLine ();
719+
718720 if (strpos ($ docblock , '@codeCoverageIgnore ' )) {
719721 $ endLine = $ token ->getEndLine ();
720722
Original file line number Diff line number Diff line change @@ -366,6 +366,7 @@ public function testGetLinesToBeIgnored()
366366 25 ,
367367 26 ,
368368 27 ,
369+ 28 ,
369370 30 ,
370371 32 ,
371372 33 ,
@@ -404,15 +405,17 @@ public function testGetLinesToBeIgnored3()
404405 {
405406 $ this ->assertEquals (
406407 array (
407- 0 => 1 ,
408- 1 => 2 ,
409- 2 => 3 ,
410- 3 => 4 ,
411- 4 => 8 ,
412- 5 => 15 ,
413- 6 => 16 ,
414- 7 => 19 ,
415- 8 => 20
408+ 1 ,
409+ 2 ,
410+ 3 ,
411+ 4 ,
412+ 5 ,
413+ 8 ,
414+ 11 ,
415+ 15 ,
416+ 16 ,
417+ 19 ,
418+ 20
416419 ),
417420 $ this ->getLinesToBeIgnored ()->invoke (
418421 $ this ->coverage ,
@@ -428,32 +431,33 @@ public function testGetLinesToBeIgnoredOneLineAnnotations()
428431 {
429432 $ this ->assertEquals (
430433 array (
431- 0 => 1 ,
432- 1 => 2 ,
433- 2 => 3 ,
434- 3 => 4 ,
435- 4 => 5 ,
436- 5 => 6 ,
437- 6 => 7 ,
438- 7 => 8 ,
439- 8 => 9 ,
440- 9 => 10 ,
441- 10 => 11 ,
442- 11 => 12 ,
443- 12 => 13 ,
444- 13 => 14 ,
445- 14 => 17 ,
446- 15 => 19 ,
447- 16 => 22 ,
448- 17 => 23 ,
449- 18 => 27 ,
450- 19 => 28 ,
451- 20 => 29 ,
452- 21 => 30 ,
453- 22 => 31 ,
454- 23 => 32 ,
455- 24 => 33 ,
456- 25 => 36
434+ 1 ,
435+ 2 ,
436+ 3 ,
437+ 4 ,
438+ 5 ,
439+ 6 ,
440+ 7 ,
441+ 8 ,
442+ 9 ,
443+ 10 ,
444+ 11 ,
445+ 12 ,
446+ 13 ,
447+ 14 ,
448+ 15 ,
449+ 17 ,
450+ 19 ,
451+ 22 ,
452+ 23 ,
453+ 27 ,
454+ 28 ,
455+ 29 ,
456+ 30 ,
457+ 31 ,
458+ 32 ,
459+ 33 ,
460+ 36
457461 ),
458462 $ this ->getLinesToBeIgnored ()->invoke (
459463 $ this ->coverage ,
Original file line number Diff line number Diff line change 33 <project timestamp =" %i" >
44 <file name =" %s/source_with_class_and_anonymous_function.php" >
55 <class name =" CoveredClassWithAnonymousFunctionInStaticMethod" namespace =" global" >
6- <metrics methods =" 2" coveredmethods =" 1" conditionals =" 0" coveredconditionals =" 0" statements =" 6 " coveredstatements =" 5 " elements =" 8 " coveredelements =" 6 " />
6+ <metrics methods =" 2" coveredmethods =" 1" conditionals =" 0" coveredconditionals =" 0" statements =" 5 " coveredstatements =" 4 " elements =" 7 " coveredelements =" 5 " />
77 </class >
88 <line num =" 5" type =" method" name =" runAnonymous" crap =" 1.04" count =" 1" />
99 <line num =" 7" type =" stmt" count =" 1" />
1515 <line num =" 14" type =" stmt" count =" 1" />
1616 <line num =" 17" type =" stmt" count =" 1" />
1717 <line num =" 18" type =" stmt" count =" 1" />
18- <metrics loc =" 19" ncloc =" 17" classes =" 1" methods =" 2" coveredmethods =" 1" conditionals =" 0" coveredconditionals =" 0" statements =" 9 " coveredstatements =" 8 " elements =" 11 " coveredelements =" 9 " />
18+ <metrics loc =" 19" ncloc =" 17" classes =" 1" methods =" 2" coveredmethods =" 1" conditionals =" 0" coveredconditionals =" 0" statements =" 8 " coveredstatements =" 7 " elements =" 10 " coveredelements =" 8 " />
1919 </file >
20- <metrics files =" 1" loc =" 19" ncloc =" 17" classes =" 1" methods =" 2" coveredmethods =" 1" conditionals =" 0" coveredconditionals =" 0" statements =" 9 " coveredstatements =" 8 " elements =" 11 " coveredelements =" 9 " />
20+ <metrics files =" 1" loc =" 19" ncloc =" 17" classes =" 1" methods =" 2" coveredmethods =" 1" conditionals =" 0" coveredconditionals =" 0" statements =" 8 " coveredstatements =" 7 " elements =" 10 " coveredelements =" 8 " />
2121 </project >
2222</coverage >
You can’t perform that action at this time.
0 commit comments