-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathphpstan.neon.dist
More file actions
186 lines (149 loc) · 9.19 KB
/
Copy pathphpstan.neon.dist
File metadata and controls
186 lines (149 loc) · 9.19 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
includes:
- phpstan-baseline.neon
- phpstan.dynamic.neon
- ../../../vendor/shopwarelabs/phpstan-shopware/future-compatibility.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 - 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 - 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'
- # 6.8 deprecation - Use the "defaults" property instead
identifier: method.deprecated
message: '#Call to deprecated method getDefaults\(\) of class Symfony\\Component\\Routing\\Attribute\\Route#'
path: tests/AgenticCommerce/SalesChannel/DefaultRouteScopeTest.php
# swagger-php 6.4 (Shopware trunk matrix) moves the "not set" sentinel from OpenApi\Generator to
# OpenApi\Undefined and makes OpenApi\Context non-nullable. The v6.7.0.0 matrix still ships the older
# API, so we keep the version-agnostic calls (Generator::isDefault()/UNDEFINED and nullsafe _context)
# and suppress the 6.4-only notices here. These stay unmatched on 6.7.0.0, which is fine because CI
# runs with reportUnmatchedIgnoredErrors=false.
- # swagger-php 6.4 deprecation - Generator::isDefault() moved to OpenApi\Undefined::isDefault()
identifier: staticMethod.deprecated
message: '#Call to deprecated method isDefault\(\) of class OpenApi\\Generator#'
paths:
- src/DevOps/OpenApi
- tests/OpenAPISchemaTest.php
- # swagger-php 6.4 deprecation - Generator::UNDEFINED moved to OpenApi\Undefined::UNDEFINED
identifier: classConstant.deprecated
message: '#Fetching deprecated class constant UNDEFINED of class OpenApi\\Generator#'
path: tests/OpenAPISchemaTest.php
- # swagger-php 6.4 makes OpenApi\Context non-nullable; the nullsafe operator is still required on 6.7.0.0
identifier: nullsafe.neverNull
message: '#Using nullsafe (property access|method call) on non-nullable type OpenApi\\Context#'
paths:
- src/DevOps/OpenApi
- tests/OpenAPISchemaTest.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