forked from symplify/phpstan-rules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphpstan.neon
66 lines (47 loc) · 4.03 KB
/
phpstan.neon
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
parameters:
level: 8
paths:
- src
- config
- tests
reportUnmatchedIgnoredErrors: false
excludePaths:
# parallel
- packages/*-phpstan-printer/tests/*ToPhpCompiler/Fixture*
# PHP 8 only
- tests/Rules/ForbiddenArrayWithStringKeysRule/FixturePhp80/SkipAttributeArrayKey.php
# tests
- '*/tests/**/Source/*'
- '*/tests/**/Fixture/*'
- */stubs/*
- */packages-tests/**/Fixture/*
- */packages-tests/**/Source/*
ignoreErrors:
-
message: '#Generator expects value type array<int, array<int, int\|string>\|string>, array<int, array<int, array<int, int\|string>>\|string> given#'
paths:
- tests/Rules
-
message: '#Generator expects value type array<array<int\|string>\|string>, array<int, array<int, array<int, int\|string>>\|string> given#'
paths:
- tests/Rules
# needless generics
- '#Class Symplify\\PHPStanRules\\(.*?)Rule implements generic interface PHPStan\\Rules\\Rule but does not specify its types\: TNodeType#'
- '#Method (.*?)::getCollectors\(\) return type with generic interface PHPStan\\Collectors\\Collector does not specify its types\: TNodeType, TValue#'
# child type
- '#Parameter \#1 \$node of method Symplify\\PHPStanRules\\Rules\\ForbiddenSpreadOperatorRule\:\:hasVariadicParam\(\) expects PhpParser\\Node\\Expr\\ArrowFunction\|PhpParser\\Node\\Expr\\Closure\|PhpParser\\Node\\Stmt\\ClassMethod\|PhpParser\\Node\\Stmt\\Function_, PhpParser\\Node\\Expr\\ArrowFunction\|PhpParser\\Node\\Expr\\Closure\|\(PhpParser\\Node\\Expr\\FuncCall&PhpParser\\Node\\FunctionLike\)\|\(PhpParser\\Node\\Expr\\MethodCall&PhpParser\\Node\\FunctionLike\)\|\(PhpParser\\Node\\Expr\\StaticCall&PhpParser\\Node\\FunctionLike\)\|PhpParser\\Node\\Stmt\\ClassMethod\|PhpParser\\Node\\Stmt\\Function_ given#'
# invalid PHPStan type - it alwasy requires 2 types to traverse with callable
-
message: '#Callable callable\(PHPStan\\Type\\Type\)\: PHPStan\\Type\\Type invoked with 2 parameters, 1 required#'
path: src/Rules/Explicit/NoMixedCallableRule.php
- '#Parameter \#1 \$values of method Symplify\\PHPStanRules\\Rules\\Enum\\RequireUniqueEnumConstantRule\:\:filterDuplicatedValues\(\) expects array<int\|string>, array<bool\|float\|int\|string> given#'
- '#Class PHP_CodeSniffer\\Sniffs\\Sniff not found#'
- '#Method Symplify\\PHPStanRules\\Rules\\Domain\\NoDuplicatedRegexRule\:\:groupConstantsBySharedValue\(\) should return array<string, array<Symplify\\PHPStanRules\\ValueObject\\ClassConstRegexMetadata>> but returns array<int\|string, array<int, Symplify\\PHPStanRules\\ValueObject\\ClassConstRegexMetadata>>#'
- '#Method Symplify\\PHPStanRules\\Reflection\\ReflectionParser\:\:parseNativeClassReflection\(\) has parameter \$reflectionClass with generic class ReflectionClass but does not specify its types\: T#'
- '#Method Symplify\\PHPStanRules\\NodeFinder\\TypeAwareNodeFinder\:\:findInstanceOf\(\) should return array<TNode of PhpParser\\Node> but returns array<PhpParser\\Node>#'
- '#Method Symplify\\PHPStanRules\\NodeFinder\\TypeAwareNodeFinder\:\:findFirstInstanceOf\(\) should return \(TNode of PhpParser\\Node\)\|null but returns PhpParser\\Node\|null#'
- '#Method Symplify\\PHPStanRules\\NodeFinder\\MethodCallNodeFinder\:\:findUsages\(\) should return array<PhpParser\\Node\\Expr\\MethodCall> but returns array<PhpParser\\Node>#'
- '#Parameter \#3 \$types of method Symplify\\PHPStanRules\\Matcher\\ObjectTypeMatcher\:\:isExprTypes\(\) expects array<class\-string>, array<string> given#'
# overly detailed
- '#Class Symplify\\PHPStanRules\\Tests\\Rules\\(.*?) extends generic class PHPStan\\Testing\\RuleTestCase but does not specify its types\: TRule#'
- '#Method Symplify\\PHPStanRules\\Tests\\Rules\\(.*?)\:\:getRule\(\) return type with generic interface PHPStan\\Rules\\Rule does not specify its types\: TNodeType#'