forked from shopware/shopware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphpstan.neon.dist
195 lines (185 loc) · 12.2 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
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
includes:
- phpstan-baseline.neon
parameters:
level: 8
treatPhpDocTypesAsCertain: false
checkMissingIterableValueType: false
inferPrivatePropertyTypeFromConstructor: true
reportUnmatchedIgnoredErrors: false # Could be set to false if necessary during PHPStan update
tmpDir: ../var/cache/phpstan
paths:
- src
symfony:
constant_hassers: false
# the placeholder "%ShopwareHashedCacheDir%" will be replaced on execution by dev-ops/analyze/phpstan-config-generator.php script
container_xml_path: '..%ShopwareHashedCacheDir%/Shopware_Development_KernelDevDebugContainer.xml'
console_application_loader: ../dev-ops/analyze/console-application.php
featureToggles:
unusedClassElements: true
excludes_analyse:
- src/Recovery/*
- src/Docs/Resources/current/60-references-internals/10-core/50-checkout-process/_examples/10-cart-example.php
- src/Docs/Resources/deprecated/2-internals/1-core/50-checkout-process/_examples/10-cart-example.php
# Tests
- src/Core/Checkout/Test/Cart/CalculatorTest.php
- src/Core/Checkout/Test/Cart/CartPersisterTest.php
- src/Core/Checkout/Test/Cart/CartServiceTest.php
- src/Core/Checkout/Test/Cart/ProcessorTest.php
- src/Core/Checkout/Test/Cart/Delivery/*.php
- src/Core/Checkout/Test/Cart/LineItem/*.php
- src/Core/Checkout/Test/Cart/Order/*.php
- src/Core/Checkout/Test/Cart/Price/*.php
- src/Core/Checkout/Test/Cart/Promotion/*.php
- src/Core/Checkout/Test/Cart/Tax/*.php
- src/Core/Checkout/Test/Cart/SalesChannel/*.php
- src/Core/Checkout/Test/Customer/*.php
- src/Core/Checkout/Test/Document/*.php
- src/Core/Checkout/Test/Order/*.php
- src/Core/Checkout/Test/Payment/*.php
- src/Core/Checkout/Test/Promotion/*.php
- src/Core/Checkout/Test/Shipping/*.php
- src/Core/Checkout/Test/Validation/*.php
- src/Core/Content/Test/*.php
- src/Core/Framework/Test/*.php
- src/Core/Migration/Test/*.php
- src/Core/System/Test/*.php
- src/Elasticsearch/*Test.php
- src/Storefront/*Test.php
# node_modules
- src/**/node_modules/*
ignoreErrors:
# PhpStan does not recognize the Faker plugins correctly. They are called via magic methods
- '#Access to an undefined property Faker\\Generator::\$[^.]+\.#'
-
message: '#Call to an undefined method Shopware\\Core\\Framework\\DataAbstractionLayer\\EntityDefinition\|Shopware\\Core\\System\\SalesChannel\\Entity\\SalesChannelDefinitionInterface::getEntityName\(\)\.#'
path: src/Core/System/SalesChannel/Entity/SalesChannelRepository.php
-
message: '#Method Shopware\\Core\\System\\SystemConfig\\SystemConfigService::trace\(\) has no return typehint specified\.#'
path: src/Core/System/SystemConfig/SystemConfigService.php
-
message: '#Parameter \#3 \$entities of class Shopware\\Core\\Framework\\DataAbstractionLayer\\Search\\EntitySearchResult constructor expects Shopware\\Core\\Framework\\DataAbstractionLayer\\EntityCollection, iterable given\.#'
path: src/Core/Framework/DataAbstractionLayer/Search/EntitySearchResult.php
-
message: '#Method Shopware\\Storefront\\Theme\\ThemeConfigValueAccessor::get\(\) has no return typehint specified\.#'
path: src/Storefront/Theme/ThemeConfigValueAccessor.php
-
message: '#Method Shopware\\Storefront\\Theme\\ThemeConfigValueAccessor::trace\(\) has no return typehint specified\.#'
path: src/Storefront/Theme/ThemeConfigValueAccessor.php
-
message: '#Method Shopware\\Storefront\\Framework\\Cache\\CacheTracer::trace\(\) has no return typehint specified\.#'
path: src/Storefront/Framework/Cache/CacheTracer.php
-
message: '#Method Shopware\\Core\\Framework\\Adapter\\Cache\\CacheTagCollection::trace\(\) has no return typehint specified\.#'
path: src/Core/Framework/Adapter/Cache/CacheTagCollection.php
-
message: '#Method Shopware\\Core\\Framework\\Adapter\\Translation\\Translator::trace\(\) has no return typehint specified\.#'
path: src/Core/Framework/Adapter/Translation/Translator.php
-
message: '#Call to an undefined method Symfony\\Component\\Translation\\TranslatorBagInterface\|Symfony\\Contracts\\Translation\\TranslatorInterface::getCatalogue\(\)\.#'
path: src/Core/Framework/Adapter/Translation/Translator.php
-
message: '#Call to an undefined method Symfony\\Component\\Translation\\TranslatorBagInterface\|Symfony\\Contracts\\Translation\\TranslatorInterface::getLocale\(\)\.#'
path: src/Core/Framework/Adapter/Translation/Translator.php
-
message: '#Method Shopware\\Core\\Framework\\Adapter\\Translation\\Translator::warmUp\(\) has parameter \$cacheDir with no typehint specified\.#'
path: src/Core/Framework/Adapter/Translation/Translator.php
-
message: '#Parameter \#1 \$locale of method Shopware\\Core\\Framework\\Adapter\\Translation\\Translator::setLocale\(\) expects string, string\|null given\.#'
path: src/Core/Framework/Adapter/Translation/Translator.php
-
message: '#Call to an undefined method Symfony\\Component\\Translation\\TranslatorBagInterface|Symfony\\Contracts\\Translation\\TranslatorInterface::setLocale\(\)\.#'
path: src/Core/Framework/Adapter/Translation/Translator.php
-
message: '#Method Shopware\\Core\\Framework\\Adapter\\Cache\\CacheTracer::trace\(\) has no return typehint specified\.#'
path: src/Core/Framework/Adapter/Cache/CacheTracer.php
-
message: '#Method Shopware\\Core\\Framework\\Adapter\\Cache\\CacheCompressor::compress\(\) has parameter \$content with no typehint specified\.#'
path: src/Core/Framework/Adapter/Cache/CacheCompressor.php
-
message: '#Method Shopware\\Core\\Framework\\Adapter\\Cache\\CacheCompressor::uncompress\(\) has no return typehint specified\.#'
path: src/Core/Framework/Adapter/Cache/CacheCompressor.php
-
message: '#Parameter \#1 \$variable_representation of function unserialize expects string, string\|false given\.#'
path: src/Core/Framework/Adapter/Cache/CacheCompressor.php
-
message: '#Method Shopware\\Core\\Framework\\Adapter\\Cache\\AbstractCacheTracer::trace\(\) has no return typehint specified\.#'
path: src/Core/Framework/Adapter/Cache/AbstractCacheTracer.php
-
message: '#Method Shopware\\Core\\Framework\\Adapter\\Translation\\AbstractTranslator::trace\(\) has no return typehint specified\.#'
path: src/Core/Framework/Adapter/Translation/AbstractTranslator.php
-
message: '#Method Shopware\\Core\\Content\\Product\\DataAbstractionLayer\\ProductStreamUpdater::iterate\(\) has parameter \$offset with no typehint specified\.#'
path: src/Core/Content/Product/DataAbstractionLayer/ProductStreamUpdater.php
-
message: '#Cannot call method getPluginInfos\(\) on Shopware\\Core\\Framework\\Plugin\\KernelPluginLoader\\KernelPluginLoader\|null\.#'
path: src/Core/Kernel.php
-
message: '#Method Shopware\\Storefront\\Framework\\Captcha\\AbstractCaptcha::isValid\(\) invoked with 2 parameters, 1 required\.#'
path: src/Storefront/Framework/Captcha/CaptchaRouteListener.php
- '#Method .*FieldSerializer::decode\(\) has no return typehint specified\.#'
- '#Method .*FieldSerializer::decode\(\) has parameter \$value with no typehint specified\.#'
- '#Method .*CustomFieldsSerializer::decode\(\) has no return typehint specified\.#'
- '#Method .*FieldSerializerInterface::decode\(\) has no return typehint specified\.#'
# Inheritance checks for not nullable fields of the product entity (for example product.price contains always a value inside a sales channel context) - Could be fixed if php allows function type hint override
-
message: '#Parameter \#2 \$prices of method Shopware\\Core\\Content\\Product\\SalesChannel\\Price\\ProductPriceCalculator::buildDefinition\(\) expects Shopware\\Core\\Framework\\DataAbstractionLayer\\Pricing\\PriceCollection, Shopware\\Core\\Framework\\DataAbstractionLayer\\Pricing\\PriceCollection\|null given\.#'
path: src/Core/Content/Product/SalesChannel/Price/ProductPriceCalculator.php
-
message: '#Parameter \#1 \$taxId of method Shopware\\Core\\System\\SalesChannel\\SalesChannelContext::buildTaxRules\(\) expects string, string\|null given\.#'
path: src/Core/Content/Product/SalesChannel/Price/ProductPriceCalculator.php
# OngrDSL wrong type hint
-
message: '#Parameter \#3 \$script of class ONGR\\ElasticsearchDSL\\Aggregation\\Metric\\StatsAggregation constructor expects string\|null, array<string, array\|string> given\.#'
path: src/Elasticsearch/Framework/DataAbstractionLayer/CriteriaParser.php
# For BC with Symfony 4
-
message: '#Method Shopware\\Core\\Content\\MailTemplate\\Service\\Event\\MailBeforeValidateEvent::addData\(\) has parameter \$value with no typehint specified#'
path: src/Core/Content/MailTemplate/Service/Event/MailBeforeValidateEvent.php
-
message: '#Method Shopware\\Core\\Content\\MailTemplate\\Service\\Event\\MailBeforeValidateEvent::addTemplateData\(\) has parameter \$value with no typehint specified#'
path: src/Core/Content/MailTemplate/Service/Event/MailBeforeValidateEvent.php
# To fix this error, the \Shopware\Core\Framework\Struct\Collection::createNew method has to be implemented
# in every implementation of `Collection` and needs to return `new self` instead of `new static`. See https://github.com/phpstan/phpstan/issues/2773
-
message: '#Unsafe usage of new static\(\)#'
path: src/Core/Framework/Struct/Collection.php
# Must be fixed with a custom rule
- '#Cannot call method fetch.*\(\) on Doctrine\\DBAL\\Driver\\ResultStatement\|int#'
- '#Call to an undefined method Doctrine\\DBAL\\Driver\\ResultStatement::rowCount\(\)\.#'
# Exception for CopyBatch file system plugin. It is called via magic method
- '#Call to an undefined method League\\Flysystem\\FilesystemInterface::copyBatch\(\)\.#'
-
message: '#Access to private property#'
path: src/Core/Framework/Api/Controller/CacheController.php
# Invalid phpdoc in OpenAPI Library
-
message: '#Property OpenApi\\Annotations\\PathItem::\$(delete|get|patch|post|put) \(OpenApi\\Annotations\\(Delete|Get|Patch|Post|Put)\) does not accept string#'
path: src/Core/Framework/Api/ApiDefinition/Generator/OpenApi/OpenApiLoader.php
-
message: '#Strict comparison using#'
path: src/Core/Framework/Api/ApiDefinition/Generator/OpenApi/OpenApiLoader.php
# storageName could not be null, because the `compile` method is called first
-
message: '#Method Shopware\\Core\\Framework\\DataAbstractionLayer\\Field\\ReferenceVersionField::getStorageName\(\) should return string but returns string\|null#'
path: src/Core/Framework/DataAbstractionLayer/Field/ReferenceVersionField.php
services:
-
class: Shopware\Development\Analyze\PHPStan\Rules\Decoratable\DecoratableImplementsInterfaceRule
tags:
- phpstan.rules.rule
-
class: Shopware\Development\Analyze\PHPStan\Rules\Decoratable\DecoratableDoesNotAddPublicMethodRule
tags:
- phpstan.rules.rule
-
class: Shopware\Development\Analyze\PHPStan\Rules\Decoratable\DecoratableDoesNotCallOwnPublicMethodRule
tags:
- phpstan.rules.rule
-
class: Shopware\Development\Analyze\PHPStan\Rules\Decoratable\DecoratableNotDirectlyDependetRule
tags:
- phpstan.rules.rule
-
class: Shopware\Development\Analyze\PHPStan\Rules\Decoratable\DecoratableNotInstantiatedRule
tags:
- phpstan.rules.rule