Skip to content

Commit a1737e1

Browse files
Eliminate else branch
1 parent bcbe040 commit a1737e1

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/RawCodeCoverageData.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,16 @@ public static function fromXdebugWithPathCoverage(array $rawCoverage): self
3939
$functionCoverage = [];
4040

4141
foreach ($rawCoverage as $file => $fileCoverageData) {
42-
if (isset($fileCoverageData['functions'])) {
43-
$lineCoverage[$file] = $fileCoverageData['lines'];
44-
$functionCoverage[$file] = $fileCoverageData['functions'];
45-
} else { // not every file has functions, Xdebug outputs just line data for these
42+
if (!isset($fileCoverageData['functions'])) {
43+
// Current file does not have functions, so line coverage
44+
// is stored in $fileCoverageData, not in $fileCoverageData['lines']
4645
$lineCoverage[$file] = $fileCoverageData;
46+
47+
continue;
4748
}
49+
50+
$lineCoverage[$file] = $fileCoverageData['lines'];
51+
$functionCoverage[$file] = $fileCoverageData['functions'];
4852
}
4953

5054
return new self($lineCoverage, $functionCoverage);

0 commit comments

Comments
 (0)