forked from api-platform/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpstan.neon.dist
More file actions
180 lines (172 loc) · 7.27 KB
/
phpstan.neon.dist
File metadata and controls
180 lines (172 loc) · 7.27 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
177
178
179
180
parameters:
level: 6
paths:
- src
- tests
- tests/Fixtures/app/console
inferPrivatePropertyTypeFromConstructor: true
treatPhpDocTypesAsCertain: false
symfony:
containerXmlPath: tests/Fixtures/app/var/cache/test/AppKernelTestDebugContainer.xml
constantHassers: false
doctrine:
objectManagerLoader: tests/Fixtures/app/object-manager.php
bootstrapFiles:
# We're aliasing classes for phpunit in this file, it needs to be added here see phpstan/#2194
- src/Symfony/Bundle/Test/Constraint/ArraySubset.php
- tests/Fixtures/app/AppKernel.php
excludePaths:
# uses larastan
- src/Laravel
# Symfony config
- tests/Fixtures/app/config/config_swagger.php
# Symfony cache
- tests/Fixtures/app/var/
- tests/Fixtures/Symfony/Maker
# The Symfony Configuration API isn't good enough to be analysed
- src/Symfony/Bundle/DependencyInjection/Configuration.php
# Templates for Maker
- src/Symfony/Maker/Resources/skeleton
# subtree split
- src/Doctrine/Orm/Tests/var/*
- src/Doctrine/Odm/Tests/var/*
- src/Doctrine/*/vendor/*
- src/*/vendor/*
# Symfony 6 support
- src/Symfony/Bundle/ArgumentResolver/CompatibleValueResolverInterface.php
earlyTerminatingMethodCalls:
PHPUnit\Framework\Constraint\Constraint:
- fail
ApiPlatform\Metadata\Resource\ResourceMetadataCollection:
- handleNotFound
ignoreErrors:
# False positives
- message: '#Call to an undefined method Negotiation\\AcceptHeader::getType\(\).#'
-
message: '#but database expects#'
paths:
- tests/Fixtures/TestBundle/Entity/
- '#Cannot call method add\(\) on iterable.#'
-
message: '#is never read, only written.#'
paths:
- tests/Fixtures/TestBundle/Document/
- tests/Fixtures/TestBundle/Entity/
- src/OpenApi/Factory/OpenApiFactory.php
-
message: '#is never assigned .* so it can be removed from the property type.#'
paths:
- src/Doctrine/Common/Tests/Fixtures/
- src/Doctrine/Orm/Tests/Fixtures/
- src/Doctrine/Odm/Tests/Fixtures/
- src/Elasticsearch/Tests/Fixtures/
- src/GraphQl/Tests/Fixtures/
- src/JsonSchema/Tests/Fixtures/
- src/Metadata/Tests/Fixtures/
- src/Serializer/Tests/Fixtures/
- tests/Fixtures/
-
message: '#is never written, only read.#'
paths:
- tests/Fixtures/TestBundle/Document/
- src/Metadata/Tests/Fixtures/ApiResource/
- '#Access to an undefined property Prophecy\\Prophecy\\ObjectProphecy<(\\?[a-zA-Z0-9_]+)+>::\$[a-zA-Z0-9_]+#'
# https://github.com/phpstan/phpstan-symfony/issues/76
-
message: '#Service "test" is not registered in the container\.#'
path: src/GraphQl/Tests/Type/TypesContainerTest.php
# Expected, due to optional interfaces
- '#Method Symfony\\Component\\Serializer\\NameConverter\\NameConverterInterface::denormalize\(\) invoked with (2|3|4) parameters, 1 required\.#'
- '#Method Symfony\\Component\\Serializer\\NameConverter\\NameConverterInterface::normalize\(\) invoked with (2|3|4) parameters, 1 required\.#'
# Expected, due to backward compatibility
- '#Method GraphQL\\Type\\Definition\\WrappingType::getWrappedType\(\) invoked with 1 parameter, 0 required\.#'
- '#Access to an undefined property GraphQL\\Type\\Definition\\NamedType&GraphQL\\Type\\Definition\\Type::\$name\.#'
- "#Call to function method_exists\\(\\) with GraphQL\\\\Type\\\\Definition\\\\Type&GraphQL\\\\Type\\\\Definition\\\\WrappingType and 'getInnermostType' will always evaluate to true\\.#"
- "#Call to function method_exists\\(\\) with Symfony\\\\Component\\\\Console\\\\Application and 'addCommand' will always evaluate to false\\.#"
- "#Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component\\\\\\\\PropertyInfo\\\\\\\\PropertyInfoExtractor' and 'getType' will always evaluate to true\\.#"
- "#Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component\\\\\\\\HttpFoundation\\\\\\\\Request' and 'getContentTypeFormat' will always evaluate to true\\.#"
- '#Call to an undefined method Symfony\\Component\\HttpFoundation\\Request::getContentType\(\)\.#'
- "#Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component\\\\\\\\Serializer\\\\\\\\Serializer' and 'getSupportedTypes' will always evaluate to true\\.#"
- "#Call to function method_exists\\(\\) with Symfony\\\\Component\\\\Serializer\\\\Normalizer\\\\NormalizerInterface and 'getSupportedTypes' will always evaluate to true\\.#"
- "#Call to function method_exists\\(\\) with Doctrine\\\\ODM\\\\MongoDB\\\\Configuration and 'setMetadataCache' will always evaluate to true\\.#"
- "#Call to function method_exists\\(\\) with Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\ClassMetadata\\|Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata and 'isChangeTrackingDef…' will always evaluate to true\\.#"
-
message: '#Instanceof between Symfony\\Component\\Serializer\\NameConverter\\NameConverterInterface and Symfony\\Component\\Serializer\\NameConverter\\MetadataAwareNameConverter will always evaluate to false\.#'
paths:
- src/GraphQl/Serializer/SerializerContextBuilder.php
- src/GraphQl/Type/FieldsBuilder.php
-
message: '#Instanceof between Symfony\\Component\\Serializer\\NameConverter\\NameConverterInterface\|null and Symfony\\Component\\Serializer\\NameConverter\\MetadataAwareNameConverter will always evaluate to false\.#'
paths:
- src/Serializer/AbstractConstraintViolationListNormalizer.php
- src/Symfony/Validator/Serializer/ValidationExceptionNormalizer.php
# See https://github.com/phpstan/phpstan-symfony/issues/27
-
message: '#^Service "[^"]+" is private.$#'
path: src
# Allow extra assertions in tests: https://github.com/phpstan/phpstan-strict-rules/issues/130
- '#^Call to (static )?method PHPUnit\\Framework\\Assert::.* will always evaluate to true\.$#'
# Unsealed array shapes not supported
-
message: '#^Parameter &\$context by\-ref type of method ApiPlatform\\Doctrine\\Odm\\Extension\\ParameterExtension\:\:applyFilter\(\) expects array\<string, mixed\>, array(.*) given\.$#'
identifier: parameterByRef.type
count: 5
path: src/Doctrine/Odm/Extension/ParameterExtension.php
# Level 6
-
identifier: missingType.iterableValue
-
identifier: missingType.generics
-
identifier: missingType.property
paths:
- src/Doctrine/Common/Tests
- src/Doctrine/Odm/Tests
- src/Doctrine/Orm/Tests
- src/Elasticsearch/Tests
- src/Hydra/Tests
- src/JsonApi/Tests
- src/JsonSchema/Tests
- src/Metadata/Tests
- src/Serializer/Tests
- src/Symfony/Tests
- tests
-
identifier: missingType.parameter
paths:
- src/Doctrine/Common/Tests
- src/Doctrine/Odm/Tests
- src/Doctrine/Orm/Tests
- src/Elasticsearch/Tests
- src/GraphQl/Tests
- src/Hydra/Tests
- src/JsonApi/Tests
- src/JsonSchema/Tests
- src/Metadata/Tests
- src/OpenApi/Tests
- src/Serializer/Tests
- src/Symfony/Bundle/Test
- src/Symfony/Tests
- tests
-
identifier: missingType.return
paths:
- src/Doctrine/Common/Tests
- src/Doctrine/Odm/Tests
- src/Doctrine/Orm/Tests
- src/Elasticsearch/Tests
- src/GraphQl/Tests
- src/Hydra/Tests
- src/JsonApi/Tests
- src/JsonSchema/Tests
- src/Metadata/Tests
- src/OpenApi/Tests
- src/Serializer/Tests
- src/Symfony/Tests
- tests
-
identifier: argument.templateType
paths:
- src/Symfony/Bundle/Test
- tests
- src # TODO