File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments