Skip to content

Commit b22cb52

Browse files
Narrow types
1 parent 9354b26 commit b22cb52

File tree

5 files changed

+24
-0
lines changed

5 files changed

+24
-0
lines changed

tests/tests/StaticAnalysis/Value/ClassTest.php

+5
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ public function testMayHaveMethods(): void
8484
$this->assertSame($methods, $this->class(methods: $methods)->methods());
8585
}
8686

87+
/**
88+
* @param list<non-empty-string> $interfaces
89+
* @param list<non-empty-string> $traits
90+
* @param array<non-empty-string, Method> $methods
91+
*/
8792
private function class(?string $parentClass = null, array $interfaces = [], array $traits = [], array $methods = []): Class_
8893
{
8994
return new Class_(

tests/tests/StaticAnalysis/Value/InterfaceTest.php

+3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ public function testMayHaveParentInterfaces(): void
4949
$this->assertSame($interfaces, $this->interface(parentInterfaces: $interfaces)->parentInterfaces());
5050
}
5151

52+
/**
53+
* @param list<non-empty-string> $parentInterfaces
54+
*/
5255
private function interface(array $parentInterfaces = []): Interface_
5356
{
5457
return new Interface_(

tests/tests/StaticAnalysis/Value/TraitTest.php

+3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ public function testMayHaveMethods(): void
4949
$this->assertSame($methods, $this->trait(methods: $methods)->methods());
5050
}
5151

52+
/**
53+
* @param array<non-empty-string, Method> $methods
54+
*/
5255
private function trait(array $methods = []): Trait_
5356
{
5457
return new Trait_(

tests/tests/Target/MapBuilderTest.php

+8
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
use SebastianBergmann\CodeCoverage\Filter;
1919
use SebastianBergmann\CodeCoverage\StaticAnalysis\ParsingFileAnalyser;
2020

21+
/**
22+
* @phpstan-import-type TargetMap from Mapper
23+
*/
2124
#[CoversClass(MapBuilder::class)]
2225
#[Small]
2326
final class MapBuilderTest extends TestCase
@@ -120,6 +123,11 @@ public function testBuildsMap(): void
120123
);
121124
}
122125

126+
/**
127+
* @param list<string> $files
128+
*
129+
* @return TargetMap
130+
*/
123131
private function map(array $files): array
124132
{
125133
$filter = new Filter;

tests/tests/Target/MapperTest.php

+5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
use SebastianBergmann\CodeCoverage\Filter;
2222
use SebastianBergmann\CodeCoverage\StaticAnalysis\ParsingFileAnalyser;
2323

24+
/**
25+
* @phpstan-import-type TargetMap from Mapper
26+
*/
2427
#[CoversClass(Mapper::class)]
2528
#[Small]
2629
final class MapperTest extends TestCase
@@ -206,6 +209,8 @@ private function mapper(array $files): Mapper
206209

207210
/**
208211
* @param list<non-empty-string> $files
212+
*
213+
* @return TargetMap
209214
*/
210215
private function map(array $files): array
211216
{

0 commit comments

Comments
 (0)