forked from shopwareBoostDay/platform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphpstan.neon.dist
117 lines (107 loc) · 6.65 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
includes:
- phpstan-baseline.neon
parameters:
level: 8
treatPhpDocTypesAsCertain: false
checkMissingIterableValueType: false
inferPrivatePropertyTypeFromConstructor: true
reportUnmatchedIgnoredErrors: true # 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%/srcShopware_Development_KernelDevDebugContainer.xml'
featureToggles:
unusedClassElements: true
excludes_analyse:
- src/Recovery/*
- src/Storefront/Framework/Cache/CacheDecorator.php
- 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
# Symfony Patches, can be removed with next patch version
- src/Core/Framework/Adapter/Cache/CacheCollectorPass.php
# Tests
- src/**/*Test.php
- src/Core/Framework/Test/**/*.php
- src/Core/TestBootstrap.php
ignoreErrors:
# Needs a PHPStan extension to be recognised properly. See https://jira.shopware.com/browse/NEXT-13038
- '#Cannot call method fetch.*\(\) on Doctrine\\DBAL\\Driver\\Statement\|int#'
- '#Cannot call method rowCount\(\) on Doctrine\\DBAL\\Driver\\Statement\|int#'
# PhpStan does not recognize the Faker plugins correctly. They are called via magic methods
- '#Access to an undefined property Faker\\Generator::\$[^.]+\.#'
# For BC with Symfony 4
- '#Method Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface::dispatch\(\) invoked with 2 parameters, 1 required\.#'
# For BC in Store api routes
- '#Method Shopware\\Core\\Content\\Category\\SalesChannel\\AbstractNavigationRoute::load\(\) invoked with 5 parameters, 4 required\.#'
- '#Method Shopware\\Core\\Content\\Product\\SalesChannel\\Listing\\AbstractProductListingRoute::load\(\) invoked with 4 parameters, 3 required\.#'
- '#Method .*Route::load\(\) invoked with 3 parameters, 2 required\.#'
- '#Method .*AbstractCustomerRoute::load\(\) invoked with 4 parameters, 2 required\.#'
- '#Method .*AbstractChangeCustomerProfileRoute::change\(\) invoked with 3 parameters, 2 required\.#'
- '#Method .*AbstractChangeEmailRoute::change\(\) invoked with 3 parameters, 2 required\.#'
- '#Method .*AbstractChangePasswordRoute::change\(\) invoked with 3 parameters, 2 required\.#'
- '#Method .*AbstractChangePaymentMethodRoute::change\(\) invoked with 4 parameters, 3 required\.#'
- '#Method .*AbstractDeleteAddressRoute::delete\(\) invoked with 3 parameters, 2 required\.#'
- '#Method .*AbstractRemoveWishlistProductRoute::delete\(\) invoked with 3 parameters, 2 required\.#'
- '#Method .*AbstractDeleteCustomerRoute::delete\(\) invoked with 2 parameters, 1 required\.#'
- '#Method .*AbstractAddWishlistProductRoute::add\(\) invoked with 3 parameters, 2 required\.#'
- '#Method .*AbstractMergeWishlistProductRoute::merge\(\) invoked with 3 parameters, 2 required\.#'
- '#Method .*AbstractSwitchDefaultAddressRoute::swap\(\) invoked with 4 parameters, 3 required\.#'
- '#Method .*AbstractUpsertAddressRoute::upsert\(\) invoked with 4 parameters, 3 required\.#'
-
message: '#PHPDoc tag @param references unknown parameter: \$criteria#'
path: src/Core/**/SalesChannel/**Route.php
# For BC in Entity repository clone
- '#Method .*EntityRepositoryInterface::clone\(\) invoked with 4 parameters, 2-3 required\.#'
-
message: '#PHPDoc tag @param references unknown parameter: \$behavior#'
path: src/Core/Framework/DataAbstractionLayer/EntityRepositoryInterface.php
# For BC in Store-API routes
-
message: '#Method Shopware\\Core\\Checkout\\Customer\\SalesChannel\\Abstract.*Route::.*\(\) has no return typehint specified#'
paths:
- src/Core/Checkout/Customer/SalesChannel/AbstractChangePasswordRoute.php
- src/Core/Checkout/Customer/SalesChannel/AbstractLogoutRoute.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
# 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: '#Strict comparison using#'
path: src/Core/Framework/Api/ApiDefinition/Generator/OpenApi/OpenApiLoader.php
-
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
# For BC in SalesChannelContextService get
- '#Method Shopware\\Core\\System\\SalesChannel\\Context\\SalesChannelContextServiceInterface::get\(\) invoked with 4 parameters, 3 required\.#'
- '#Property Shopware\\Core\\Checkout\\Order\\Event\\OrderStateMachineStateChangeEvent::\$salesChannelId is never read, only written.#'
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