Skip to content

Commit 3577966

Browse files
committed
Update ProcessedFunctionCoverageData.php
1 parent 9910da8 commit 3577966

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/Data/ProcessedFunctionCoverageData.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,20 @@ public function merge(self $data): self
4848
{
4949
$branches = $this->branches;
5050
foreach($data->branches as $branchId => $branch) {
51-
if (isset($branches[$branchId])) {
52-
continue;
51+
if (!isset($branches[$branchId])) {
52+
$branches[$branchId] = $branch;
53+
} else {
54+
$branches[$branchId] = $branches[$branchId]->merge($branch);
5355
}
54-
$branches[$branchId] = $branches[$branchId]->merge($branch);
5556
}
5657

5758
$paths = $this->paths;
5859
foreach($data->paths as $pathId => $path) {
59-
if (isset($paths[$pathId])) {
60-
continue;
60+
if (!isset($paths[$pathId])) {
61+
$paths[$pathId] = $path;
62+
} else {
63+
$paths[$pathId] = $paths[$pathId]->merge($path);
6164
}
62-
$paths[$pathId] = $paths[$pathId]->merge($path);
6365
}
6466

6567
return new self(

0 commit comments

Comments
 (0)