-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathphpstan.neon.dist
More file actions
201 lines (160 loc) · 10.2 KB
/
Copy pathphpstan.neon.dist
File metadata and controls
201 lines (160 loc) · 10.2 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
includes:
- phpstan-baseline.neon
- phpstan.dynamic.neon
parameters:
tmpDir: var/cache/phpstan
paths:
- src
- tests
excludePaths:
- src/Resources
- tests/Checkout/ExpressCheckout/ExpressCheckoutSubscriberTest.php
- tests/DeprecatedTagTest.php
bootstrapFiles:
- tests/PHPStanBootstrap.php
featureToggles:
internalTag: true
symfony:
constantHassers: false
ignoreErrors:
# We won't type all arrays/iterables for now
- '#no value type specified in iterable type#'
# NEXT-22942 - Needs to be fixed with a script, rest goes to baseline
- '#.* generic class Shopware\\Core\\Framework\\DataAbstractionLayer\\EntityRepository.*not specify its types: TEntityCollection#'
- '#.* generic class Shopware\\Core\\System\\SalesChannel\\Entity\\SalesChannelRepository.*not specify its types: TEntityCollection#'
- '#.* generic class Shopware\\Core\\Framework\\DataAbstractionLayer\\Search\\EntitySearchResult.*does not specify its types: TEntityCollection#'
- # This service gets registered within Cms Extensions
message: '#is not registered in the container#'
path: tests/Checkout/ExpressCheckout/ExpressCheckoutSubscriberTest.php
- # Services in tests are all public
message: '#Service ".*" is private#'
path: tests/**/*.php
- # Ignore finality of repository in tests
message: '#.*extends @final class (\w|\\)*(SalesChannel|Entity)Repository#'
path: tests/**/*.php
- # in tests, we can use internal methods
identifier: staticMethod.internal
path: tests/*.php
# - # in tests, we can instantiate internal classes
# identifier: new.internalClass
# path: tests/*.php
- # in tests, we can use internal classes and its static methods
identifier: staticMethod.internalClass
path: tests/*.php
- # in tests, we can use internal classes and its methods
identifier: method.internalClass
path: tests/*.php
- # in tests, we can use internal interfaces
identifier: method.internalInterface
path: tests/*.php
- # in tests, we can use internal methods
identifier: method.internal
path: tests/*.php
- # in tests, we can use constants of internal classes
identifier: classConstant.internalClass
path: tests/*.php
- # in tests, we can use constants of internal interfaces
identifier: classConstant.internalInterface
path: tests/*.php
- # in tests, we can use instanceof of internal interfaces
identifier: instanceof.internalInterface
path: tests/*.php
- # package attributes are fine
identifier: attribute.internalClass
message: '#.*Shopware\\Core\\Framework\\Log\\Package#'
- # 6.8 deprecation
identifier: method.deprecated
message: '#__construct.*Shopware\\Core\\Framework\\DataAbstractionLayer\\EntityDefinition.*#'
- # 6.8 deprecation
identifier: method.deprecated
message: '#arameter \$silent will be added in v6\.8\.0.*#'
- # 6.8 deprecation - only type change
identifier: method.deprecated
message: '#(setActiveBillingAddress|setActiveShippingAddress).*Shopware\\Core\\Checkout\\Customer\\CustomerEntity.*#'
- # 6.8 deprecation - EntitySearchResult is still the repository search result type on 6.7
identifier: method.deprecatedClass
message: '#Shopware\\Core\\Framework\\DataAbstractionLayer\\Search\\EntitySearchResult:\s+tag:v6\.8\.0 reason:class-hierarchy-change - Will no longer extend EntityCollection, but will keep extending Struct\.#'
path: '**/*.php'
- # 6.8 deprecation - EntitySearchResult is still the repository search result type on 6.7
identifier: return.deprecatedClass
message: '#Shopware\\Core\\Framework\\DataAbstractionLayer\\Search\\EntitySearchResult:\s+tag:v6\.8\.0 reason:class-hierarchy-change - Will no longer extend EntityCollection, but will keep extending Struct\.#'
path: '**/*.php'
- # 6.8 deprecation - EntitySearchResult is still the repository search result type on 6.7
identifier: new.deprecatedClass
message: '#Shopware\\Core\\Framework\\DataAbstractionLayer\\Search\\EntitySearchResult:\s+tag:v6\.8\.0 reason:class-hierarchy-change - Will no longer extend EntityCollection, but will keep extending Struct\.#'
path: '**/*.php'
- # 6.8 deprecation - EntitySearchResult is still the repository search result type on 6.7
identifier: classConstant.deprecatedClass
message: '#Shopware\\Core\\Framework\\DataAbstractionLayer\\Search\\EntitySearchResult:\s+tag:v6\.8\.0 reason:class-hierarchy-change - Will no longer extend EntityCollection, but will keep extending Struct\.#'
path: '**/*.php'
- # 6.8 deprecation - DAL field API will return static natively
identifier: method.deprecated
message: '#Call to deprecated method (addFlags|removeFlag)\(\) of class Shopware\\Core\\Framework\\DataAbstractionLayer\\Field\\Field\:\s+tag\:v6\.8\.0 - reason\:return-type-change - Will return static natively#'
paths:
- src/DataAbstractionLayer
- src/Pos/DataAbstractionLayer
- src/Reporting/DataAbstractionLayer
- # 6.8 deprecation - kept for 6.7.0.0 compatibility
identifier: property.deprecatedInterface
message: '#Property \$productStreamBuilder references deprecated interface Shopware\\Core\\Content\\ProductStream\\Service\\ProductStreamBuilderInterface in its type:#'
path: src/Pos/Sync/ProductSelection.php
- # 6.8 deprecation - kept for 6.7.0.0 compatibility
identifier: parameter.deprecatedInterface
message: '#Parameter \$productStreamBuilder of method Swag\\PayPal\\Pos\\Sync\\ProductSelection::__construct\(\) has typehint with deprecated interface Shopware\\Core\\Content\\ProductStream\\Service\\ProductStreamBuilderInterface:#'
path: src/Pos/Sync/ProductSelection.php
- # 6.8 deprecation - kept for 6.7.0.0 compatibility
identifier: method.deprecatedInterface
message: '#Call to method buildFilters\(\) of deprecated interface Shopware\\Core\\Content\\ProductStream\\Service\\ProductStreamBuilderInterface:#'
path: src/Pos/Sync/ProductSelection.php
- # 6.8 deprecation - kept for 6.7.0.0 compatibility
identifier: classConstant.deprecatedInterface
message: '#Access to constant on deprecated interface Shopware\\Core\\Content\\ProductStream\\Service\\ProductStreamBuilderInterface:#'
path: tests/Pos/Sync/Product/ProductSelectionTestProductSync.php
- # Shopware trunk classifies these plugin tests as non-Unit by namespace
identifier: shopware.unexpectedTestCovers
- # v11.0.0 deprecation - addFundingAvailabilityDataToFooter will be removed
identifier: method.deprecated
message: '#Call to deprecated method addFundingAvailabilityDataToFooter\(\) of class Swag\\PayPal\\Storefront\\Data\\FundingSubscriber#'
path: tests/Storefront/Data/FundingSubscriberTest.php
- # Null check for extension before adding
identifier: argument.type
message: '#Parameter \#2 \$extension of method Shopware\\Core\\Framework\\Struct\\Struct::addExtension\(\) expects Shopware\\Core\\Framework\\Struct\\Struct, Shopware\\Core\\Framework\\Struct\\Struct\|null given#'
paths:
- tests/Storefront/Data/FundingSubscriberTest.php
- # 6.8 deprecation - Parameter order still has to be changed
identifier: method.deprecated
message: '#Call to deprecated method __construct\(\) of class .*\\PaymentMethodBlockedError#'
paths:
- src/Checkout/Cart/Validation/CartValidator.php
- tests/Checkout/PUI/PUISubscriberTest.php
- tests/Checkout/SalesChannel/MethodEligibilityRouteTest.php
- tests/Storefront/Data/CheckoutSubscriberTest.php
- # 6.8 deprecation - Will be removed
message: '#Shopware\\Commercial\\Subscription\\Checkout\\Cart\\Recurring\\SubscriptionRecurringDataStruct#'
paths:
- src/Checkout/Payment/Service/VaultTokenService.php
- tests/Checkout/Payment/Service/VaultTokenServiceTest.php
- tests/Checkout/Method/ACDCHandlerTest.php
- tests/Checkout/Method/VenmoHandlerTest.php
- # 6.8 deprecation - reason:exception-change - Will throw \Shopware\Core\Framework\Util\UtilException instead of \Doctrine\DBAL\Exception\TableNotFoundException
identifier: method.deprecated
message: '#Call to deprecated method columnExists\(\) of class .*\\MigrationStep#'
paths:
- src/Migration/Migration1706111604AddCustomerIdToVault.php
- src/Migration/Migration1675420139AddManagerDataToRun.php
- src/Migration/Migration1626082072AddStatusAndMessageCountToRun.php
- # Only name change
identifier: method.deprecated
message: '#tag:v11.0.0 reason:parameter-type-change - `\$countryCode` will be renamed to `\$currencyIso`#'
path: '**/*.php'
rules:
# Shopware core rules
- Shopware\Core\DevOps\StaticAnalyze\PHPStan\Rules\Internal\InternalClassRule
- Shopware\Core\DevOps\StaticAnalyze\PHPStan\Rules\Internal\InternalMethodRule
- Shopware\Core\DevOps\StaticAnalyze\PHPStan\Rules\Tests\CoversAttributeRule
- Shopware\Core\DevOps\StaticAnalyze\PHPStan\Rules\Tests\MockingSimpleObjectsNotAllowedRule
- Shopware\Core\DevOps\StaticAnalyze\PHPStan\Rules\DecorationPatternRule
- Shopware\Core\DevOps\StaticAnalyze\PHPStan\Rules\Migration\AddColumnRule
- Shopware\Core\DevOps\StaticAnalyze\PHPStan\Rules\PackageAnnotationRule
- Shopware\Core\DevOps\StaticAnalyze\PHPStan\Rules\Migration\NoAfterStatementRule
- Shopware\Core\DevOps\StaticAnalyze\PHPStan\Rules\NoNewRequestInStorefrontRule