-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathphpstan.neon.dist
99 lines (80 loc) · 4.1 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
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
- tests/Checkout/ExpressCheckout/ExpressCheckoutSubscriberTest.php
- tests/DeprecatedTagTest.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:
# 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
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\Migration\AddColumnRule
- Shopware\Core\DevOps\StaticAnalyze\PHPStan\Rules\PackageAnnotationRule
- Shopware\Core\DevOps\StaticAnalyze\PHPStan\Rules\Migration\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