File tree 4 files changed +26
-4
lines changed
4 files changed +26
-4
lines changed Original file line number Diff line number Diff line change 38
38
/**
39
39
* Provides collection functionality for PHP code coverage information.
40
40
*
41
- * @phpstan-type TestType array{
42
- * size: string,
43
- * status: string,
44
- * }
41
+ * @phpstan-type TestType array{size: string, status: string}
42
+ * @phpstan-type TargetedLines array<non-empty-string, list<positive-int>>
45
43
*/
46
44
final class CodeCoverage
47
45
{
@@ -374,6 +372,9 @@ public function validate(TargetCollection $targets): ValidationResult
374
372
}
375
373
376
374
/**
375
+ * @param false|TargetedLines $linesToBeCovered
376
+ * @param TargetedLines $linesToBeUsed
377
+ *
377
378
* @throws ReflectionException
378
379
* @throws UnintentionallyCoveredCodeException
379
380
*/
@@ -478,6 +479,9 @@ private function addUncoveredFilesFromFilter(): void
478
479
}
479
480
480
481
/**
482
+ * @param TargetedLines $linesToBeCovered
483
+ * @param TargetedLines $linesToBeUsed
484
+ *
481
485
* @throws ReflectionException
482
486
* @throws UnintentionallyCoveredCodeException
483
487
*/
@@ -507,6 +511,12 @@ private function performUnintentionallyCoveredCodeCheck(RawCodeCoverageData $dat
507
511
}
508
512
}
509
513
514
+ /**
515
+ * @param TargetedLines $linesToBeCovered
516
+ * @param TargetedLines $linesToBeUsed
517
+ *
518
+ * @return TargetedLines
519
+ */
510
520
private function getAllowedLines (array $ linesToBeCovered , array $ linesToBeUsed ): array
511
521
{
512
522
$ allowedLines = [];
Original file line number Diff line number Diff line change @@ -261,6 +261,9 @@ private function skipEmptyLines(): void
261
261
}
262
262
}
263
263
264
+ /**
265
+ * @return array<int>
266
+ */
264
267
private function getEmptyLinesForFile (string $ filename ): array
265
268
{
266
269
if (!isset (self ::$ emptyLineCache [$ filename ])) {
Original file line number Diff line number Diff line change @@ -29,6 +29,10 @@ abstract class AbstractNode implements Countable
29
29
{
30
30
private readonly string $ name ;
31
31
private string $ pathAsString ;
32
+
33
+ /**
34
+ * @var non-empty-list<self>
35
+ */
32
36
private array $ pathAsArray ;
33
37
private readonly ?AbstractNode $ parent ;
34
38
private string $ id ;
@@ -61,6 +65,9 @@ public function pathAsString(): string
61
65
return $ this ->pathAsString ;
62
66
}
63
67
68
+ /**
69
+ * @return non-empty-list<self>
70
+ */
64
71
public function pathAsArray (): array
65
72
{
66
73
return $ this ->pathAsArray ;
Original file line number Diff line number Diff line change 14
14
use RecursiveIterator ;
15
15
16
16
/**
17
+ * @template-implements RecursiveIterator<int, AbstractNode>
18
+ *
17
19
* @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
18
20
*/
19
21
final class Iterator implements RecursiveIterator
You can’t perform that action at this time.
0 commit comments