-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathphpstan.neon
More file actions
78 lines (58 loc) · 3 KB
/
phpstan.neon
File metadata and controls
78 lines (58 loc) · 3 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
# to be enabled later once rector upgraded to use phpstan v2
# includes:
# - vendor/symplify/phpstan-rules/config/symplify-rules.neon
# - vendor/symplify/phpstan-rules/config/rector-rules.neon
parameters:
level: 8
reportUnmatchedIgnoredErrors: false
# requires exact closure types
checkMissingCallableSignature: true
treatPhpDocTypesAsCertain: false
paths:
- src
- config
- rules
- tests
- rules-tests
excludePaths:
# tests files
- "*/Expected/*"
- '*/Fixture/*'
- '*/Source/*'
# see https://github.com/rectorphp/type-perfect/
# to be enabled later once rector upgraded to use phpstan v2
# type_perfect:
# no_mixed: true
# null_over_false: true
# narrow_param: true
# narrow_return: true
ignoreErrors:
# php enum value minus
- '#Parameter \#1 \$phpVersion of method Rector\\Config\\RectorConfig\:\:phpVersion\(\) expects (.*?), (.*?) given#'
- '#Calling PHPStan\\Reflection\\Native\\NativeFunctionReflection\:\:getName\(\) is not covered by backward compatibility promise\. The method might change in a minor PHPStan version#'
- '#Parameter \#3 \$stmt of method Rector\\DowngradePhp72\\Rector\\FuncCall\\DowngradePregUnmatchedAsNullConstantRector\:\:processReplace\(\) expects PhpParser\\Node\\Stmt, PhpParser\\Node given#'
- '#(.*?)\:\:refactor\(\) should return array<PhpParser\\Node\\Stmt>\|PhpParser\\Node\\Stmt\\ClassConst\|null but returns array<PhpParser\\Node\\Stmt>\|PhpParser\\Node\\Stmt\|null#'
# phpstan need to load rector nodes first to avoid this
- '#Access to an undefined property Rector\\Contract\\PhpParser\\Node\\StmtsAwareInterface\:\:\$stmts#'
-
message: '#Parameter \#1 \$attributeClass of class Rector\\DowngradePhp80\\ValueObject\\DowngradeAttributeToAnnotation constructor expects class\-string, string given#'
path: "config/*"
# more advanced usage, but not always working
# see https://github.com/rectorphp/rector-src/actions/runs/11798721617/job/32865546672?pr=6422#step:5:110
- '#Doing instanceof PHPStan\\Type\\.+ is error\-prone and deprecated#'
# phpstan instanceof
-
identifier: phpstanApi.instanceofAssumption
-
identifier: phpstanApi.varTagAssumption
-
identifier: argument.type
- '#Asking about instanceof PHPStan\\.* is not covered by backward compatibility promise#'
- '#Method Rector\\(.*?)\\Rector\\FuncCall\\(.*?)::refactor\(\) never returns \d so it can be removed from the return type#'
# false positive intanceof in OR usage
-
identifier: instanceof.alwaysTrue
path: rules/DowngradePhp80/Rector/NullsafeMethodCall/DowngradeNullsafeToTernaryOperatorRector.php
-
identifier: deadCode.unreachable
path: rules/DowngradePhp80/Rector/NullsafeMethodCall/DowngradeNullsafeToTernaryOperatorRector.php