We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6eb6ce8 commit ba8e4efCopy full SHA for ba8e4ef
src/Data/RawCodeCoverageData.php
@@ -14,6 +14,7 @@
14
use function array_flip;
15
use function array_intersect;
16
use function array_intersect_key;
17
+use function array_map;
18
use function count;
19
use function explode;
20
use function file_get_contents;
@@ -86,11 +87,10 @@ public static function fromXdebugWithPathCoverage(array $rawCoverage): self
86
87
88
public static function fromUncoveredFile(string $filename, FileAnalyser $analyser): self
89
{
- $lineCoverage = [];
90
-
91
- foreach ($analyser->executableLinesIn($filename) as $line => $branch) {
92
- $lineCoverage[$line] = Driver::LINE_NOT_EXECUTED;
93
- }
+ $lineCoverage = array_map(
+ static fn (): int => Driver::LINE_NOT_EXECUTED,
+ $analyser->executableLinesIn($filename),
+ );
94
95
return new self([$filename => $lineCoverage], []);
96
}
0 commit comments