Skip to content

Commit 5e5e8cb

Browse files
Narrow types
1 parent bcd0be2 commit 5e5e8cb

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/Data/ProcessedCodeCoverageData.php

+2
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ public function merge(self $newData): void
219219
* 4 = the line has been tested
220220
*
221221
* During a merge, a higher number is better.
222+
*
223+
* @return 1|2|3|4
222224
*/
223225
private function priorityForLine(array $data, int $line): int
224226
{

src/Node/File.php

+10
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use function array_filter;
1313
use function count;
1414
use function range;
15+
use SebastianBergmann\CodeCoverage\CodeCoverage;
1516
use SebastianBergmann\CodeCoverage\StaticAnalysis\Class_;
1617
use SebastianBergmann\CodeCoverage\StaticAnalysis\FileAnalyser;
1718
use SebastianBergmann\CodeCoverage\StaticAnalysis\Function_;
@@ -22,6 +23,7 @@
2223
/**
2324
* @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
2425
*
26+
* @phpstan-import-type TestType from CodeCoverage
2527
* @phpstan-import-type LinesType from FileAnalyser
2628
*
2729
* @phpstan-type ProcessedFunctionType array{
@@ -98,6 +100,10 @@ final class File extends AbstractNode
98100
*/
99101
private array $lineCoverageData;
100102
private array $functionCoverageData;
103+
104+
/**
105+
* @var array<string, TestType>
106+
*/
101107
private readonly array $testData;
102108
private int $numExecutableLines = 0;
103109
private int $numExecutedLines = 0;
@@ -136,6 +142,7 @@ final class File extends AbstractNode
136142

137143
/**
138144
* @param array<int, ?list<non-empty-string>> $lineCoverageData
145+
* @param array<string, TestType> $testData
139146
* @param array<string, Class_> $classes
140147
* @param array<string, Trait_> $traits
141148
* @param array<string, Function_> $functions
@@ -170,6 +177,9 @@ public function functionCoverageData(): array
170177
return $this->functionCoverageData;
171178
}
172179

180+
/**
181+
* @return array<string, TestType>
182+
*/
173183
public function testData(): array
174184
{
175185
return $this->testData;

0 commit comments

Comments
 (0)