Skip to content

Commit 9d3ec7e

Browse files
Fixed coding standard issues
1 parent 907b1fb commit 9d3ec7e

File tree

4 files changed

+13
-18
lines changed

4 files changed

+13
-18
lines changed

phpcs.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,8 @@
3636
<rule ref="PSR12.Files.FileHeader.IncorrectOrder">
3737
<exclude-pattern>*/tests/Fixtures/Sample.php</exclude-pattern>
3838
</rule>
39+
40+
<rule ref="Squiz.Classes.ValidClassName.NotCamelCaps">
41+
<exclude-pattern>*/src/Locate/*_.php</exclude-pattern>
42+
</rule>
3943
</ruleset>

phpstan.neon.dist

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@ includes:
22
- vendor/phpstan/phpstan-strict-rules/rules.neon
33

44
parameters:
5-
level: max
5+
level: 2
66
paths: [src]
77
checkGenericClassInNonGenericObjectType: false
8-
9-
ignoreErrors:
10-
-
11-
message: "#^Unable to resolve the template type T in call to method Spiral\\\\Attributes\\\\ReaderInterface\\:\\:(getParameterMetadata\\(\\)|getFunctionMetadata\\(\\)|getClassMetadata\\(\\)|getPropertyMetadata\\(\\)|getConstantMetadata\\(\\))$#"
12-
path: src/AnnotationLoader.php
13-
-
14-
message: "#^Argument of an invalid type array\\|null passed to yield from, only iterables are supported.$#"
15-
path: src/AnnotationLoader.php

psalm.xml.dist

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
xmlns="https://getpsalm.org/schema/config"
44
name="Psalm for PHP Annotations"
55
useDocblockTypes="true"
6-
errorLevel="3"
6+
errorLevel="7"
77
strictBinaryOperands="false"
88
rememberPropertyAssignmentsAfterCall="true"
99
checkForThrowsDocblock="false"
@@ -20,15 +20,11 @@
2020
</ignoreFiles>
2121
</projectFiles>
2222

23-
<stubs>
24-
<file name="vendor/vimeo/psalm/stubs/Php80.php" />
25-
</stubs>
26-
2723
<issueHandlers>
28-
<PossiblyInvalidArgument>
24+
<MethodSignatureMismatch>
2925
<errorLevel type="suppress">
30-
<referencedFunction name="Biurad\Annotations\AnnotationLoader::getAnnotations" />
26+
<directory name="src/Locate"/>
3127
</errorLevel>
32-
</PossiblyInvalidArgument>
28+
</MethodSignatureMismatch>
3329
</issueHandlers>
3430
</psalm>

src/Locate/Annotation.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,15 @@ abstract class Annotation implements \Stringable
3030
/** @var \ReflectionClass|\ReflectionClassConstant|\ReflectionProperty|\ReflectionFunctionAbstract|\ReflectionParameter */
3131
protected $reflection;
3232

33+
/**
34+
* @param iterable<object> $annotations
35+
*/
3336
public function __construct(iterable $annotations)
3437
{
3538
$this->annotations = $annotations;
3639
}
3740

38-
abstract public function getReflection();
41+
abstract public function getReflection(): \Reflector;
3942

4043
/**
4144
* {@inheritdoc}

0 commit comments

Comments
 (0)