File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -403,14 +403,17 @@ function ($value, $key) use ($lines) {
403403 }
404404
405405 foreach ($ lines as $ line => $ data ) {
406- if ($ data !== null ) {
407- if (!isset ($ this ->data [$ file ][$ line ])) {
408- $ this ->data [$ file ][$ line ] = $ data ;
409- } else {
410- $ this ->data [$ file ][$ line ] = \array_unique (
411- \array_merge ($ this ->data [$ file ][$ line ], $ data )
412- );
413- }
406+ if ($ data === null || $ this ->data [$ file ][$ line ] === null ) {
407+ // if the line is marked as "dead code" in either, mark it as dead code in the merged result
408+ $ this ->data [$ file ][$ line ] = null ;
409+ } else if (!isset ($ this ->data [$ file ][$ line ])) {
410+ // if no data has been set in the current data, overwrite all
411+ $ this ->data [$ file ][$ line ] = $ data ;
412+ } else {
413+ // otherwise merge data from both coverage files
414+ $ this ->data [$ file ][$ line ] = \array_unique (
415+ \array_merge ($ this ->data [$ file ][$ line ], $ data )
416+ );
414417 }
415418 }
416419 }
You can’t perform that action at this time.
0 commit comments