/
phpstan.neon.dist
105 lines (89 loc) · 5.24 KB
/
phpstan.neon.dist
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
includes:
- phpstan-baseline.neon
- %ShopwareRoot%/vendor/phpstan/phpstan/conf/bleedingEdge.neon
- %ShopwareRoot%/src/Core/DevOps/StaticAnalyze/PHPStan/extension.neon
- %ShopwareRoot%/src/Core/DevOps/StaticAnalyze/PHPStan/rules.neon
parameters:
level: 8
tmpDir: var/cache/phpstan
treatPhpDocTypesAsCertain: false
checkFunctionNameCase: true
checkInternalClassCaseSensitivity: true
checkUninitializedProperties: true
paths:
- src
- tests
excludePaths:
- src/Resources
symfony:
constant_hassers: false
# the placeholder "%ShopwareHashedCacheDir%" will be replaced on execution by bin/phpstan-config-generator.php script
container_xml_path: '../../..%ShopwareHashedCacheDir%/%ShopwareKernelClass%DevDebugContainer.xml'
consoleApplicationLoader: %ShopwareRoot%/src/Core/DevOps/StaticAnalyze/console-application.php
ignoreErrors:
- message: '#Service ".*" is private#'
paths:
- tests/**/*Test.php
- # PHPStan does not recognize correctly that the properties are initialized in a private method called in the setUp method
message: '#Access to an uninitialized property SwagMigrationAssistant\\Test.*(mappingService|connection|runId)#'
paths:
- tests/Migration/Controller/StatusControllerTest.php
- tests/Migration/Services/MigrationDataWriterTest.php
- tests/Migration/Services/MigrationProgressServiceTest.php
- tests/Profile/Shopware/Gateway/Local/
- # The properties are never uninitialized. They are assigned in the convert method.
message: '#Class SwagMigrationAssistant\\Profile\\Shopware6{0,1}\\Converter\\.* has an uninitialized property .*. Give it default value or assign it in the constructor.$#'
paths:
- src/Profile/Shopware/Converter
- src/Profile/Shopware6/Converter/ShopwareConverter
- # To fix those issues, the AbstractProvider needs a generic type, which could then be used further down in the methods as typehints for other generic typed parameters
message: '#(readTotalFromRepo|readTableFromRepo|cleanupSearchResult)\(\) has parameter .* with generic class#'
path: src/DataProvider/Provider/Data/AbstractProvider.php
- # Can be removed once the min SW version is 6.6.1.0
message: '#Method Context::createDefaultContext\(\) should not be used in CLI context. Use Context::createCLIContext\(\) instead#'
path: src/Command/MigrateDataCommand.php
# ToDo: fix platform deprecations for v6.7.0.0
- message: """
#^Call to deprecated method getName\\(\\) of class Shopware\\\\Core\\\\System\\\\StateMachine\\\\Aggregation\\\\StateMachineState\\\\StateMachineStateEntity\\:
tag\\:v6\\.7\\.0 \\- reason\\:return\\-type\\-change \\- Will also return null
return type will be \\?string in v6\\.7\\.0\\.0$#
"""
paths:
- src/Profile/Shopware/Premapping/OrderDeliveryStateReader.php
- src/Profile/Shopware/Premapping/OrderStateReader.php
- src/Profile/Shopware/Premapping/TransactionStateReader.php
services:
- # register the class, so we can decorate it, but don't tag it as a rule, so only our decorator is used by PHPStan
class: Symplify\PHPStanRules\Rules\NoReturnSetterMethodRule
rules:
# Shopware core rules
- Shopware\Core\DevOps\StaticAnalyze\PHPStan\Rules\Deprecation\DeprecatedMethodsThrowDeprecationRule
- Shopware\Core\DevOps\StaticAnalyze\PHPStan\Rules\Tests\CoversAttributeRule
- Shopware\Core\DevOps\StaticAnalyze\PHPStan\Rules\Tests\MockingSimpleObjectsNotAllowedRule
- Shopware\Core\DevOps\StaticAnalyze\PHPStan\Rules\FinalClassRule
- Shopware\Core\DevOps\StaticAnalyze\PHPStan\Rules\DecorationPatternRule
- Shopware\Core\DevOps\StaticAnalyze\PHPStan\Rules\PackageAnnotationRule
- Shopware\Core\DevOps\StaticAnalyze\PHPStan\Rules\DomainExceptionRule
- Shopware\Core\DevOps\StaticAnalyze\PHPStan\Rules\NoAfterStatementRule
# rules from https://github.com/symplify/phpstan-rules
# domain
- Symplify\PHPStanRules\Rules\Enum\RequireUniqueEnumConstantRule
- Symplify\PHPStanRules\Rules\ForbiddenParamTypeRemovalRule
- Symplify\PHPStanRules\Rules\PreventParentMethodVisibilityOverrideRule
# paths
- Symplify\PHPStanRules\Rules\NoMissingDirPathRule
- Symplify\PHPStanRules\Rules\NoArrayAccessOnObjectRule
# dead-code
- Symplify\PHPStanRules\Rules\NoIssetOnObjectRule
# explicit naming
- Symplify\PHPStanRules\Rules\ForbiddenMultipleClassLikeInOneFileRule
- Symplify\PHPStanRules\Rules\Complexity\ForbiddenArrayMethodCallRule
# complexity rules
- Symplify\PHPStanRules\Rules\Explicit\NoMixedPropertyFetcherRule
- Symplify\PHPStanRules\Rules\Explicit\NoMixedMethodCallerRule
- Symplify\PHPStanRules\Rules\NoDynamicNameRule
# naming rules
- Shopware\Core\DevOps\StaticAnalyze\PHPStan\Rules\Symplify\NoReturnSetterMethodWithFluentSettersRule
- Symplify\PHPStanRules\Rules\NoVoidGetterMethodRule
- Symplify\PHPStanRules\Rules\UppercaseConstantRule
- Symplify\PHPStanRules\Rules\CheckClassNamespaceFollowPsr4Rule