forked from doctrine/mongodb-odm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphpstan-baseline.neon
298 lines (244 loc) · 17.7 KB
/
phpstan-baseline.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
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
parameters:
ignoreErrors:
# Adding a parameter would be BC-break
-
message: "#^PHPDoc tag @param references unknown parameter\\: \\$applyFilters$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/Aggregation/Builder.php
# Making classes final as suggested would be a BC-break
-
message: "#^Unsafe usage of new static\\(\\)\\.$#"
paths:
- lib/Doctrine/ODM/MongoDB/Aggregation/Expr.php
- lib/Doctrine/ODM/MongoDB/DocumentManager.php
# This cannot be solved the way it is, see https://github.com/vimeo/psalm/issues/5788
-
message: "#^Return type \\(Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\ClassMetadataFactory\\) of method Doctrine\\\\ODM\\\\MongoDB\\\\DocumentManager\\:\\:getMetadataFactory\\(\\) should be compatible with return type \\(Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadataFactory\\<Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\<object\\>\\>\\) of method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getMetadataFactory\\(\\)$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/DocumentManager.php
# The limit option in GeoNear has been removed in MongoDB 4.2 in favor of $limit stage
-
message: "#^Return type \\(Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\GeoNear\\) of method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\GeoNear\\:\\:limit\\(\\) should be compatible with return type \\(Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\Limit\\) of method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\:\\:limit\\(\\)$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/Aggregation/Stage/GeoNear.php
-
message: "#DOCTRINE_MONGODB_DATABASE not found\\.$#"
paths:
- tests/Doctrine/ODM/MongoDB/Tests/BaseTest.php
- tests/Doctrine/ODM/MongoDB/Tests/DocumentRepositoryTest.php
- tests/Doctrine/ODM/MongoDB/Tests/Id/IncrementGeneratorTest.php
- tests/Doctrine/ODM/MongoDB/Tests/QueryTest.php
-
message: "#DOCTRINE_MONGODB_SERVER not found\\.$#"
paths:
- tests/Doctrine/ODM/MongoDB/Tests/BaseTest.php
-
message: "#^Parameter \\#1 \\$builder of method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\Facet\\:\\:pipeline\\(\\) expects Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Builder\\|Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage, stdClass given\\.$#"
count: 1
path: tests/Doctrine/ODM/MongoDB/Tests/Aggregation/Stage/FacetTest.php
-
message: "#^Class Documents\\\\Account does not have a constructor and must be instantiated without any parameters\\.$#"
count: 4
path: tests/Doctrine/ODM/MongoDB/Tests/DocumentRepositoryTest.php
-
message: "#^Cannot access property \\$username on array\\|object\\.$#"
count: 1
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/CustomFieldNameTest.php
-
message: "#^Cannot call method current\\(\\) on array\\|int\\|object\\.$#"
count: 1
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/EcommerceTest.php
-
message: "#^Cannot call method next\\(\\) on array\\|int\\|object\\.$#"
count: 1
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/EcommerceTest.php
-
message: "#^Cannot call method valid\\(\\) on array\\|int\\|object\\.$#"
count: 1
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/EcommerceTest.php
-
message: "#^Cannot call method getCount\\(\\) on array\\|int\\|object\\.$#"
count: 1
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/FindAndModifyTest.php
-
message: "#^Cannot call method getUsername\\(\\) on array\\|int\\|object\\.$#"
count: 3
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/FindAndModifyTest.php
-
message: "#^Cannot call method toArray\\(\\) on array\\|int\\|object\\.$#"
count: 2
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/FunctionalTest.php
-
message: "#^Expression \"\\$groups\\[0\\]\" on a separate line does not do anything\\.$#"
count: 1
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/FunctionalTest.php
-
message: "#^Cannot call method getCount\\(\\) on array\\|int\\|object\\.$#"
count: 3
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/IdentifiersTest.php
-
message: "#^Cannot call method getProfile\\(\\) on array\\|object\\.$#"
count: 2
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/InheritanceTest.php
-
message: "#^Cannot access property \\$blogPosts on array\\|object\\.$#"
count: 2
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/OwningAndInverseReferencesTest.php
-
message: "#^Cannot access property \\$name on array\\|object\\.$#"
count: 1
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/OwningAndInverseReferencesTest.php
-
message: "#^Cannot call method getUsername\\(\\) on array\\|object\\.$#"
count: 1
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/QueryTest.php
-
message: "#^Cannot call method toArray\\(\\) on array\\|int\\|object\\.$#"
count: 2
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/QueryTest.php
-
message: "#^Cannot call method current\\(\\) on array\\|int\\|object\\.$#"
count: 1
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH267Test.php
-
message: "#^Cannot access property \\$ref on array\\|object\\.$#"
count: 2
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH520Test.php
-
message: "#^Unreachable statement \\- code above always terminates\\.$#"
count: 1
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH580Test.php
-
message: "#^Cannot call method current\\(\\) on array\\|int\\|object\\.$#"
count: 1
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH852Test.php
-
message: "#^Cannot call method getBody\\(\\) on array\\|object\\.$#"
count: 1
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/MODM88Test.php
-
message: "#^Cannot call method getTitle\\(\\) on array\\|object\\.$#"
count: 1
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/MODM88Test.php
-
message: "#^Cannot call method setTitle\\(\\) on array\\|object\\.$#"
count: 1
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/MODM88Test.php
-
message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\Mapping\\\\ClassMetadata\\<object\\>\\:\\:mapField\\(\\)\\.$#"
count: 1
path: tests/Doctrine/ODM/MongoDB/Tests/Mapping/ClassMetadataLoadEventTest.php
-
message: "#^Parameter \\#1 \\$primer of method Doctrine\\\\ODM\\\\MongoDB\\\\Query\\\\Builder\\:\\:prime\\(\\) expects bool\\|\\(callable\\(\\)\\: mixed\\), 1 given\\.$#"
count: 1
path: tests/Doctrine/ODM/MongoDB/Tests/Query/BuilderTest.php
-
message: "#^Cannot access property \\$pet on array\\|object\\.$#"
count: 1
path: tests/Doctrine/ODM/MongoDB/Tests/QueryTest.php
-
message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\SchemaManagerTest\\:\\:writeOptions\\(\\) should return PHPUnit\\\\Framework\\\\Constraint\\\\Constraint but returns PHPUnit\\\\Framework\\\\Constraint\\\\ArraySubset\\.$#"
count: 1
path: tests/Doctrine/ODM/MongoDB/Tests/SchemaManagerTest.php
# import type in PHPStan does not work, see https://github.com/phpstan/phpstan/issues/5091
-
message: "#^Access to offset '.+' on an unknown class Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\FieldMapping\\.$#"
count: 12
path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php
# import type in PHPStan does not work, see https://github.com/phpstan/phpstan/issues/5091
-
message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\:\\:getMapping\\(\\) should return array\\{type\\: string, fieldName\\: string, name\\: string, isCascadeRemove\\: bool, isCascadePersist\\: bool, isCascadeRefresh\\: bool, isCascadeMerge\\: bool, isCascadeDetach\\: bool, \\.\\.\\.\\} but returns Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\FieldMapping\\|null\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php
# import type in PHPStan does not work, see https://github.com/phpstan/phpstan/issues/5091
-
message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\:\\:\\$mapping has unknown class Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\FieldMapping as its type\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php
# import type in PHPStan does not work, see https://github.com/phpstan/phpstan/issues/5091
-
message: "#^Property Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\<TKey of \\(int\\|string\\),T of object\\>\\:\\:\\$mapping \\(Doctrine\\\\ODM\\\\MongoDB\\\\PersistentCollection\\\\FieldMapping\\|null\\) does not accept array\\<string, array\\<int\\|string, mixed\\>\\|bool\\|int\\|string\\|null\\>\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php
# There is no way to define a generic array as attribute
-
message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\UnitOfWork\\:\\:getById\\(\\) should return T of object but returns object\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/UnitOfWork.php
# That statement is never reached because DateTimeInterface is either DateTimeImmutable or DateTime
-
message: "#^Unreachable statement \\- code above always terminates\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/Types/DateImmutableType.php
# These classes are not final
-
message: "#^Unsafe call to private method Doctrine\\\\ODM\\\\MongoDB\\\\Query\\\\Expr\\:\\:convertExpression\\(\\) through static::\\.$#"
count: 3
path: lib/Doctrine/ODM/MongoDB/Query/Expr.php
-
message: "#^Unsafe call to private method Doctrine\\\\ODM\\\\MongoDB\\\\Types\\\\DateType\\:\\:craftDateTime\\(\\) through static::\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/Types/DateType.php
# False positive, the exception is thrown
-
message: "#^Dead catch \\- MongoDB\\\\Driver\\\\Exception\\\\BulkWriteException is never thrown in the try block\\.$#"
count: 1
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/Ticket/GH580Test.php
# Properties are not covariant
-
message: "#^PHPDoc type Doctrine\\\\Common\\\\Collections\\\\Collection\\<int, Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ChildDocumentWithDiscriminator\\> of property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ParentDocumentWithDiscriminator\\:\\:\\$embeddedChildren is not covariant with PHPDoc type array\\<Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ChildDocument\\>\\|Doctrine\\\\Common\\\\Collections\\\\Collection\\<int, Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ChildDocument\\> of overridden property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ParentDocument\\:\\:\\$embeddedChildren\\.$#"
count: 1
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/DiscriminatorsDefaultValueTest.php
-
message: "#^PHPDoc type array\\<Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ChildDocumentWithDiscriminator\\>\\|Doctrine\\\\Common\\\\Collections\\\\Collection\\<int, Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ChildDocumentWithDiscriminator\\> of property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ParentDocumentWithDiscriminator\\:\\:\\$referencedChildren is not covariant with PHPDoc type array\\<Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ChildDocument\\>\\|Doctrine\\\\Common\\\\Collections\\\\Collection\\<int, Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ChildDocument\\> of overridden property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ParentDocument\\:\\:\\$referencedChildren\\.$#"
count: 1
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/DiscriminatorsDefaultValueTest.php
-
message: "#^PHPDoc type array\\<Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ChildDocumentWithDiscriminator\\>\\|Doctrine\\\\Common\\\\Collections\\\\Collection\\<int, Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ChildDocumentWithDiscriminator\\> of property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ParentDocumentWithoutDiscriminator\\:\\:\\$embeddedChildren is not covariant with PHPDoc type array\\<Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ChildDocument\\>\\|Doctrine\\\\Common\\\\Collections\\\\Collection\\<int, Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ChildDocument\\> of overridden property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ParentDocument\\:\\:\\$embeddedChildren\\.$#"
count: 1
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/DiscriminatorsDefaultValueTest.php
-
message: "#^PHPDoc type array\\<Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ChildDocumentWithDiscriminator\\>\\|Doctrine\\\\Common\\\\Collections\\\\Collection\\<int, Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ChildDocumentWithDiscriminator\\> of property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ParentDocumentWithoutDiscriminator\\:\\:\\$referencedChildren is not covariant with PHPDoc type array\\<Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ChildDocument\\>\\|Doctrine\\\\Common\\\\Collections\\\\Collection\\<int, Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ChildDocument\\> of overridden property Doctrine\\\\ODM\\\\MongoDB\\\\Tests\\\\Functional\\\\ParentDocument\\:\\:\\$referencedChildren\\.$#"
count: 1
path: tests/Doctrine/ODM/MongoDB/Tests/Functional/DiscriminatorsDefaultValueTest.php
# Collection elements cannot be covariant, see https://github.com/doctrine/collections/pull/220
-
message: "#^Parameter \\#2 \\$projects of class Documents\\\\Developer constructor expects Doctrine\\\\Common\\\\Collections\\\\Collection\\<int, Documents\\\\Project\\>\\|null, Doctrine\\\\Common\\\\Collections\\\\ArrayCollection\\<int, Documents\\\\SubProject\\> given\\.$#"
count: 1
path: tests/Doctrine/ODM/MongoDB/Tests/DocumentRepositoryTest.php
# See https://github.com/phpstan/phpstan/issues/5860
-
message: "#^Method Doctrine\\\\ODM\\\\MongoDB\\\\UnitOfWork\\:\\:getOrCreateDocument\\(\\) should return T of object but returns \\(Doctrine\\\\Persistence\\\\NotifyPropertyChanged&ProxyManager\\\\Proxy\\\\GhostObjectInterface&T of object\\)\\|\\(ProxyManager\\\\Proxy\\\\GhostObjectInterface&T of object\\)\\|T of object\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/UnitOfWork.php
# 'strategy' offset is defined as nullable, but here there is no check here
-
message: "#^Offset 'strategy' does not exist on array\\{\\}\\|array\\{type\\?\\: string, fieldName\\: string, name\\: string, isCascadeRemove\\: bool, isCascadePersist\\: bool, isCascadeRefresh\\: bool, isCascadeMerge\\: bool, isCascadeDetach\\: bool, \\.\\.\\.\\}\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/UnitOfWork.php
# When iterating over SimpleXMLElement, we cannot know the key values
-
message: "#^Parameter \\#2 \\$mapping of method Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\Driver\\\\XmlDriver\\:\\:addFieldMapping\\(\\) expects array\\{type\\?\\: string, fieldName\\?\\: string, name\\?\\: string, strategy\\?\\: string, association\\?\\: int, id\\?\\: bool, isOwningSide\\?\\: bool, collectionClass\\?\\: class\\-string, \\.\\.\\.\\}, array\\<int\\|string, non\\-empty\\-array\\<int, string\\>\\|bool\\|string\\> given\\.$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php
# This is handled by a try-catch block
-
message: "#^Unable to resolve the template type T in call to method Doctrine\\\\ODM\\\\MongoDB\\\\DocumentManager\\:\\:getClassMetadata\\(\\)$#"
paths:
- lib/Doctrine/ODM/MongoDB/Aggregation/Stage/GraphLookup.php
- lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Lookup.php
- lib/Doctrine/ODM/MongoDB/Aggregation/Stage/Out.php
# $this->mapping['targetDocument'] is class-string<T>
-
message: "#^Unable to resolve the template type T in call to method Doctrine\\\\ODM\\\\MongoDB\\\\DocumentManager\\:\\:getClassMetadata\\(\\)$#"
count: 1
path: lib/Doctrine/ODM/MongoDB/PersistentCollection.php
-
message: "#Property .+ is never written, only read.#"
path: tests
-
message: "#Property .+ is never read, only written.#"
path: tests
-
message: "#Property .+ is unused.#"
path: tests