-
Notifications
You must be signed in to change notification settings - Fork 13
/
phpstan.neon
76 lines (56 loc) · 2.85 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
67
68
69
70
71
72
73
74
75
76
# 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#'
# part of implicit contract
- '#Call to an undefined method PHPStan\\Type\\ConstantType\:\:getValue\(\)#'
- '#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#'
-
message: '#Use value object over return of values#'
path: rules/DowngradePhp80/Rector/Expression/DowngradeThrowExprRector.php
# phpstan need to load rector nodes first to avoid this
- '#Rector\\Core\\Contract\\PhpParser\\Node\\StmtsAwareInterface#'
- '#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#'