forked from shopware5/shopware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.phpstan.neon
106 lines (102 loc) · 8.25 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
includes:
#- ../vendor/phpstan/phpstan-phpunit/rules.neon
#- ../vendor/phpstan/phpstan-phpunit/extension.neon
#- ../vendor/phpstan/phpstan-doctrine/extension.neon
parameters:
level: 5
inferPrivatePropertyTypeFromConstructor: true
reportUnmatchedIgnoredErrors: false
autoload_directories:
- %currentWorkingDirectory%/var/cache
- %currentWorkingDirectory%/engine/Library
autoload_files:
- %currentWorkingDirectory%/vendor/autoload.php
paths:
- %currentWorkingDirectory%/engine/Shopware
excludes_analyse:
- %currentWorkingDirectory%/engine/Shopware/Plugins
- %currentWorkingDirectory%/engine/Shopware/Configs/Default.php
# Broken external interface definition
- %currentWorkingDirectory%/engine/Shopware/Bundle/SearchBundleES/CombinedConditionQueryBuilder.php
- %currentWorkingDirectory%/engine/Shopware/Components/Emotion/EmotionImporter.php # zip::locateName does not annotate correct return type
- %currentWorkingDirectory%/engine/Shopware/Components/Theme/Compiler.php # fwrite does not annotate correct return type
# Broken internal interface usage
- %currentWorkingDirectory%/engine/Shopware/Components/Log/Handler/FirePHPHandler.php
- %currentWorkingDirectory%/engine/Shopware/Components/DependencyInjection/Container.php
# Unsure how to fix
- %currentWorkingDirectory%/engine/Shopware/Models/Media/MediaSubscriber.php
- %currentWorkingDirectory%/engine/Shopware/Controllers/Backend/Property.php
- %currentWorkingDirectory%/engine/Shopware/Models/Document/Order.php
- %currentWorkingDirectory%/engine/Shopware/Components/Session/PdoSessionHandler.php
- %currentWorkingDirectory%/engine/Shopware/Components/DependencyInjection/LegacyPhpDumper.php
- %currentWorkingDirectory%/engine/Shopware/Components/ContainerAwareEventManager.php
- %currentWorkingDirectory%/engine/Shopware/Components/Install/Database.php
ignoreErrors:
- '#apcu_#'
- '#ioncube_#'
- '#opcache_#'
- '#imagettftext#'
- '#easter_days#'
- '#class Redis#'
# Ignore safety casts
- "#Casting to [a-zA-Z<>]+ something that's already [a-zA-Z<>]+#"
# Ignore direct view assigns
- '#Call to an undefined method#'
- '#Access to an undefined property#'
- '#Method Symfony\\Component\\DependencyInjection\\LazyProxy\\PhpDumper\\DumperInterface\:\:getProxyFactoryCode\(\)#'
- '#Shopware_Components_Snippet_Manager::__construct\(\) does not call parent constructor from Enlight_Components_Snippet_Manager#'
- '#does not call parent constructor from Enlight_Class#'
- '#Binary operation "|=" between string and string results in an error.#'
- '#does not call parent constructor from Elasticsearch#'
- '#does not call parent constructor from Enlight_Controller_Action#'
- '#does not accept Doctrine\\Common\\Persistence\\ObjectRepository#'
- '#does not call parent constructor from Enlight_Controller_Action#'
# "getRepository"-Methods
- '#should return [a-zA-Z\\_]+Repository but returns Doctrine\\ORM\\EntityRepository#'
- '#should return [a-zA-Z\\_]+Repository but returns Doctrine\\Common\\Persistence\\ObjectRepository#'
- '#Static property [a-zA-Z\\_\$\:]+ \(Shopware\\Models\\[a-zA-Z]+\\Repository\|null\) does not accept Doctrine\\ORM\\EntityRepository#'
- '#\([a-zA-Z\\_]+Repository\) does not accept Doctrine\\ORM\\EntityRepository#'
- '#\([a-zA-Z\\_]+Repository\) does not accept Doctrine\\Common\\Persistence\\ObjectRepository#'
- '#Array \(array<string, Shopware\\Components\\Model\\ModelRepository>\) does not accept Doctrine\\ORM\\EntityRepository#'
- '# should return Doctrine\\ORM\\EntityRepository|null but returns Doctrine\\Common\\Persistence\\ObjectRepository#'
# Return values in Models
- '# returns Shopware\\Components\\Model\\ModelEntity.#'
- '#does not accept Shopware\\Components\\Api\\Resource\\Resource#'
- '# but returns Doctrine\\ORM\\QueryBuilder#'
# Model properties with wrong default values
- '#\([a-z]+\) does not accept default value of type [a-z]+\.#'
# Models that are detached by cloning and nulling the id
- '#\([a-z]+\) does not accept null\.#'
- '#supplied for foreach, only iterables are supported#'
# Broken return value of Components/DependencyInjection/Container.php
- '#Return type \(bool\) of method Shopware\\Components\\DependencyInjection\\Container\:\:load\(\) should be compatible with return type \(object\) of method Symfony\\Component\\DependencyInjection\\Container\:\:load\(\)#'
# Broken return value of Components/Log/Handler/FirePHPHandler.php
- '#Return type \(array\) of method Shopware\\Components\\Log\\Handler\\FirePHPHandler\:\:createRecordHeader\(\) should be compatible with return type \(string\) of method Monolog\\Handler\\FirePHPHandler\:\:createRecordHeader\(\)#'
# 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#'
# Interfaces not being recognized
- '#expects Shopware\\Components\\Form\\Container\\[a-zA-Z]+, Shopware\\Components\\Form\\Interfaces\\Container given#'
- '#expects Doctrine\\ORM\\PersistentCollection, Doctrine\\Common\\Collections\\ArrayCollection&iterable<Shopware\\Models\\Shop\\TemplateConfig\\[a-zA-Z]+> given#'
- '#Parameter \#1 \$em of method Doctrine\\ORM\\EntityRepository::__construct\(\) expects Doctrine\\ORM\\EntityManager, Doctrine\\ORM\\EntityManagerInterface given#'
- '#Parameter \#1 \$sort of method Doctrine\\ORM\\QueryBuilder::addOrderBy\(\) expects Doctrine\\ORM\\Query\\Expr\\OrderBy|string, array given#'
- '#Parameter \#3 \$type of method Doctrine\\ORM\\QueryBuilder::setParameter\(\) expects string\|null, int given#'
- '#Parameter \#3 \$type of method Doctrine\\DBAL\\Query\\QueryBuilder::setParameter\(\) expects string\|null, int given#'
- '#Parameter \#1 \$reader of class Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver constructor expects Doctrine\\Common\\Annotations\\AnnotationReader, Doctrine\\Common\\Annotations\\Reader given#'
- '#Parameter \#1 \$request of method Shopware\\Bundle\\SearchBundle\\CriteriaRequestHandlerInterface::handleRequest\(\) expects Enlight_Controller_Request_RequestHttp, Enlight_Controller_Request_Request given#'
# Container Issues
- '#Parameter \#2 \$service of method Symfony\\Component\\DependencyInjection\\ContainerInterface::set\(\) expects object, array<Shopware\\Bundle\\SearchBundleDBAL\\[a-zA-Z]+Interface> given#'
# Wrong type in ElasticsearchDSL
- '#Parameter \#2 \$value of class ONGR\\ElasticsearchDSL\\Query\\TermQuery constructor expects string#'
- '#Parameter \#2 \$value of class ONGR\\ElasticsearchDSL\\Query\\TermLevel\\TermQuery constructor expects string#'
- '#Parameter \#2 \$value of method ONGR\\ElasticsearchDSL\\Query\\Compound\\BoolQuery::addParameter\(\) expects array\|stdClass\|string#'
- '#Parameter \#2 \$value of method ONGR\\ElasticsearchDSL\\Aggregation\\AbstractAggregation::addParameter\(\) expects array\|stdClass\|string#'
- '#should return Shopware\\Bundle\\ContentTypeBundle\\Services\\RepositoryInterface but returns object#'
# Missing array key
- "#Offset 'mediatype' does not exist on array#"
# We manually check if the class exists before instantiating / using it
- '#Instantiated class SwagPaymentPayPalUnified\\Setup\\FirstRunWizardInstaller not found#'
- '#Call to method saveConfiguration\(\) on an unknown class SwagPaymentPayPalUnified\\Setup\\FirstRunWizardInstaller#'
- '#PHPDoc tag \@var for variable \$payPalInstaller contains unknown class SwagPaymentPayPalUnified\\Setup\\FirstRunWizardInstaller#'