Skip to content

Commit 02a1cd2

Browse files
committed
Fix some of the coverage issues
1 parent 079736a commit 02a1cd2

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/CodeCoverage.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,10 @@ private function initializeFilesThatAreSeenTheFirstTime(array $data): void
618618
foreach ($fileData['lines'] as $lineNumber => $flag) {
619619
if ($flag === Driver::LINE_NOT_EXECUTABLE) {
620620
$this->data[$file]['lines'][$lineNumber] = null;
621+
} else {
622+
$this->addCoverageLinePathCovered($file, $lineNumber, false);
621623
}
624+
622625
}
623626

624627
foreach ($fileData['functions'] as $functionName => $functionData) {
@@ -1203,9 +1206,9 @@ private function initializeData(): void
12031206
continue;
12041207
}
12051208

1206-
foreach (\array_keys($fileCoverage) as $key) {
1207-
if ($fileCoverage[$key] === Driver::LINE_EXECUTED) {
1208-
$fileCoverage[$key] = Driver::LINE_NOT_EXECUTED;
1209+
foreach (\array_keys($fileCoverage['lines']) as $key) {
1210+
if ($fileCoverage['lines'][$key] === Driver::LINE_EXECUTED) {
1211+
$fileCoverage['lines'][$key] = Driver::LINE_NOT_EXECUTED;
12091212
}
12101213
}
12111214

src/Driver/Xdebug.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function start(bool $determineUnusedAndDead = true): void
6666
}
6767

6868
if ($this->determineBranchCoverage) {
69-
$flag = XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE | XDEBUG_CC_BRANCH_CHECK;
69+
$flag |= XDEBUG_CC_BRANCH_CHECK;
7070
}
7171

7272
\xdebug_start_code_coverage($flag);

0 commit comments

Comments
 (0)