forked from deprecated-packages/symplify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphpstan.neon
511 lines (401 loc) · 25.1 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
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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
conditionalTags:
PhpParser\NodeVisitor\NodeConnectingVisitor:
phpstan.parser.richParserNodeVisitor: true
includes:
- packages/astral/config/services.neon
- packages/phpstan-extensions/config/config.neon
- packages/phpstan-rules/config/symplify-rules.neon
# for cognitive rules
- packages/phpstan-rules/packages/cognitive-complexity/config/cognitive-complexity-services.neon
- packages/phpstan-rules/config/services/services.neon
- packages/phpstan-rules/packages/symfony/config/services.neon
- packages/phpstan-rules/packages/nette/config/services.neon
services:
# cognitive complexity
-
class: Symplify\PHPStanRules\CognitiveComplexity\Rules\FunctionLikeCognitiveComplexityRule
tags: [phpstan.rules.rule]
arguments:
maxMethodCognitiveComplexity: 8
-
class: Symplify\PHPStanRules\CognitiveComplexity\Rules\ClassLikeCognitiveComplexityRule
tags: [phpstan.rules.rule]
arguments:
maxClassCognitiveComplexity: 25
limitsByTypes:
PHPStan\Rules\Rule: 16
Symplify\CodingStandard\Fixer\AbstractSymplifyFixer: 16
parameters:
level: 8
reportUnmatchedIgnoredErrors: false
# requires exact closure types
checkMissingCallableSignature: true
parallel:
# to prevent full thread lagging pc
maximumNumberOfProcesses: 15
paths:
- packages
- ecs.php
- rector.php
excludePaths:
- */scoper.php
- *scoper.inc.php
# parallel
- packages/phpstan-rules/packages/*-phpstan-printer/tests/*ToPhpCompiler/Fixture*
- packages/*-phpstan-compiler/tests/*ToPhpCompiler/Fixture*
# class aliasing for old PHPUnit test case
- packages/easy-ci/packages/Testing/Autoloading/DualTestCaseAuloader.php
- packages/easy-ci/packages-tests/Testing/UnitTestFilePathsFinder/UnitTestFilePathsFinderTest.php
- packages/easy-coding-standard/build/target-repository/bootstrap.php
# there is some bug
- packages/package-builder/src/Testing/AbstractKernelTestCase.php
- packages/package-builder/src/Console/Command/AbstractSymplifyCommand.php
# PHP 8 only
- packages/phpstan-rules/tests/Rules/ForbiddenArrayWithStringKeysRule/FixturePhp80/SkipAttributeArrayKey.php
- packages/autowire-array-parameter/tests/SourcePhp8/PromotedPropertyCollector.php
- packages/autowire-array-parameter/tests/DependencyInjection/CompilerPass/Php8Test.php
- packages/phpstan-rules/tests/Rules/NoParentMethodCallOnEmptyStatementInParentMethodRule/FixturePhp80/SkipPromotedParentProperty.php
# functions false positive
- */Vendor/*
- *packages/**/tests/**/config.php
- *packages/**/tests/**-config.php
- *packages/monorepo-builder/templates/*
- *packages/coding-standard/tests/**/correct*
- *packages/coding-standard/tests/**/wrong*
- *packages/coding-standard/tests/**/Wrong*
- *packages/phpstan-extensions/**/Source/**
# tests
- packages/symfony-static-dumper/tests/test_project/
- packages/phpstan-extensions/tests/TypeExtension/*/*/data/*
# 3rd party
- packages/package-builder/src/Yaml/ParametersMerger.php
# tests
- packages/phpstan-extensions/tests/Rules/ClassMethod/Source/*
- '*/tests/Source/*'
- '*/tests/**/Source/*'
- '*/tests/**/Fixture/*'
- '*/tests/**/Fixture*/*'
- */vendor/*
- */stubs/*
- */packages-tests/**/Fixture/*
- */packages-tests/**/Source/*
- */tests/Fixture/*
- packages/vendor-patches/tests/Finder/VendorFilesFinderSource/Vendor/some/package/src/PackageClass.php
- packages/phpstan-rules/tests/Rules/AllowedExclusiveDependencyRule/FixturePhp74/*
bootstrapFiles:
- tests/bootstrap.php
ignoreErrors:
# invalid 3rd party-code
- '#Parameter \#1 \$index of method PhpCsFixer\\Tokenizer\\Tokens::getNextTokenOfKind\(\) expects int, int\|null given#'
# required for autowiring, since only interface is autowired
- '#Call to an undefined method Symfony\\Component\\DependencyInjection\\ContainerInterface::getParameterBag\(\)#'
# phpstan 0.10 news
- '#Parameter \#1 \$path of function dirname expects string, string\|false given#'
# Symfony 4.2 typehint BC-break
- '#Parameter \#1 \$command of class Symfony\\Component\\Process\\Process constructor expects array, array<string>\|string given#'
- '#Access to an undefined property PhpParser\\Node\\Expr\\Error(.*?)#'
- '#Cannot call method (.*?) on PhpCsFixer\\Tokenizer\\Token\|null#'
- '#Parameter \#1 \$endPath of method Symfony\\Component\\Filesystem\\Filesystem\:\:makePathRelative\(\) expects string, string\|false given#'
-
message: '#Array with keys is not allowed\. Use value object to pass data instead#'
paths:
- packages/php-config-printer/src/Printer/SmartPhpConfigPrinter.php
-
message: '#Use value object over return of values#'
paths:
# Symfony API
- packages/easy-coding-standard/src/Console/Output/JsonOutputFormatter.php
-
message: '#Instead of "SplFileInfo" class/interface use "Symplify\\SmartFileSystem\\SmartFileInfo"#'
paths:
- packages/smart-file-system/src/Finder/FinderSanitizer.php
- packages/smart-file-system/tests/Finder/FinderSanitizer/FinderSanitizerTest.php
-
message: '#Do not use static property#'
paths:
- packages/easy-testing/src/StaticFixtureSplitter.php # 19
-
message: '#Do not use trait#'
paths:
- packages/easy-testing/src/PHPUnit/Behavior/DirectoryAssertableTrait.php # 18
-
message: '#Do not call parent method if parent method is empty#'
paths:
- packages/smart-file-system/src/SmartFileInfo.php # 122
-
message: '#Use explicit return value over magic &reference#'
paths:
- packages/package-builder/src/Reflection/PrivatesCaller.php # 40
- packages/astral/src/PhpDocParser/PhpDocNodeTraverser.php
-
message: '#Do not use factory/method call in constructor\. Put factory in config and get service with dependency injection#'
paths:
- packages/package-builder/src/Parameter/ParameterProvider.php # 26
- packages/phpstan-rules/src/Rules/CheckClassNamespaceFollowPsr4Rule.php #31
# exceptions to get file
-
message: '#Function "file_get_contents\(\)" cannot be used/left in the code\: Use Symplify\\SmartFileSystem\\SmartFileSystem\:\:readFile\(\) instead#'
paths:
- packages/easy-parallel/src/CpuCoreCountProvider.php
- packages/smart-file-system/src/SmartFileSystem.php
# child type
- '#Parameter \#1 \$node of method Symplify\\PHPStanRules\\Rules\\ForbiddenSpreadOperatorRule\:\:hasVariadicParam\(\) expects PhpParser\\Node\\Expr\\ArrowFunction\|PhpParser\\Node\\Expr\\Closure\|PhpParser\\Node\\Stmt\\ClassMethod\|PhpParser\\Node\\Stmt\\Function_, PhpParser\\Node\\Expr\\ArrowFunction\|PhpParser\\Node\\Expr\\Closure\|\(PhpParser\\Node\\Expr\\FuncCall&PhpParser\\Node\\FunctionLike\)\|\(PhpParser\\Node\\Expr\\MethodCall&PhpParser\\Node\\FunctionLike\)\|\(PhpParser\\Node\\Expr\\StaticCall&PhpParser\\Node\\FunctionLike\)\|PhpParser\\Node\\Stmt\\ClassMethod\|PhpParser\\Node\\Stmt\\Function_ given#'
-
message: '#Use another value object over array with string\-keys and objects, array<string, ValueObject\>#'
paths:
- packages/easy-testing/src/PHPUnit/Behavior/DirectoryAssertableTrait.php # 91
# nesting
- '#Parameter \#1 \$items of class PhpParser\\Node\\Expr\\Array_ constructor expects array<PhpParser\\Node\\Expr\\ArrayItem\|null\>, array<PhpParser\\Node\\Arg\> given#'
# skipped tests
- '#Method Symplify\\Skipper\\SkipCriteriaResolver\\SkippedClassAndCodesResolver\:\:resolve\(\) should return array<string, array<string\>\|null\> but returns array<int\|string, mixed\>#'
-
message: '#Array destruct is not allowed\. Use value object to pass data instead#'
path: 'packages/smart-file-system/src/Normalizer/PathNormalizer.php'
- '#Parameter (.*?) class ReflectionClass constructor expects class\-string<T of object\>\|T of object, string given#'
-
message: '#Function "method_exists\(\)" cannot be used/left in the code#'
paths:
- packages/monorepo-builder/packages/Release/Process/ProcessRunner.php
# PHPUnit 9/10 compat
- packages/symfony-static-dumper/tests/FileSystem/AssetsCopierTest.php
# existing method call validator
- packages/easy-ci/src/Latte/LatteTemplateAnalyzer/MissingClassStaticCallLatteAnalyzer.php
# look for parent method
- packages/phpstan-rules/src/Rules/PreventParentMethodVisibilityOverrideRule.php
-
message: '#Function "property_exists\(\)" cannot be used/left in the code#'
paths:
- packages/astral/src/NodeNameResolver/ClassLikeNodeNameResolver.php
# PHP compat
- packages/package-builder/src/Reflection/PrivatesAccessor.php
- '#Method Symplify\\PHPStanRules\\NodeFinder\\MethodCallNodeFinder\:\:findUsages\(\) should return array<PhpParser\\Node\\Expr\\MethodCall\> but returns array<PhpParser\\Node\>#'
# manually constructored for Symfony compiler pass, before DI is created
- '#Method Symplify\\PHPStanRules\\NodeFinder\\MethodCallNodeFinder\:\:findByName\(\) should return array<PhpParser\\Node\\Expr\\MethodCall\> but returns array<PhpParser\\Node\>#'
# false positive - lost type on array-merge
- '#Property Symplify\\PHPStanRules\\ObjectCalisthenics\\Rules\\NoChainMethodCallRule\:\:\$allowedChainTypes \(array<class\-string\>\) does not accept array<string\>#'
# required complexity, as get/set methods for API of composer.json
- '#Cognitive complexity for "Symplify\\ComposerJsonManipulator\\ComposerJsonFactory\:\:createFromArray\(\)" is \d+, keep it under 8#'
- '#\$this as argument is not allowed\. Refactor method to service composition#'
-
message: '#Class cognitive complexity is \d+, keep it under 25#'
paths:
- packages/git-wrapper/src/GitWorkingCopy.php
# traversing is complex operatoin
- packages/astral/src/PhpDocParser/PhpDocNodeTraverser.php
- packages/php-config-printer/src/NodeFactory/ArgsNodeFactory.php
-
message: '#Do not use factory/method call in constructor\. Put factory in config and get service with dependency injection#'
paths:
# manually created value objects mostly
- packages/git-wrapper/src/*
-
message: '#Spread operator is not allowed#'
paths:
- packages/git-wrapper/src
- '#Method "needsMerge\(\)" returns bool type, so the name should start with is/has/was#'
-
message: '#Use value object over multi array assign#'
paths:
- packages/git-wrapper/src/GitWorkingCopy.php
-
message: '#Array with keys is not allowed\. Use value object to pass data instead#'
paths:
- packages/git-wrapper/src/GitWorkingCopy.php
- packages/git-wrapper/src/EventSubscriber/GitLoggerEventSubscriber.php
-
message: '#Array with keys is not allowed\. Use value object to pass data instead#'
paths:
- packages/git-wrapper/src/GitBranches.php
-
message: '#Use explicit names over dynamic ones#'
paths:
- packages/git-wrapper/src/EventSubscriber/GitLoggerEventSubscriber.php
- '#Method Symplify\\PHPStanRules\\Rules\\RequireStringRegexMatchKeyRule\:\:findVariableArrayDimFetches\(\) should return array<PhpParser\\Node\\Expr\\ArrayDimFetch\> but returns array<PhpParser\\Node\>#'
- '#Method Symplify\\EasyTesting\\DataProvider\\StaticFixtureFinder\:\:yieldDirectoryExclusively\(\) should return Iterator<mixed, Symplify\\SmartFileSystem\\SmartFileInfo\> but returns Iterator<mixed, array<int, Symplify\\SmartFileSystem\\SmartFileInfo\>\>#'
# xml magic
-
message: '#Unreachable statement \- code above always terminates#'
paths:
- packages/easy-coding-standard/bin/ecs.php
# wrong keys
- '#Generator expects value type array<array<int\|string\>\|string\>, array<int, array<int, array<int, int\|string\>\>\|string\> given#'
-
message: '#Generator expects value type (.*?), array<int, array<int, array<int, int\|string\>\>\|string\> given#'
paths:
- packages/phpstan-rules/tests/Rules
-
message: '#Do not compare call directly, use a variable assign#'
paths:
- packages/easy-ci/src/Git/ConflictResolver.php
# known types
- '#Method Symplify\\Astral\\NodeFinder\\SimpleNodeFinder\:\:findByType\(\) should return array<T of PhpParser\\Node\> but returns array<PhpParser\\Node\>#'
# node finder generics meshup
- '#Method Symplify\\Astral\\NodeFinder\\SimpleNodeFinder\:\:findFirstByType\(\) should return T of PhpParser\\Node\|null but returns PhpParser\\Node\|null#'
-
message: '#Use void instead of modify and return self object#'
path: packages/astral/src/PhpDocParser/PhpDocNodeTraverser.php
-
message: '#Use explicit names over dynamic ones#'
path: packages/astral/src/PhpDocParser/PhpDocNodeTraverser.php
-
message: '#Use separate function calls with readable variable names#'
path: packages/astral/src/PhpDocParser/PhpDocNodeTraverser.php
- '#\$reflectionClass with generic class ReflectionClass but does not specify its types\: T#'
# some bug
- '#Method Symplify\\PHPStanRules\\Tests\\Rules\\ForbiddenNodeRule\\ForbiddenNodeRuleTest\:\:getRule\(\) return type with generic class Symplify\\PHPStanRules\\Rules\\ForbiddenNodeRule does not specify its types\: T#'
-
message: '#Use local named constant instead of inline string for regex to explain meaning by constant name#'
path: packages/easy-coding-standard/scoper.php
-
message: '#Instead of "DateTime" class/interface use "Nette\\Utils\\DateTime"#'
path: packages/easy-coding-standard/scoper.php
- '#Method "processTokensByFixer\(\)" returns bool type, so the name should start with is/has/was#'
-
message: '#Class cognitive complexity is \d+, keep it under 25#'
path: packages/php-config-printer/src/PhpParser/NodeFactory/ConfiguratorClosureNodeFactory.php
- '#"@var_export\(new \\Symplify\\EasyCodingStandard\\Caching\\ValueObject\\CacheItem\(\$variableKey, \$data\), true\)" is forbidden to use#'
-
message: '#Class cognitive complexity is \d+, keep it under 25#'
paths:
- packages/composer-json-manipulator/src/ValueObject/ComposerJson.php
-
message: '#Cannot call method (.*?) on PHPStan\\Command\\Output\|null#'
path: packages/phpstan-extensions/src/ErrorFormatter/SymplifyErrorFormatter.php
# this can change on downgrade build
- "#'@package_version@' and '@package_version@' will always evaluate to false#"
-
message: '#Cognitive complexity for "Symplify\\Astral\\PhpDocParser\\PhpDocNodeTraverser\:\:(.*?)\(\)" is \d+, keep it under \d+#'
path: packages/astral/src/PhpDocParser/PhpDocNodeTraverser.php
- '#Cognitive complexity for "Symplify\\PhpConfigPrinter\\NodeFactory\\ArgsNodeFactory\:\:createFromValues\(\)" is 13, keep it under 8#'
- '#Method Symplify\\EasyCodingStandard\\FixerRunner\\Parser\\FileToTokensParser\:\:parseFromFilePath\(\) should return iterable<PhpCsFixer\\Tokenizer\\Token\>&PhpCsFixer\\Tokenizer\\Tokens but returns PhpCsFixer\\Tokenizer\\Tokens#'
-
message: '#Instead of abstract class, use specific service with composition#'
paths:
- packages/phpstan-rules/src/Rules/AbstractSymplifyRule.php
- packages/rule-doc-generator-contracts/src/ValueObject/AbstractCodeSample.php
- packages/symplify-kernel/src/HttpKernel/AbstractSymplifyKernel.php
- packages/astral/src/PhpDocParser/PhpDocNodeVisitor/AbstractPhpDocNodeVisitor.php
- packages/git-wrapper/src/Event/AbstractGitEvent.php
- packages/easy-coding-standard/src/Console/Command/AbstractCheckCommand.php
- packages/coding-standard/src/Fixer/AbstractSymplifyFixer.php
- packages/phpstan-rules/src/Rules/AbstractAttributeRule.php
# paralell
- '#Cognitive complexity for "Symplify\\EasyCodingStandard\\Application\\EasyCodingStandardApplication\:\:run\(\)" is 9, keep it under 8#'
-
message: '#Class has a static method must so must contains "Static" in its name#'
paths:
- packages/package-builder/src/Console/Command/CommandNaming.php
- packages/git-wrapper/src/Strings/GitStrings.php
- packages/easy-ci/src/ValueObject/ConfigFileSuffixes.php
# on purpose, to make service a simple as possible
-
message: '#Instead of "DateTime" class/interface use "Nette\\Utils\\DateTime"#'
path: packages/easy-coding-standard/src/Application/Version/StaticVersionResolver.php
# false positive - way too generic
- '#Property Symplify\\Astral\\NodeValue\\NodeValueResolver\:\:\$nodeValueResolvers with generic interface Symplify\\Astral\\Contract\\NodeValueResolver\\NodeValueResolverInterface does not specify its types\: TExpr#'
# vendor test case limitation
-
message: '#Class has a static method must so must contains "Static" in its name#'
path: packages/phpstan-extensions/tests/TypeExtension/*/*TypeExtension/*Test.php
-
message: '#Spread operator is not allowed#'
path: packages/phpstan-extensions/tests/TypeExtension/*/*TypeExtension/*Test.php
# parallel
- '#popen(.*?)" is forbidden to use#'
# json return
-
message: '#Use value object over return of values#'
path: packages/easy-coding-standard/packages/Parallel/Application/ParallelFileProcessor.php
# complex worker pool logic
-
message: '#Cognitive complexity for "Symplify\\EasyCodingStandard\\Parallel\\Application\\ParallelFileProcessor\:\:check\(\)" is \d+, keep it under 8#'
path: packages/easy-coding-standard/packages/Parallel/Application/ParallelFileProcessor.php
- '#(.*?) is not covered by backward compatibility promise\. The (.*?) might change in a minor PHPStan version#'
# false positive
# known realpath() checked with file_exist right above
-
message: '#Function resolveConfigFile\(\) should return string\|null but returns string\|false#'
path: packages/monorepo-builder/bin/monorepo-builder.php
-
path: packages/php-config-printer/src/ValueObject/YamlKey.php
message: '#Class has a static method must so must contains "Static" in its name#'
# value changed to int
-
path: packages/easy-ci/packages/Psr4/Utils/SymplifyStrings.php
message: '#Strict comparison using \!\=\= between null and null will always evaluate to false#'
-
message: '#Cannot call method (.*?)\(\) on Symplify\\EasyParallel\\ValueObject\\ProcessPool\|null#'
path: packages/easy-coding-standard/packages/Parallel/Application/ParallelFileProcessor.php
-
message: '#Use another value object over array with string\-keys and objects, array<string, ValueObject\>#'
paths:
- packages/symfony-static-dumper/src/Routing/RoutesProvider.php
- packages/autowire-array-parameter/src/DependencyInjection/DefinitionFinder.php
# is never string
- '#Parameter \#2 \$actualString of method PHPUnit\\Framework\\Assert\:\:assertStringEqualsFile\(\) expects string, string\|null given#'
- '#"@file_get_contents\(\$filename\)" is forbidden to use#'
- '#Property Symplify\\Skipper\\SkipCriteriaResolver\\SkippedClassAndCodesResolver\:\:\$skippedClassAndCodes \(array<string, array<string\>\|null\>\) does not accept array<int\|string, mixed\>#'
- '#Cognitive complexity for "Symplify\\EasyParallel\\CommandLine\\WorkerCommandLineFactory\:\:mirrorCommandOptions\(\)" is 10, keep it under 8#'
# already @var typed and checked
-
message: '#array_count_values\(\)\: Can only count string and integer values, entry skipped#'
path: packages/phpstan-rules/src/NodeAnalyzer/ScalarValueResolver.php
# not useful
- '#Parameter \#2 \$length of function array_chunk expects int<1, max\>, int given#'
# invalid PHPStan type - it alwasy requires 2 types to traverse with callable
-
message: '#Callable callable\(PHPStan\\Type\\Type\)\: PHPStan\\Type\\Type invoked with 2 parameters, 1 required#'
path: packages/phpstan-rules/src/Rules/Explicit/NoMixedCallableRule.php
# weird stringable callable
-
message: '#Make callable type explicit\. Here is how\: https\://phpstan\.org/writing\-php\-code/phpdoc\-types\#callables#'
paths:
# callable value resolving
- packages/astral/src/NodeValue/NodeValueResolver/FuncCallValueResolver.php
# callable value resolving
-
message: '#Use explicit names over dynamic ones#'
path: packages/astral/src/NodeValue/NodeValueResolver/FuncCallValueResolver.php
-
message: '#Cannot cast array\|bool\|float\|int\|string\|UnitEnum\|null to string#'
path: packages/symfony-static-dumper/src/Command/DumpStaticSiteCommand.php
-
message: '#Add explicit array type to assigned "\$definitions" expression#'
path: packages/config-transformer/src/DependencyInjection/Loader/IdAwareXmlFileLoader.php
-
message: '#Add explicit array type to assigned "\$excludeValue" expression#'
path: packages/php-config-printer/src/NodeFactory/Service/ServicesPhpNodeFactory.php
-
message: '#Instead of array shape, use value object with specific types in constructor and getters#'
paths:
# json serialize on purpose
- packages/easy-coding-standard/src/Console/Output/JsonOutputFormatter.php
- packages/easy-coding-standard/src/Contract/Application/FileProcessorInterface.php
- packages/easy-coding-standard/src/Reporter/ProcessedFileReporter.php
- packages/easy-coding-standard/src/*FileProcessor.php
- packages/easy-coding-standard/src/Application/EasyCodingStandardApplication.php
- packages/easy-coding-standard/packages/*/Application/*FileProcessor.php
- packages/php-config-printer/src/NodeFactory/Service/ServiceOptionNodeFactory.php
- packages/php-config-printer/src/Printer/SmartPhpConfigPrinter.php
-
message: '#Complete known array shape to the method @return type#'
paths:
- packages/php-config-printer/src/NodeFactory/Service/ServiceOptionNodeFactory.php
# messy array shapes - possibly value objects?
- '#Method Symplify\\EasyCodingStandard\\Application\\(.*?)FileProcessor\:\:processFileInfo\(\) should return (.*?)#'
# false positive, as just checked by phpunit
-
message: '#Offset (.*?)file_diffs(.*?) does not exist on (.*?) array<Symplify\\EasyCodingStandard\\ValueObject\\Error\\FileDiff>#'
path: packages/easy-coding-standard/tests/Error/ErrorCollector/FixerFileProcessorTest.php
# false positive sa checked before
-
message: '#Parameter \#1 \$stream of function (.*?) expects resource, resource\|null given#'
path: packages/easy-parallel/src/ValueObject/ParallelProcess.php
# false positives
- '#Undefined property\: (.*?)\:\:\$attrGroups#'
# needless generics
- '#Class Symplify\\PHPStanRules\\(.*?)Rule implements generic interface PHPStan\\Rules\\Rule but does not specify its types\: TNodeType#'
# cache false positive
-
message: '#PHPDoc tag @return with type array<class\-string<PhpParser\\Node>> is incompatible with native type string#'
path: packages/phpstan-rules/src/Rules/ExclusiveNamespaceRule.php