forked from shopware/shopware
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpstan.neon.dist
More file actions
58 lines (53 loc) · 3.35 KB
/
Copy pathphpstan.neon.dist
File metadata and controls
58 lines (53 loc) · 3.35 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
# The second definitions in "paths" and "excludes_analyse" are necessary for the correct execution of the pre-commit hook
parameters:
level: 5
paths:
- %currentWorkingDirectory%/vendor/shopware/platform/src
- %currentWorkingDirectory%/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: '%rootDir%/../../../../../../..%ShopwareHashedCacheDir%/srcShopware_Development_KernelDevDebugContainer.xml'
inferPrivatePropertyTypeFromConstructor: true
reportUnmatchedIgnoredErrors: false
# Bleeding edge features. Currently optional in latest PHPStan version
featureToggles:
deadCatchesRule: true
# Does not recognize annotions with traits correctly
# invalidVarTag: true
missingReturnRule: true
noopRule: true
# has problems with instanceof comparisons in switch statements
# subtractableTypes: true
tooWideTypehints: true
unreachableStatement: true
yieldRules: true
validateParameters: true
allowVarTagAboveStatements: true
# Not sure if we could simply use "self" instead of "static". Used mainly in our collections
# newStatic: true
excludes_analyse:
- %currentWorkingDirectory%/vendor/shopware/platform/src/Core/Flag/feature_*.php
- %currentWorkingDirectory%/src/Core/Flag/feature_*.php
- %currentWorkingDirectory%/vendor/shopware/platform/src/Recovery/*
- %currentWorkingDirectory%/src/Recovery/*
- %currentWorkingDirectory%/vendor/shopware/platform/src/Docs/Resources/current/2-internals/1-core/50-checkout-process/_examples/10-cart-example.php
- %currentWorkingDirectory%/src/Docs/Resources/current/2-internals/1-core/50-checkout-process/_examples/10-cart-example.php
# Tests
- %currentWorkingDirectory%/vendor/shopware/platform/src/**/*Test.php
- %currentWorkingDirectory%/src/**/*Test.php
- %currentWorkingDirectory%/src/Core/Framework/Test/**/*.php
- %currentWorkingDirectory%/vendor/shopware/platform/src/Core/Framework/Test/**/*.php
- %currentWorkingDirectory%/vendor/shopware/platform/src/**/Test/**/_fixture/feature_*.php
- %currentWorkingDirectory%/src/**/Test/**/_fixture/feature_*.php
- %currentWorkingDirectory%/vendor/shopware/platform/src/Core/TestBootstrap.php
- %currentWorkingDirectory%/src/Core/TestBootstrap.php
ignoreErrors:
# https://github.com/phpstan/phpstan/issues/1060
- '#Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeParentInterface::(variableNode|scalarNode|end|integerNode|booleanNode|enumNode)\(\)\.#'
# Must not call parent, because of own handling on adding new elements
- '#Shopware\\Core\\Framework\\DataAbstractionLayer\\CompiledFieldCollection::__construct\(\) does not call parent constructor from Shopware\\Core\\Framework\\Struct\\Collection.#'
# 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\.#'