Skip to content

Commit a9f22c2

Browse files
committed
fix
1 parent 21e670c commit a9f22c2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/CodeCoverage.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ public function merge(self $that): void
378378
continue;
379379
}
380380

381+
381382
// we should compare the lines if any of two contains data
382383
$compareLineNumbers = \array_unique(
383384
\array_merge(
@@ -386,6 +387,21 @@ public function merge(self $that): void
386387
)
387388
);
388389

390+
$dif1 = \array_keys(\array_diff_key($this->data[$file], $that->data[$file]));
391+
$dif2 = \array_keys(\array_diff_key($that->data[$file], $this->data[$file]));
392+
if (!empty($dif1)) {
393+
foreach ($dif1 as $key) {
394+
$this->data[$file][$key][] = 'Unknown';
395+
}
396+
}
397+
if (!empty($dif2)) {
398+
foreach ($dif2 as $key) {
399+
if (empty($this->data[$file][$key])) {
400+
$this->data[$file][$key][] = 'Unknown';
401+
}
402+
}
403+
}
404+
389405
foreach ($compareLineNumbers as $line) {
390406
$thatPriority = $this->getLinePriority($that->data[$file], $line);
391407
$thisPriority = $this->getLinePriority($this->data[$file], $line);

0 commit comments

Comments
 (0)