forked from shopware5/shopware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.phpstan.neon
138 lines (117 loc) · 8.86 KB
/
.phpstan.neon
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
includes:
- .phpstan-baseline.neon
parameters:
level: 8
inferPrivatePropertyTypeFromConstructor: true
reportUnmatchedIgnoredErrors: true
treatPhpDocTypesAsCertain: false
tmpDir: var/cache/phpstan
bootstrapFiles:
- %currentWorkingDirectory%/recovery/common/autoload.php # Additional autoloading for testing classes under recovery/*
symfony:
constant_hassers: false
container_xml_path: 'var/cache/production____REVISION___/container.xml'
console_application_loader: tests/phpstan-console-application.php
doctrine:
repositoryClass: Shopware\Components\Model\ModelRepository
objectManagerLoader: tests/phpstan-doctrine-model-manager.php
scanDirectories:
- %currentWorkingDirectory%/var/cache/production____REVISION___/doctrine
- %currentWorkingDirectory%/var/cache/production____REVISION___/proxies
- %currentWorkingDirectory%/engine/Library
paths:
- %currentWorkingDirectory%/engine/Shopware
- %currentWorkingDirectory%/tests
- %currentWorkingDirectory%/engine/Library/Enlight
excludes_analyse:
- %currentWorkingDirectory%/engine/Shopware/Plugins/Community
- %currentWorkingDirectory%/engine/Shopware/Plugins/Local
- %currentWorkingDirectory%/engine/Shopware/Components/DependencyInjection/LegacyPhpDumper.php # is copied from Symfony. To keep it comparable, we don't change it
- %currentWorkingDirectory%/tests/Functional/Components/DependencyInjection/LegacyPhpDumperTest.php
ignoreErrors:
- '#apcu_#'
# Interface / Implementation Switch
- '#expects Shopware\\Bundle\\SearchBundle\\Facet\\[a-zA-Z]+Facet, Shopware\\Bundle\\SearchBundle\\[a-zA-Z]+Interface given#'
- '#expects Shopware\\Bundle\\SearchBundle\\Condition\\[a-zA-Z]+Condition, Shopware\\Bundle\\SearchBundle\\[a-zA-Z]+Interface given#'
# Product/Shopcontext mixup
- '#expects Shopware\\Bundle\\StoreFrontBundle\\Struct\\ProductContextInterface, Shopware\\Bundle\\StoreFrontBundle\\Struct\\ShopContextInterface given#'
# We manually check if the class exists before instantiating / using it
- '#PHPDoc tag \@var for variable \$payPalInstaller contains unknown class SwagPaymentPayPalUnified\\Setup\\FirstRunWizardInstaller#'
- # Config is read out in kernel, so there is a context for $this
message: '#Variable \$this might not be defined#'
path: engine/Shopware/Configs/Default.php
- # Seem to be issues, but need tests to verify changes there
message: '#Negated boolean expression is always false#'
path: 'engine/Shopware/Core/sArticles.php'
-
message: '#Comparison operation ">=" between int<1, max> and 1 is always true#'
path: 'engine/Shopware/Core/sArticles.php'
-
message: '#Comparison operation "<" between \(array\|float\|int\) and 0 results in an error\.#'
path: engine/Shopware/Core/sAdmin.php
-
message: '#Call to static method PHPUnit\\Framework\\Assert::assertIsArray\(\) with false will always evaluate to false\.#'
path: tests/Functional/Core/AdminTest.php
- # We override the method in higher class inheritance to public method
message: '#Call to protected method verifyPage#'
path: tests/Mink/features/bootstrap/SpecialContext.php
- # Every API resource class has those methods, but we cannot put that into an interface or abstract class, because the parameter amount is different
message: '#Call to an undefined method \$this\(Shopware\\Components\\Api\\Resource\\Resource\)&Shopware\\Components\\Api\\BatchInterface::(delete|update|create)\(\)#'
path: engine/Shopware/Components/Api/Resource/Resource.php
- # Currently not possible to determine the paginator generic type at those places
message: '#return type with generic class Doctrine\\ORM\\Tools\\Pagination\\Paginator does not specify its types: T#'
paths:
- engine/Shopware/Components/Model/ModelManager.php
- engine/Shopware/Controllers/Backend/Search.php
# Some day this should be specified
- '#no value type specified in iterable type Doctrine\\#'
# This method does not exists, but it does not throw an error. Needs to be checked
- '#Call to an undefined method Enlight_Template_Manager::setCompileId\(\)#'
# Needs some improvements in the doctrine PHPStan extensions: see https://github.com/phpstan/phpstan-doctrine/pull/167
- '#Cannot call method fetch.*\(\) on Doctrine\\DBAL\\.*Statement\|int#'
- # This property contains many different repositories, so we do not specify the type
message: '#with generic class Shopware\\Components\\Model\\ModelRepository does not specify its types: TEntityClass#'
path: engine/Shopware/Controllers/Backend/Config.php
- # While cloning entities the ID or foreign key columns need to be set to `null` even if they do not allow that from the database definition
message: '#Property Shopware\\Models\\Emotion\\.*::.*id|Id \(int\) does not accept null#'
paths:
- engine/Shopware/Models/Emotion/Data.php
- engine/Shopware/Models/Emotion/Element.php
- engine/Shopware/Models/Emotion/ElementViewport.php
- engine/Shopware/Models/Emotion/Emotion.php
- engine/Shopware/Models/Emotion/Preset.php
- engine/Shopware/Models/Emotion/PresetTranslation.php
- engine/Shopware/Models/Emotion/Template.php
- # The config stores values as serialized strings, but the getter of the models return the actual type like bool or int
message: '#::\$value type mapping mismatch: database|property can contain #'
paths:
- engine/Shopware/Models/Config/Element.php
- engine/Shopware/Models/Config/Value.php
- # Testing DI container stuff with autowiring services into controller actions. No possibility to teach that to PHPStan
message: '#Service "Shopware\\Tests\\Functional\\Bundle\\ControllerBundle\\TestController\\Test" is not registered in the container#'
path: tests/Functional/Bundle/ControllerBundle/ControllerActionTest.php
-
message: '#Instantiated class TestContainer not found#'
path: tests/Functional/Bundle/ControllerBundle/ControllerActionTest.php
-
message: '#Parameter \#1 \$loader of method Enlight_Controller_Action::setContainer\(\) expects Shopware\\Components\\DependencyInjection\\Container\|null, TestContainer given#'
path: tests/Functional/Bundle/ControllerBundle/ControllerActionTest.php
- # Somehow PHPStan does not recognize the return types correctly
message: '#Call to static method PHPUnit\\Framework\\Assert::assertIsArray\(\) with true|null will always evaluate to false#'
count: 4
path: tests/Functional/Core/BasketTest.php
- # PHPStan has issues to recognize the inheritance of SortingInterface and ConditionInterface
message: '#Parameter \#1 \$criteriaPart of method Shopware\\Bundle\\SearchBundleES\\SortingHandler\\.*SortingHandler::getSorting\(\) expects Shopware\\Bundle\\SearchBundle\\Sorting\\.*Sorting, Shopware\\Bundle\\SearchBundle\\CriteriaPartInterface given#'
path: engine/Shopware/Bundle/SearchBundleES/SortingHandler
-
message: '#Parameter \#1 \$sorting of method Shopware\\Bundle\\SearchBundleDBAL\\SortingHandler\\.*SortingHandler::addSorting\(\) expects Shopware\\Bundle\\SearchBundle\\Sorting\\.*Sorting, Shopware\\Bundle\\SearchBundle\\SortingInterface given#'
path: engine/Shopware/Bundle/SearchBundleDBAL/SortingHandler
-
message: '#Parameter \#1 \$condition of method Shopware\\Bundle\\CustomerSearchBundleDBAL\\ConditionHandler\\.*ConditionHandler::addCondition\(\) expects Shopware\\Bundle\\CustomerSearchBundle\\Condition\\.*Condition, Shopware\\Bundle\\SearchBundle\\ConditionInterface given#'
path: engine/Shopware/Bundle/CustomerSearchBundleDBAL/ConditionHandler
-
message: '#Parameter \#1 \$sorting of method Shopware\\Bundle\\CustomerSearchBundleDBAL\\SortingHandler\\.*SortingHandler::addSorting\(\) expects Shopware\\Bundle\\CustomerSearchBundle\\Sorting\\.*Sorting, Shopware\\Bundle\\SearchBundle\\SortingInterface given#'
path: engine/Shopware/Bundle/CustomerSearchBundleDBAL/SortingHandler
- # For testing it is not necessary to declare the whole basket array correctly
message: '#Parameter \#1 \$basket of method Shopware\\Components\\BasketSignature\\BasketSignatureGenerator::generateSignature\(\) expects array.*, array.* given#'
path: tests/Unit/Components/BasketSignature/BasketSignatureCreatorTest.php