-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathphpstan.neon
More file actions
87 lines (67 loc) · 3.5 KB
/
phpstan.neon
File metadata and controls
87 lines (67 loc) · 3.5 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
includes:
- vendor/symplify/phpstan-rules/config/symplify-rules.neon
- vendor/symplify/phpstan-rules/config/rector-rules.neon
parameters:
level: 8
errorFormat: symplify
# see https://phpstan.org/writing-php-code/phpdoc-types#global-type-aliases
typeAliases:
StmtsAware: \PhpParser\Node\Stmt\Block | \PhpParser\Node\Expr\Closure | \PhpParser\Node\Stmt\Case_ | \PhpParser\Node\Stmt\Catch_ | \PhpParser\Node\Stmt\ClassMethod | \PhpParser\Node\Stmt\Do_ | \PhpParser\Node\Stmt\Else_ | \PhpParser\Node\Stmt\ElseIf_ | \PhpParser\Node\Stmt\Finally_ | \PhpParser\Node\Stmt\For_ | \PhpParser\Node\Stmt\Foreach_ | \PhpParser\Node\Stmt\Function_ | \PhpParser\Node\Stmt\If_ | \PhpParser\Node\Stmt\Namespace_ | \PhpParser\Node\Stmt\TryCatch | \PhpParser\Node\Stmt\While_ | \Rector\PhpParser\Node\FileNode
treatPhpDocTypesAsCertain: false
paths:
- config
- src
- tests
- rules
- rules-tests
scanDirectories:
- stubs
excludePaths:
- */Source/*
- *Source/*
- */Fixture/*
# see https://github.com/rectorphp/type-perfect/
type_perfect:
no_mixed: true
null_over_false: true
narrow_param: true
narrow_return: true
ignoreErrors:
# false positive
- '#Parameter \#1 \$tag of method Rector\\BetterPhpDocParser\\PhpDocParser\\ClassAnnotationMatcher\:\:resolveTagFullyQualifiedName\(\) expects string, string\|null given#'
-
message: '#Parameter \#1 \$phpVersion of method Rector\\Config\\RectorConfig\:\:phpVersion\(\) expects (.*?), \d+ given#'
paths:
- tests/Set/*/config/configured_set.php
# false positive
-
message: '#PHPDoc tag @return contains unresolvable type#'
path: rules/CodeQuality/Contract/PropertyAttributeTransformerInterface.php
# needed for instanceof method API
- '#Doing instanceof PHPStan\\Type\\ObjectType is error\-prone and deprecated\. Use Type\:\:isObject\(\) or Type\:\:getObjectClassNames\(\) instead#'
- '#Doing instanceof PHPStan\\Type\\(Generic\\GenericObjectType|ArrayType) is error\-prone and deprecated#'
# debug function
- '#Function "d\(\)" cannot be used/left in the code#'
-
message: '#Parameter (.*?) \$desiredClass of method Rector\\BetterPhpDocParser\\PhpDocInfo\\PhpDocInfo::findByAnnotationClass\(\) expects class-string, string given#'
path: src/NodeAnalyzer/AttrinationFinder.php
# useful and more reliable than issers
- identifier: phpstanApi.instanceofType
-
message: '#Calling PHPStan\\Reflection\\Php\\PhpParameterReflection::getType\(\)#'
identifier: phpstanApi.method
- identifier: phpstanApi.class
-
path: rules/TypedCollections/DocBlockProcessor/UnionCollectionTagValueNodeNarrower.php
identifier: assign.propertyType
-
path: rules/TypedCollections/DocBlockProcessor/UnionCollectionTagValueNodeNarrower.php
identifier: property.notFound
-
message: '#Function "property_exists\(\)" cannot be used/left in the code#'
path: rules/Orm30/Rector/MethodCall/SetParametersArrayToCollectionRector.php
# stmts aware interface
# - '#Access to an undefined property Rector\\Contract\\PhpParser\\Node\\StmtsAwareInterface::\$stmts#'
-
path: tests/debug_functions.php
message: '#Function "function_exists\(\)"#'