-
Notifications
You must be signed in to change notification settings - Fork 35
/
phpstan.neon.dist
142 lines (117 loc) · 6.38 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
includes:
- phpstan-baseline.neon
- phar://phpstan.phar/conf/bleedingEdge.neon
- %ShopwareRoot%/src/Core/DevOps/StaticAnalyze/PHPStan/extension.neon
- %ShopwareRoot%/src/Core/DevOps/StaticAnalyze/PHPStan/rules.neon
parameters:
phpVersion: 80200
level: 8
tmpDir: var/cache/phpstan
treatPhpDocTypesAsCertain: false
checkFunctionNameCase: true
checkInternalClassCaseSensitivity: true
reportUnmatchedIgnoredErrors: true
paths:
- src
- tests
excludePaths:
- src/Resources
- src/DevOps/Rector
# tag:v6.7.0 - does not fully understand overwrite multiple definitions of DefaultPayment
- src/Pos/Payment/PosPayment.php
bootstrapFiles:
- bin/static-analyze-autoloader.php
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'
type_perfect:
narrow_return: true
no_mixed: true
null_over_false: true
ignoreErrors:
# Will be fixed in v6.7
- '#Do not use md5 function, use class Shopware\\Core\\Framework\\Util\\Hasher instead.#'
# 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
- # ignore own deprecations
message: '#.*tag:v10.0.0 -#'
- # ignore shopware v6.7 deprecations in tests
message: '#.*tag:v6.7.0 -#'
paths:
- tests/**/*.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#'
paths:
- src/Checkout/PUI/ScheduledTask/PUIInstructionsFetchTaskHandler.php
- src/Checkout/Payment/ScheduledTask/TransactionStatusSyncTaskHandler.php
- src/Pos/Command/AbstractPosCommand.php
- src/Pos/Schedule/AbstractSyncTaskHandler.php
- src/Reporting/ScheduledTask/TurnoverReportingTaskHandler.php
- # ignore shopware v6.7 payment handlers refactor deprecations
message: '#tag:v6.7.0 -.*PaymentTransactionStruct#'
paths:
- src/Checkout/Card/*Validator.php
- src/Checkout/Card/CardValidatorInterface.php
- src/Checkout/Payment/**/*Handler.php
- src/Checkout/Payment/PayPalPaymentHandler.php
- src/Checkout/Payment/Service/VaultTokenService.php
- src/OrdersApi/Builder/*Builder.php
- src/PaymentsApi/Builder/OrderPaymentBuilderInterface.php
- src/PaymentsApi/Builder/*Builder.php
- src/PaymentsApi/Patch/*.php
- # ignore shopware v6.7 payment handlers refactor deprecations
message: '#.*tag:v6.7.0 - will be removed, (extend AbstractPaymentHandler)|(use `build`) instead#'
paths:
- src/Checkout/Payment/**/*Handler.php
- src/Checkout/Payment/PayPalPaymentHandler.php
- src/Checkout/SalesChannel/CreateOrderRoute.php
- src/Webhook/Handler/VaultPaymentTokenCreated.php
- # ignore shopware v6.7 payment handlers refactor deprecations
message: '#Swag\\PayPal\\Pos\\Payment\\PosPayment#'
paths:
- tests/Pos/Util/InformationDefaultServiceTest.php
- # ignore shopware v6.7 native type deprecations
message: '#.*tag:v6.7.0 - Will be natively typed|Native type for property ".*" is missing#'
paths:
- src/Checkout/TokenResponse.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\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\AddColumnRule
- Shopware\Core\DevOps\StaticAnalyze\PHPStan\Rules\PackageAnnotationRule
- Shopware\Core\DevOps\StaticAnalyze\PHPStan\Rules\NoAfterStatementRule
- Shopware\Core\DevOps\StaticAnalyze\PHPStan\Rules\NoNewRequestInStorefrontRule
# rules from https://github.com/symplify/phpstan-rules
# domain
- Symplify\PHPStanRules\Rules\Enum\RequireUniqueEnumConstantRule
- Symplify\PHPStanRules\Rules\PreventParentMethodVisibilityOverrideRule
# explicit naming
- Symplify\PHPStanRules\Rules\ForbiddenMultipleClassLikeInOneFileRule
- Symplify\PHPStanRules\Rules\Complexity\ForbiddenArrayMethodCallRule
# complexity rules
- Symplify\PHPStanRules\Rules\NoDynamicNameRule
# naming rules
- Shopware\Core\DevOps\StaticAnalyze\PHPStan\Rules\Symplify\NoReturnSetterMethodWithFluentSettersRule
- Symplify\PHPStanRules\Rules\UppercaseConstantRule
- Symplify\PHPStanRules\Rules\CheckClassNamespaceFollowPsr4Rule