Skip to content

Commit 5266246

Browse files
Fixed minor doc-blocks issues with tests
1 parent d0522ed commit 5266246

File tree

5 files changed

+12
-31
lines changed

5 files changed

+12
-31
lines changed

phpstan.neon.dist

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,7 @@ parameters:
66
paths: [src]
77
checkGenericClassInNonGenericObjectType: false
88

9-
excludes_analyse:
10-
- src/DependencyInjection/*
11-
129
ignoreErrors:
1310
-
14-
message: "#^Parameter \\#1 \\$argument of class ReflectionClass constructor expects class-string<T of object>\\|T of object, string given.$#"
15-
path: src/AnnotationLoader.php
16-
-
17-
message: "#^Call to an undefined method ReflectionClass\\|ReflectionMethod\\|ReflectionProperty\\:\\:getAttributes\\(\\).$#"
18-
path: src/AnnotationLoader.php
19-
-
20-
message: "#^Instanceof between ReflectionProperty and ReflectionProperty will always evaluate to true.$#"
11+
message: "#^Unable to resolve the template type T in call to method Spiral\\\\Attributes\\\\ReaderInterface\\:\\:(getParameterMetadata\\(\\)|getFunctionMetadata\\(\\)|getClassMetadata\\(\\)|getPropertyMetadata\\(\\)|getConstantMetadata\\(\\))$#"
2112
path: src/AnnotationLoader.php

phpunit.xml.dist

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,5 @@
2222
<include>
2323
<directory>src</directory>
2424
</include>
25-
26-
<exclude>
27-
<directory>src/DependecyInjection</directory>
28-
</exclude>
2925
</coverage>
3026
</phpunit>

psalm.xml.dist

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,10 @@
1717
<directory name="src"/>
1818
<ignoreFiles>
1919
<directory name="vendor"/>
20-
<directory name="src/DependencyInjection"/>
2120
</ignoreFiles>
2221
</projectFiles>
2322

24-
<issueHandlers>
25-
<UndefinedMethod>
26-
<errorLevel type="suppress">
27-
<referencedMethod name="ReflectionClass::getAttributes" />
28-
</errorLevel>
29-
</UndefinedMethod>
30-
31-
<ArgumentTypeCoercion>
32-
<errorLevel type="suppress">
33-
<referencedFunction name="ReflectionClass::__construct" />
34-
</errorLevel>
35-
</ArgumentTypeCoercion>
36-
</issueHandlers>
23+
<stubs>
24+
<file name="vendor/vimeo/psalm/stubs/Php80.php" />
25+
</stubs>
3726
</psalm>

src/AnnotationLoader.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ private function findAnnotations(string $resource, ListenerInterface $listener):
112112
$classes[] = $resource;
113113
}
114114

115+
/** @var class-string $class */
115116
foreach ($classes as $class) {
116117
$classReflection = new ReflectionClass($class);
117118
$className = $classReflection->getName();
@@ -167,6 +168,7 @@ private function findAnnotations(string $resource, ListenerInterface $listener):
167168
}
168169

169170
/**
171+
*
170172
* @param Reflector $reflection
171173
*
172174
* @return iterable<object>
@@ -209,10 +211,10 @@ private function getAnnotations(Reflector $reflection, ListenerInterface $listen
209211
}
210212

211213
/**
212-
* @param array $parameters
213-
* @param ListenerInterface $listener
214+
* @param ReflectionParameter[] $parameters
215+
* @param ListenerInterface $listener
214216
*
215-
* @return iterable<object>
217+
* @return iterable<int,object[]>
216218
*/
217219
private function getMethodParameter(array $parameters, ListenerInterface $listener): iterable
218220
{

tests/AnnotationLoaderTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ public function testAttach(): void
6767
}
6868
}
6969

70+
asort($names);
71+
asort($result);
72+
7073
$this->assertEquals([
7174
'default',
7275
'protected_property',

0 commit comments

Comments
 (0)