-
-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathphpstan.neon.dist
More file actions
234 lines (226 loc) · 10.3 KB
/
Copy pathphpstan.neon.dist
File metadata and controls
234 lines (226 loc) · 10.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
includes:
- baselines/loader.neon
# - phpstan-baseline.neon
- vendor/spaze/phpstan-disallowed-calls/disallowed-dangerous-calls.neon
- vendor/spaze/phpstan-disallowed-calls/disallowed-execution-calls.neon
- vendor/spaze/phpstan-disallowed-calls/disallowed-insecure-calls.neon
- vendor/spaze/phpstan-disallowed-calls/disallowed-loose-calls.neon
# - vendor/spaze/phpstan-disallowed-calls/extension.neon
# - vendor-bin/larastan/vendor/larastan/larastan/extension.neon
# - vendor/ekino/phpstan-banned-code/extension.neon
# - vendor/ergebnis/phpstan-rules/rules.neon
# - vendor/phpstan/phpstan-strict-rules/rules.neon
# - vendor/roave/no-floaters/rules.neon
# - vendor/shipmonk/dead-code-detector/rules.neon
# - vendor/staabm/phpstan-todo-by/extension.neon
# - vendor/symplify/phpstan-rules/config/code-complexity-rules.neon
# - vendor/symplify/phpstan-rules/config/configurable-rules.neon
# - vendor/symplify/phpstan-rules/config/naming-rules.neon
# - vendor/symplify/phpstan-rules/config/static-rules.neon
- vendor/symplify/phpstan-rules/config/symplify-rules.neon
# - vendor/symplify/phpstan-rules/config/doctrine-rules.neon
- vendor/symplify/phpstan-rules/config/phpunit-rules.neon
# - vendor/symplify/phpstan-rules/config/rector-rules.neon
# - vendor/symplify/phpstan-rules/config/symfony-rules.neon
# - vendor/symplify/phpstan-rules/config/symfony-config-rules.neon
services:
# https://github.com/guanguans/notify/security/code-scanning
# https://github.com/jbelien/phpstan-sarif-formatter
errorFormatter.sarif:
class: PHPStanSarifErrorFormatter\SarifErrorFormatter
arguments:
relativePathHelper: @simpleRelativePathHelper
currentWorkingDirectory: %currentWorkingDirectory%
pretty: true
# errorFormatter.checkstyle:
# class: NickSdot\PhpStanPhpStormErrorIdentifiers\CheckstyleErrorFormatterPhpStorm
errorFormatter.llm:
class: NickSdot\PhpStanPhpStormErrorIdentifiers\LlmErrorFormatter
parameters:
paths:
- src/
scanDirectories:
# - vendor/rector/rector/vendor/symplify/rule-doc-generator-contracts/
scanFiles:
# - vendor/composer/InstalledVersions.php
excludePaths:
- src/Foundation/Rectors/
- src/Foundation/Support/ComposerScripts.php
- tests/Fixtures/
- *.blade.php
tmpDir: .build/phpstan/
phpVersion: 80200
level: max
editorUrl: 'phpstorm://open?file=%%file%%&line=%%line%%'
errorFormat: friendly
friendly:
lineBefore: 3
lineAfter: 3
editorUrl: 'phpstorm://open?file=%%file%%&line=%%line%%'
treatPhpDocTypesAsCertain: false
strictRules:
# https://github.com/phpstan/phpstan-strict-rules
allRules: true
booleansInConditions: false
disallowedShortTernary: false
ergebnis:
guanguans:
exceptionMustImplementNativeThrowable:
nativeThrowable: Guanguans\Notify\Foundation\Contracts\Throwable
# sidzIgnoreNumericStrings: true
sidzIgnoreMagicNumbers: [-1, 0, 1, 2, 10, 16, 100, 512, 0o755, 1000, 1024, 200, 201, 202, 204, 300, 301, 302, 304, 400, 401, 402, 403, 404, 408, 409, 422, 429, 500, 600, 9999999999]
cognitive_complexity:
class: 42
function: 8
dependency_tree: 150
dependency_tree_types:
# # only these explicit types are checked, nothing else
# - Rector\Contract\Rector\RectorInterface
type_coverage:
declare: 100
param: 100
return: 100
constant: 100
property: 100
type_perfect:
narrow_param: true
narrow_return: true
null_over_false: true
no_mixed: false
no_mixed_property: true
no_mixed_caller: false
unused_public:
constants: true
properties: true
methods: true
local_methods: true
template_paths:
# - resources/views/
disallowedFunctionCalls:
-
function: 'env()'
message: 'use config() instead'
-
function: 'env_explode()'
message: 'use config() instead'
ignoreErrors:
# - identifier: argument.templateType
# - identifier: argument.type
# - identifier: arrayFilter.strict
# - identifier: assign.propertyType
# - identifier: binaryOp.invalid
# - identifier: cast.double
# - identifier: cast.int
# - identifier: cast.string
# - identifier: class.extendsFinalByPhpDoc
# - identifier: disallowed.function
# - identifier: empty.notAllowed
# - identifier: encapsedStringPart.nonString
# - identifier: ergebnis.final
# - identifier: ergebnis.finalInAbstractClass
# - identifier: ergebnis.noAssignByReference
# - identifier: ergebnis.noConstructorParameterWithDefaultValue
# - identifier: ergebnis.noExtends
# - identifier: ergebnis.noIsset
# - identifier: ergebnis.noNamedArgument
# - identifier: ergebnis.noNullableReturnTypeDeclaration
# - identifier: ergebnis.noParameterPassedByReference
# - identifier: ergebnis.noParameterWithNullableTypeDeclaration
# - identifier: ergebnis.noParameterWithNullDefaultValue
# - identifier: foreach.valueOverwrite
# - identifier: guanguans.forbiddenSideEffects
# - identifier: logicalAnd.resultUnused
# - identifier: logicalOr.resultUnused
# - identifier: method.childParameterType
# - identifier: method.dynamicName
# - identifier: missingType.generics
# - identifier: missingType.iterableValue
# - identifier: new.static
# - identifier: offsetAccess.nonOffsetAccessible
# - identifier: offsetAccess.notFound
# - identifier: paramOut.type
# - identifier: phpstanApi.class
# - identifier: return.type
# - identifier: return.void
# - identifier: shipmonk.binaryOperationWithNull
# - identifier: shipmonk.checkedExceptionInCallable
# - identifier: shipmonk.forbiddenCast
# - identifier: shipmonk.iteratorToArrayWithoutPreserveKeys
# - identifier: shipmonk.nonNormalizedType
# - identifier: shipmonk.variableTypeOverwritten
# - identifier: symplify.explicitInterfaceSuffixName
# - identifier: symplify.explicitTraitSuffixName
# - identifier: symplify.forbiddenArrayMethodCall
# - identifier: symplify.forbiddenExtendOfNonAbstractClass
# - identifier: symplify.forbiddenFuncCall
# - identifier: symplify.forbiddenNode
# - identifier: symplify.forbiddenStaticClassConstFetch
# - identifier: symplify.noArrayMapWithArrayCallable
# - identifier: symplify.noDynamicName
# - identifier: symplify.noGlobalConst
# - identifier: symplify.noReference
# - identifier: symplify.noReturnSetterMethod
# - identifier: symplify.requireExceptionNamespace
# - identifier: trait.unused
# - identifier: typePerfect.noMixedMethodCaller
# - message: '#^Unused Guanguans\\Notify\\Rector\\.*\\.*\:\:__construct$#'
- identifier: ergebnis.final
- identifier: ergebnis.finalInAbstractClass
- identifier: ergebnis.noAssignByReference
- identifier: ergebnis.noConstructorParameterWithDefaultValue
- identifier: ergebnis.noExtends
- identifier: ergebnis.noIsset
- identifier: ergebnis.noNamedArgument
- identifier: ergebnis.noNullableReturnTypeDeclaration
- identifier: ergebnis.noParameterPassedByReference
- identifier: ergebnis.noParameterWithNullableTypeDeclaration
- identifier: ergebnis.noParameterWithNullDefaultValue
- identifier: shipmonk.binaryOperationWithNull
- identifier: shipmonk.checkedExceptionInCallable
- identifier: shipmonk.checkedExceptionInYieldingMethod
- identifier: shipmonk.forbiddenCast
- identifier: shipmonk.iteratorToArrayWithoutPreserveKeys
- identifier: shipmonk.nonNormalizedType
- identifier: shipmonk.variableTypeOverwritten
- identifier: symplify.explicitInterfaceSuffixName
- identifier: symplify.explicitTraitSuffixName
- identifier: symplify.forbiddenExtendOfNonAbstractClass
- identifier: symplify.forbiddenFuncCall
- identifier: symplify.forbiddenNode
- identifier: symplify.forbiddenStaticClassConstFetch
- identifier: symplify.noDynamicName
- identifier: symplify.noGlobalConst
- identifier: symplify.noReference
- identifier: symplify.noReturnSetterMethod
- identifier: symplify.requireExceptionNamespace
- identifier: argument.type
- identifier: arrayFilter.strict
- identifier: cast.int
- identifier: disallowed.function
- identifier: encapsedStringPart.nonString
- identifier: foreach.valueOverwrite
- identifier: guanguans.forbiddenSideEffects
- identifier: logicalAnd.resultUnused
- identifier: method.childParameterType
- identifier: method.dynamicName
- identifier: return.type
- identifier: trait.unused
- message: '#^Class Guanguans\\Notify\\.*\\Messages\\.*Message has PHPDoc tag @method for method .*\(\) parameter \#1 \$.* with no value type specified in iterable type array\.$#'
- message: '#^Cognitive complexity for "Guanguans\\Notify\\Foundation\\Support\\Arr\:\:forget\(\)" is (\d|1\d), keep it under 8$#'
- message: '#^Cognitive complexity for "Guanguans\\Notify\\Foundation\\Support\\Arr\:\:get\(\)" is (\d|1\d), keep it under 8$#'
- message: '#^Cognitive complexity for "Guanguans\\Notify\\Foundation\\Support\\Utils\:\:multipartFor\(\)" is (\d|1\d), keep it under 8$#'
- message: '#^Trait Guanguans\\Notify\\Foundation\\Concerns\\HasHttpClient has PHPDoc tag @method for method .*\(\) parameter \#1 \$.* with no value type specified in iterable type array\.$#'
-
identifier: symplify.explicitAbstractPrefixName
path: src/Foundation/Message.php
-
identifier: paramOut.type
path: src/Foundation/Support/Arr.php
-
identifier: shipmonk.deadMethod
path: src/Foundation/Concerns/
-
identifier: offsetAccess.nonOffsetAccessible
paths:
- src/*/Messages/*Message.php
- src/Foundation/Support/Arr.php