forked from hyperf/hyperf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpstan.neon
93 lines (79 loc) · 2.92 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Magic behaviour with __get, __set, __call and __callStatic is not exactly static analyser-friendly :)
# Fortunately, You can ingore it by the following config.
#
rules:
- PHPStan\Rules\Arrays\DeadForeachRule
- PHPStan\Rules\Comparison\BooleanOrConstantConditionRule
- PHPStan\Rules\Comparison\ElseIfConstantConditionRule
- PHPStan\Rules\Comparison\IfConstantConditionRule
- PHPStan\Rules\Comparison\TernaryOperatorConstantConditionRule
parameters:
bootstrap: "bootstrap.php"
checkFunctionArgumentTypes: true
checkArgumentsPassedByReference: true
reportUnmatchedIgnoredErrors: false
featureToggles:
deadCatchesRule: false
noopRule: false
tooWideTypehints: false
unreachableStatement: false
ignoreErrors:
- "#will always evaluate to false#"
excludes_analyse:
- %currentWorkingDirectory%/src/*/tests/*
conditionalTags:
PHPStan\Rules\Exceptions\DeadCatchRule:
phpstan.rules.rule: %featureToggles.deadCatchesRule%
PHPStan\Rules\DeadCode\NoopRule:
phpstan.rules.rule: %featureToggles.noopRule%
PHPStan\Rules\DeadCode\UnreachableStatementRule:
phpstan.rules.rule: %featureToggles.unreachableStatement%
PHPStan\Rules\TooWideTypehints\TooWideClosureReturnTypehintRule:
phpstan.rules.rule: %featureToggles.tooWideTypehints%
PHPStan\Rules\TooWideTypehints\TooWideFunctionReturnTypehintRule:
phpstan.rules.rule: %featureToggles.tooWideTypehints%
PHPStan\Rules\TooWideTypehints\TooWidePrivateMethodReturnTypehintRule:
phpstan.rules.rule: %featureToggles.tooWideTypehints%
services:
-
class: PHPStan\Rules\Classes\ImpossibleInstanceOfRule
arguments:
checkAlwaysTrueInstanceof: %checkAlwaysTrueInstanceof%
tags:
- phpstan.rules.rule
-
class: PHPStan\Rules\Comparison\ImpossibleCheckTypeFunctionCallRule
arguments:
checkAlwaysTrueCheckTypeFunctionCall: %checkAlwaysTrueCheckTypeFunctionCall%
tags:
- phpstan.rules.rule
-
class: PHPStan\Rules\Comparison\ImpossibleCheckTypeMethodCallRule
arguments:
checkAlwaysTrueCheckTypeFunctionCall: %checkAlwaysTrueCheckTypeFunctionCall%
tags:
- phpstan.rules.rule
-
class: PHPStan\Rules\Comparison\ImpossibleCheckTypeStaticMethodCallRule
arguments:
checkAlwaysTrueCheckTypeFunctionCall: %checkAlwaysTrueCheckTypeFunctionCall%
tags:
- phpstan.rules.rule
-
class: PHPStan\Rules\Comparison\StrictComparisonOfDifferentTypesRule
arguments:
checkAlwaysTrueStrictComparison: %checkAlwaysTrueStrictComparison%
tags:
- phpstan.rules.rule
-
class: PHPStan\Rules\Exceptions\DeadCatchRule
-
class: PHPStan\Rules\DeadCode\NoopRule
-
class: PHPStan\Rules\DeadCode\UnreachableStatementRule
-
class: PHPStan\Rules\TooWideTypehints\TooWideClosureReturnTypehintRule
-
class: PHPStan\Rules\TooWideTypehints\TooWideFunctionReturnTypehintRule
-
class: PHPStan\Rules\TooWideTypehints\TooWidePrivateMethodReturnTypehintRule