Skip to content

Commit 64e2dbf

Browse files
staabmsebastianbergmann
authored andcommitted
Narrow line-coverage types
1 parent fd180b8 commit 64e2dbf

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Data/ProcessedCodeCoverageData.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,15 @@
4141
* }>
4242
* }
4343
* @phpstan-type FunctionCoverageType array<string, array<string, FunctionCoverageDataType>>
44+
* @phpstan-type LineCoverageType array<string, array<int, null|list<TestIdType>>>
4445
*/
4546
final class ProcessedCodeCoverageData
4647
{
4748
/**
4849
* Line coverage data.
4950
* An array of filenames, each having an array of linenumbers, each executable line having an array of testcase ids.
5051
*
51-
* @var array<string, array<int, null|list<TestIdType>>>
52+
* @var LineCoverageType
5253
*/
5354
private array $lineCoverage = [];
5455

@@ -111,11 +112,17 @@ public function markCodeAsExecutedByTestCase(string $testCaseId, RawCodeCoverage
111112
}
112113
}
113114

115+
/**
116+
* @param LineCoverageType $lineCoverage
117+
*/
114118
public function setLineCoverage(array $lineCoverage): void
115119
{
116120
$this->lineCoverage = $lineCoverage;
117121
}
118122

123+
/**
124+
* @return LineCoverageType
125+
*/
119126
public function lineCoverage(): array
120127
{
121128
ksort($this->lineCoverage);

0 commit comments

Comments
 (0)