File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -266,15 +266,26 @@ public function merge(PHP_CodeCoverage $that)
266266 if (!isset ($ this ->data [$ id ])) {
267267 $ this ->data [$ id ] = $ data ;
268268 } else {
269- throw new RuntimeException ('TODO ' );
269+ foreach (array ('filtered ' , 'raw ' ) as $ type ) {
270+ foreach ($ data [$ type ] as $ file => $ lines ) {
271+ if (!isset ($ this ->data [$ id ][$ type ][$ file ])) {
272+ $ this ->data [$ id ][$ type ][$ file ] = $ lines ;
273+ } else {
274+ foreach ($ lines as $ line => $ flag ) {
275+ if (!isset ($ this ->data [$ id ][$ type ][$ file ][$ line ]) ||
276+ $ flag > $ this ->data [$ id ][$ type ][$ file ][$ line ]) {
277+ $ this ->data [$ id ][$ type ][$ file ][$ line ] = $ flag ;
278+ }
279+ }
280+ }
281+ }
282+ }
270283 }
271284 }
272285
273286 foreach ($ that ->tests as $ id => $ status ) {
274- if (!isset ($ this ->tests [$ id ])) {
287+ if (!isset ($ this ->tests [$ id ]) || $ status > $ this -> tests [ $ id ] ) {
275288 $ this ->tests [$ id ] = $ status ;
276- } else {
277- throw new RuntimeException ('TODO ' );
278289 }
279290 }
280291
You can’t perform that action at this time.
0 commit comments