-
-
Notifications
You must be signed in to change notification settings - Fork 166
Expand file tree
/
Copy pathphpstan.neon
More file actions
176 lines (150 loc) · 12.2 KB
/
phpstan.neon
File metadata and controls
176 lines (150 loc) · 12.2 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
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
includes:
- phpstan-baseline.neon
- vendor/phpstan/phpstan-webmozart-assert/extension.neon
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/phpstan/phpstan-phpunit/rules.neon
parameters:
level: max
reportUnmatchedIgnoredErrors: false
paths:
- 'src/'
excludePaths:
# External vendor dependencies installed via composer in Component
# These are third-party packages that shouldn't be analyzed
- 'src/Component/vendor/'
# PHPSpec tests use a different syntax and structure than regular PHP code
# They contain specs with methods like it_*() and shouldReturn() that PHPStan doesn't understand
- 'src/Bundle/spec/'
- 'src/Component/spec/'
# PHPUnit tests - test code is not production code and has different quality requirements
# Tests often use mocks, stubs and test-specific patterns
- 'src/Bundle/Tests/'
- 'src/Component/tests/'
# MongoDB ODM integration - requires doctrine/mongodb-odm which is optional
# These files contain references to MongoDB classes that don't exist without the package
- 'src/Bundle/Doctrine/ODM/'
- 'src/Bundle/EventListener/ODM*'
- 'src/Bundle/DependencyInjection/Driver/Doctrine/DoctrineODMDriver.php'
# Legacy code maintained for backward compatibility
# Contains deprecated interfaces and implementations that will be removed in 2.0
- 'src/Component/legacy/'
# Parameters.php extends Symfony's ParameterBag but changes return type covariance
# This is a known limitation that cannot be fixed without breaking BC
# PHPStan reports: "Return type mixed of method Parameters::get() is not covariant with
# return type mixed of method ParameterBag::get()"
- 'src/Bundle/Controller/Parameters.php'
# ResourceMetadata will need to use the generic T
- 'src/Component/src/Metadata/ResourceMetadata.php'
ignoreErrors:
# Optional MongoDB ODM support - requires doctrine/mongodb-odm-bundle package
# These classes are only loaded when MongoDB driver is configured and the bundle is installed
# See: src/Bundle/AbstractResourceBundle.php:112
- '/Class Doctrine\\Bundle\\MongoDBBundle\\DependencyInjection\\Compiler\\DoctrineMongoDBMappingsPass not found/'
- '/Class Doctrine\\ODM\\MongoDB\\DocumentManager not found/'
- '/has invalid type Doctrine\\MongoDB\\Query\\Builder/'
# Optional PHPCR ODM support - requires doctrine/phpcr-bundle package
# PHPCR is deprecated since 1.3 and will be removed in 2.0
# See: src/Bundle/AbstractResourceBundle.php:120-127
- '/Class Doctrine\\Bundle\\PHPCRBundle\\DependencyInjection\\Compiler\\DoctrinePhpcrMappingsPass not found/'
- '/Class Doctrine\\ODM\\PHPCR\\Document\\Resource not found/'
- '/has invalid type Doctrine\\ODM\\PHPCR\\Query\\Builder\\QueryBuilder/'
- '/has invalid type Doctrine\\ODM\\PHPCR\\DocumentManagerInterface/'
# Optional HateoasBundle support - requires willdurand/hateoas-bundle
- '/Call to method createRepresentation\(\) on an unknown class Hateoas\\Representation\\Factory\\PagerfantaFactory/'
- '/Class Hateoas\\Representation\\Factory\\PagerfantaFactory not found/'
- '/Instantiated class Hateoas\\Configuration\\Route not found/'
- '/Parameter \$pagerfantaRepresentationFactory of method Sylius\\Bundle\\ResourceBundle\\Controller\\ResourcesCollectionProvider::__construct\(\) has invalid type Hateoas\\Representation\\Factory\\PagerfantaFactory/'
- '/Property Sylius\\Bundle\\ResourceBundle\\Controller\\ResourcesCollectionProvider::\$pagerfantaRepresentationFactory has unknown class Hateoas\\Representation\\Factory\\PagerfantaFactory as its type/'
# Optional FOS RestBundle support - requires friendsofsymfony/rest-bundle
- '/Call to method getContext\(\) on an unknown class FOS\\RestBundle\\View\\View/'
- '/Call to method handle\(\) on an unknown class FOS\\RestBundle\\View\\ConfigurableViewHandlerInterface/'
- '/Call to method setExclusionStrategyGroups\(\) on an unknown class FOS\\RestBundle\\View\\ConfigurableViewHandlerInterface/'
- '/Call to method setExclusionStrategyVersion\(\) on an unknown class FOS\\RestBundle\\View\\ConfigurableViewHandlerInterface/'
- '/Parameter \$restViewHandler of method Sylius\\Bundle\\ResourceBundle\\Controller\\ViewHandler::__construct\(\) has invalid type FOS\\RestBundle\\View\\ConfigurableViewHandlerInterface/'
- '/Parameter \$view of method Sylius\\Bundle\\ResourceBundle\\Controller\\ViewHandler::handle\(\) has invalid type FOS\\RestBundle\\View\\View/'
- '/Parameter \$view of method Sylius\\Bundle\\ResourceBundle\\Controller\\ViewHandlerInterface::handle\(\) has invalid type FOS\\RestBundle\\View\\View/'
- '/Property Sylius\\Bundle\\ResourceBundle\\Controller\\ViewHandler::\$restViewHandler has unknown class FOS\\RestBundle\\View\\ConfigurableViewHandlerInterface as its type/'
# Optional Winzou StateMachine support - requires winzou/state-machine package
- '/Access to an undefined property Sylius\\Resource\\StateMachine\\StateMachine::\$config/'
- '/Call to an undefined method Sylius\\Resource\\StateMachine\\StateMachine::getPossibleTransitions\(\)/'
- '/Call to method get\(\) on an unknown class SM\\Factory\\Factory/'
- '/Class SM\\Callback\\CallbackFactoryInterface not found/'
- '/Class SM\\Callback\\CascadeTransitionCallback not found/'
- '/Class SM\\Factory\\FactoryInterface not found/'
- '/Class winzou\\Bundle\\StateMachineBundle\\winzouStateMachineBundle not found/'
- '/Method Sylius\\Resource\\Winzou\\StateMachine\\OperationStateMachine::getFactory\(\) has invalid return type SM\\Factory\\Factory/'
- '/Parameter \$factory of method Sylius\\Resource\\Winzou\\StateMachine\\OperationStateMachine::__construct\(\) has invalid type SM\\Factory\\Factory/'
- '/Parameter \$stateMachineFactory of method Sylius\\Bundle\\ResourceBundle\\Controller\\StateMachine::__construct\(\) has invalid type SM\\Factory\\FactoryInterface/'
- '/Property Sylius\\Bundle\\ResourceBundle\\Controller\\StateMachine::\$stateMachineFactory has unknown class SM\\Factory\\FactoryInterface as its type/'
- '/Property Sylius\\Resource\\Winzou\\StateMachine\\OperationStateMachine::\$factory has unknown class SM\\Factory\\Factory as its type/'
# Optional Symfony Workflow support - requires symfony/workflow
- '/Call to method get\(\) on an unknown class \Symfony\\Component\\Workflow\\Registry/'
- '/Method Sylius\\Resource\\Symfony\\Workflow\\OperationStateMachine::getRegistry\(\) has invalid return type Symfony\\Component\\Workflow\\Registry/'
- '/Parameter \$registry of method Sylius\\Bundle\\ResourceBundle\\Controller\\Workflow::__construct\(\) has invalid type Symfony\\Component\\Workflow\\Registry/'
- '/Parameter \$registry of method Sylius\\Resource\\Symfony\\Workflow\\OperationStateMachine::__construct\(\) has invalid type Symfony\\Component\\Workflow\\Registry/'
- '/Property Sylius\\Bundle\\ResourceBundle\\Controller\\Workflow::\$registry has unknown class Symfony\\Component\\Workflow\\Registry as its type/'
- '/Property Sylius\\Resource\\Symfony\\Workflow\\OperationStateMachine::\$registry has unknown class Symfony\\Component\\Workflow\\Registry as its type/'
# Backward compatibility with Doctrine Common 2.x
# Namespace moved from Doctrine\Common\Persistence to Doctrine\Persistence in 3.x
# Code uses both namespaces with aliases to support both versions
# See: src/Bundle/DependencyInjection/Driver/Doctrine/AbstractDoctrineDriver.php:46
- '/Class Doctrine\\Common\\Persistence\\ObjectManager not found/'
# Doctrine ORM 3.x introduces new mapping classes
# AssociationMapping class exists only in ORM 3.x, not in ORM 2.x
# Code supports both versions, so we need to ignore these errors when running with ORM 2.x
# See: src/Bundle/EventListener/ORMMappedSuperClassSubscriber.php
- '/Class Doctrine\\ORM\\Mapping\\AssociationMapping not found/'
- '/Call to method .* on an unknown class Doctrine\\ORM\\Mapping\\AssociationMapping/'
- '/PHPDoc tag @var for variable .* contains unknown class Doctrine\\ORM\\Mapping\\AssociationMapping/'
# Optional symfony/web-link component - only used when installed
# Code checks class_exists() before using these classes
# See: src/Bundle/Controller/ControllerTrait.php:443-448
- '/has invalid type Psr\\Link\\LinkInterface/'
- '/Class Symfony\\Component\\WebLink\\GenericLinkProvider not found/'
- '/Instantiated class Symfony\\Component\\WebLink\\GenericLinkProvider not found/'
# Backward compatibility with deprecated Symfony ExpressionLanguage cache interfaces
# ParserCacheInterface was removed in Symfony 4.0, replaced by PSR-6 CacheItemPoolInterface
# Code provides BC layer with trigger_deprecation
# See: src/Bundle/ExpressionLanguage/ExpressionLanguage.php:29-40
- '/Class Symfony\\Component\\ExpressionLanguage\\ParserCache\\ParserCacheInterface not found/'
- '/Instantiated class Symfony\\Component\\ExpressionLanguage\\ParserCache\\ParserCacheAdapter not found/'
# Symfony Config Component uses fluent interface with dynamic return types
# getRootNode() returns NodeDefinition which gets transformed to ArrayNodeDefinition
# when children() is called. PHPStan cannot track these runtime type transformations
# See: src/Bundle/DependencyInjection/Configuration.php:30-37
- '/Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeParentInterface::(end|variableNode|scalarNode)\(\)/'
# Symfony Dependency Injection Component can use ReflectionClass type as second argument instead of Reflector one.
- '/Parameter #2 \$configurator of method Symfony\\Component\\DependencyInjection\\ContainerBuilder::registerAttributeForAutoconfiguration\(\)/'
# Backward compatibility for Symfony DependencyInjection Alias::setDeprecated()
# Method signature changed between Symfony versions:
# - Symfony < 5.1: setDeprecated($status, $message)
# - Symfony >= 5.1: setDeprecated($package, $version, $message)
# Code dynamically detects parameter count and calls appropriately
# See: src/Bundle/DependencyInjection/Compiler/PagerfantaBridgePass.php:62-73
- '/Method Symfony\\Component\\DependencyInjection\\Alias::setDeprecated\(\) invoked with 2 parameters, 3 required/'
- '/Parameter #1 \$package of method Symfony\\Component\\DependencyInjection\\Alias::setDeprecated\(\) expects string, true given/'
# ResourceControllerEvent uses if(false) for IDE support - provides class alias hint
# This is intentional dead code to help IDEs understand the class_alias in GenericEvent.php
# See: src/Bundle/Event/ResourceControllerEvent.php:18-22
-
message: '#If condition is always false#'
path: src/Bundle/Event/ResourceControllerEvent.php
# Symfony <7.4 - TreeBuilder and ArrayNodeDefinition are not generic in Symfony < 7.4
# but are generic in Symfony 7.4+. We use generics for better type safety in newer versions.
- message: '#^PHPDoc tag .+ is not generic\.$#'
identifier: generics.notGeneric
count: 11
path: src/Bundle/DependencyInjection/Configuration.php
- message: '#^PHPDoc tag .+ is not generic\.$#'
identifier: generics.notGeneric
count: 5
path: src/Bundle/DependencyInjection/PagerfantaConfiguration.php
- message: '#^PHPDoc tag .+ is not generic\.$#'
identifier: generics.notGeneric
count: 3
path: src/Bundle/Routing/Configuration.php
# CachedTrait returns a mixed type
- message: '/Method Sylius\\Resource\\Metadata\\Resource\\Factory\\CachedResourceClassListFactory::create\(\) should return Sylius\\Resource\\Metadata\\Resource\\ResourceClassList but returns mixed/'
identifier: return.type
count: 1
path: src/Component/src/Metadata/Resource/Factory/CachedResourceClassListFactory.php