@@ -841,6 +841,9 @@ private function processUncoveredLines($raw = false)
841
841
$ filesToProcess = array_keys ($ this ->data );
842
842
}
843
843
844
+ $ coverageData = $ this ->data ;
845
+ $ this ->data = [];
846
+
844
847
foreach ($ filesToProcess as $ file ) {
845
848
846
849
if (!file_exists ($ file )) {
@@ -855,32 +858,30 @@ private function processUncoveredLines($raw = false)
855
858
$ this ->driver ->start ();
856
859
include_once ($ file );
857
860
$ data = $ this ->driver ->stop ();
861
+
858
862
} else {
859
863
$ lines = count (file ($ file ));
860
864
861
865
for ($ i = 1 ; $ i <= $ lines ; $ i ++) {
862
- $ data [$ file ][$ i ] = [] ;
866
+ $ data [$ file ][$ i ] = PHP_CodeCoverage_Driver:: LINE_NOT_EXECUTED ;
863
867
}
864
868
}
865
869
866
- if (empty ($ data [$ file ])) {
867
- continue ;
868
- }
870
+ $ this ->initializeFilesThatAreSeenTheFirstTime ($ data );
869
871
870
872
if (!$ isCoveredFile ) {
871
873
// If it is an uncovered file, just append the data
872
874
$ this ->append ($ data , 'UNCOVERED_FILES_FROM_WHITELIST ' );
873
- } else {
874
-
875
- // Otherwise, we need to merge the uncovered/dead code with the coverage data
875
+ }
876
+ }
876
877
877
- foreach ($ data [$ file ] as $ k => $ v ) {
878
- if (!isset ($ this ->data [$ file ][$ k ])) {
879
- $ this ->data [$ file ][$ k ] = $ v == -2 ? null : [];
880
- }
881
- }
878
+ foreach ($ coverageData as $ file => $ lines ) {
879
+ foreach ($ lines as $ k => $ v ) {
880
+ $ this ->data [$ file ][$ k ] = $ v ;
882
881
}
882
+ }
883
883
884
+ foreach ($ this ->data as $ file => $ lines ) {
884
885
foreach ($ this ->getLinesToBeIgnored ($ file ) as $ line ) {
885
886
unset($ this ->data [$ file ][$ line ]);
886
887
}
0 commit comments