-
Notifications
You must be signed in to change notification settings - Fork 91
/
Copy pathphpstan.neon
69 lines (52 loc) · 2.35 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
parameters:
level: 8
reportUnmatchedIgnoredErrors: false
treatPhpDocTypesAsCertain: false
paths:
- config
- src
- tests
- rules
- rules-tests
# to be enabled later once rector upgraded to use phpstan v2
# # https://github.com/rectorphp/type-perfect/
# type_perfect:
# no_mixed: true
# null_over_false: true
# narrow_param: true
# narrow_return: true
# unused_public:
# constants: true
# methods: true
# properties: true
scanDirectories:
- stubs
excludePaths:
- */Source/*
- */Fixture/*
- */Fixture*/*
ignoreErrors:
# pointless check
- '#expects class-string, string given#'
- '#Calling PHPStan\\Reflection\\Php\\PhpParameterReflection\:\:getName\(\) is not covered by backward compatibility promise\. The method might change in a minor PHPStan version#'
# false positive
- '#Access to an undefined property Rector\\Core\\Contract\\PhpParser\\Node\\StmtsAwareInterface\:\:\$stmts#'
- '#but class PhpParser\\Node\\Stmt\\Expression is not generic#'
- '#Access to an undefined property Rector\\Contract\\PhpParser\\Node\\StmtsAwareInterface\:\:\$stmts#'
# false positive
- '#Parameters should have "PhpParser\\Node\\Expr\\Closure" types as the only types passed to this method#'
- '#Parameter 1 should use "PHPStan\\BetterReflection\\Reflection\\Adapter\\ReflectionMethod" type as the only type passed to this method#'
- '#Parameter \#1 \$stmtsAware of method Rector\\NodeAnalyzer\\TerminatedNodeAnalyzer\:\:isAlwaysTerminated\(\) expects Rector\\Contract\\PhpParser\\Node\\StmtsAwareInterface, PhpParser\\Node\\Stmt\\ClassMethod given#'
# 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
-
identifier: assign.propertyType
- '#::provideMinPhpVersion\(\) never returns \d+ so it can be removed from the return type#'