Skip to content

Commit 58834da

Browse files
committed
Fixed undefined index when merging code coverage
1 parent 7a58d4f commit 58834da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/CodeCoverage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ function ($value, $key) use ($lines) {
403403
}
404404

405405
foreach ($lines as $line => $data) {
406-
if ($data === null || $this->data[$file][$line] === null) {
406+
if ($data === null || (array_key_exists($line, $this->data[$file]) && $this->data[$file][$line] === null)) {
407407
// if the line is marked as "dead code" in either, mark it as dead code in the merged result
408408
$this->data[$file][$line] = null;
409409
} else if (!isset($this->data[$file][$line])) {

0 commit comments

Comments
 (0)