Skip to content

Commit 4d34a81

Browse files
authored
Add return static (#2333)
1 parent 0c0f04b commit 4d34a81

File tree

2 files changed

+62
-5
lines changed

2 files changed

+62
-5
lines changed

lib/Doctrine/ODM/MongoDB/Aggregation/Stage/MatchStage.php

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ public function __clone()
4848
*
4949
* @param array|Expr $expression
5050
* @param array|Expr ...$expressions
51+
*
52+
* @return static
5153
*/
5254
public function addAnd($expression, ...$expressions): self
5355
{
@@ -67,6 +69,8 @@ public function addAnd($expression, ...$expressions): self
6769
*
6870
* @param array|Expr $expression
6971
* @param array|Expr ...$expressions
72+
*
73+
* @return static
7074
*/
7175
public function addNor($expression, ...$expressions): self
7276
{
@@ -86,6 +90,8 @@ public function addNor($expression, ...$expressions): self
8690
*
8791
* @param array|Expr $expression
8892
* @param array|Expr ...$expressions
93+
*
94+
* @return static
8995
*/
9096
public function addOr($expression, ...$expressions): self
9197
{
@@ -99,6 +105,8 @@ public function addOr($expression, ...$expressions): self
99105
*
100106
* @see Expr::all()
101107
* @see https://docs.mongodb.com/manual/reference/operator/all/
108+
*
109+
* @return static
102110
*/
103111
public function all(array $values): self
104112
{
@@ -117,6 +125,8 @@ public function all(array $values): self
117125
* @see https://docs.mongodb.com/manual/reference/operator/elemMatch/
118126
*
119127
* @param array|Expr $expression
128+
*
129+
* @return static
120130
*/
121131
public function elemMatch($expression): self
122132
{
@@ -131,6 +141,8 @@ public function elemMatch($expression): self
131141
* @see Expr::equals()
132142
*
133143
* @param mixed $value
144+
*
145+
* @return static
134146
*/
135147
public function equals($value): self
136148
{
@@ -144,6 +156,8 @@ public function equals($value): self
144156
*
145157
* @see Expr::exists()
146158
* @see https://docs.mongodb.com/manual/reference/operator/exists/
159+
*
160+
* @return static
147161
*/
148162
public function exists(bool $bool): self
149163
{
@@ -165,6 +179,8 @@ public function expr(): Expr
165179
* Set the current field for building the expression.
166180
*
167181
* @see Expr::field()
182+
*
183+
* @return static
168184
*/
169185
public function field(string $field): self
170186
{
@@ -183,6 +199,8 @@ public function field(string $field): self
183199
* @see https://docs.mongodb.com/manual/reference/operator/geoIntersects/
184200
*
185201
* @param array|Geometry $geometry
202+
*
203+
* @return static
186204
*/
187205
public function geoIntersects($geometry): self
188206
{
@@ -199,6 +217,8 @@ public function geoIntersects($geometry): self
199217
*
200218
* @see Expr::geoWithin()
201219
* @see https://docs.mongodb.com/manual/reference/operator/geoWithin/
220+
*
221+
* @return static
202222
*/
203223
public function geoWithin(Geometry $geometry): self
204224
{
@@ -218,6 +238,8 @@ public function geoWithin(Geometry $geometry): self
218238
*
219239
* @see Expr::geoWithinBox()
220240
* @see https://docs.mongodb.com/manual/reference/operator/box/
241+
*
242+
* @return static
221243
*/
222244
public function geoWithinBox(float $x1, float $y1, float $x2, float $y2): self
223245
{
@@ -234,6 +256,8 @@ public function geoWithinBox(float $x1, float $y1, float $x2, float $y2): self
234256
*
235257
* @see Expr::geoWithinCenter()
236258
* @see https://docs.mongodb.com/manual/reference/operator/center/
259+
*
260+
* @return static
237261
*/
238262
public function geoWithinCenter(float $x, float $y, float $radius): self
239263
{
@@ -249,6 +273,8 @@ public function geoWithinCenter(float $x, float $y, float $radius): self
249273
*
250274
* @see Expr::geoWithinCenterSphere()
251275
* @see https://docs.mongodb.com/manual/reference/operator/centerSphere/
276+
*
277+
* @return static
252278
*/
253279
public function geoWithinCenterSphere(float $x, float $y, float $radius): self
254280
{
@@ -275,6 +301,8 @@ public function geoWithinCenterSphere(float $x, float $y, float $radius): self
275301
* @param array $point2 Second point of the polygon
276302
* @param array $point3 Third point of the polygon
277303
* @param array ...$points Additional points of the polygon
304+
*
305+
* @return static
278306
*/
279307
public function geoWithinPolygon($point1, $point2, $point3, ...$points): self
280308
{
@@ -300,6 +328,8 @@ public function getExpression(): array
300328
* @see https://docs.mongodb.com/manual/reference/operator/gt/
301329
*
302330
* @param mixed $value
331+
*
332+
* @return static
303333
*/
304334
public function gt($value): self
305335
{
@@ -315,6 +345,8 @@ public function gt($value): self
315345
* @see https://docs.mongodb.com/manual/reference/operator/gte/
316346
*
317347
* @param mixed $value
348+
*
349+
* @return static
318350
*/
319351
public function gte($value): self
320352
{
@@ -328,6 +360,8 @@ public function gte($value): self
328360
*
329361
* @see Expr::in()
330362
* @see https://docs.mongodb.com/manual/reference/operator/in/
363+
*
364+
* @return static
331365
*/
332366
public function in(array $values): self
333367
{
@@ -336,6 +370,9 @@ public function in(array $values): self
336370
return $this;
337371
}
338372

373+
/**
374+
* @return static
375+
*/
339376
public function includesReferenceTo(object $document): self
340377
{
341378
$this->query->includesReferenceTo($document);
@@ -350,6 +387,8 @@ public function includesReferenceTo(object $document): self
350387
*
351388
* @see Expr::language()
352389
* @see https://docs.mongodb.com/manual/reference/operator/text/
390+
*
391+
* @return static
353392
*/
354393
public function language(string $language): self
355394
{
@@ -365,6 +404,8 @@ public function language(string $language): self
365404
* @see https://docs.mongodb.com/manual/reference/operator/lte/
366405
*
367406
* @param mixed $value
407+
*
408+
* @return static
368409
*/
369410
public function lt($value): self
370411
{
@@ -380,6 +421,8 @@ public function lt($value): self
380421
* @see https://docs.mongodb.com/manual/reference/operator/lte/
381422
*
382423
* @param mixed $value
424+
*
425+
* @return static
383426
*/
384427
public function lte($value): self
385428
{
@@ -396,6 +439,8 @@ public function lte($value): self
396439
*
397440
* @param float|int $divisor
398441
* @param float|int $remainder
442+
*
443+
* @return static
399444
*/
400445
public function mod($divisor, $remainder = 0): self
401446
{
@@ -414,6 +459,8 @@ public function mod($divisor, $remainder = 0): self
414459
* @see https://docs.mongodb.com/manual/reference/operator/not/
415460
*
416461
* @param array|Expr $expression
462+
*
463+
* @return static
417464
*/
418465
public function not($expression): self
419466
{
@@ -429,6 +476,8 @@ public function not($expression): self
429476
* @see https://docs.mongodb.com/manual/reference/operator/ne/
430477
*
431478
* @param mixed $value
479+
*
480+
* @return static
432481
*/
433482
public function notEqual($value): self
434483
{
@@ -442,6 +491,8 @@ public function notEqual($value): self
442491
*
443492
* @see Expr::notIn()
444493
* @see https://docs.mongodb.com/manual/reference/operator/nin/
494+
*
495+
* @return static
445496
*/
446497
public function notIn(array $values): self
447498
{
@@ -460,6 +511,8 @@ public function notIn(array $values): self
460511
*
461512
* @param mixed $start
462513
* @param mixed $end
514+
*
515+
* @return static
463516
*/
464517
public function range($start, $end): self
465518
{
@@ -468,6 +521,9 @@ public function range($start, $end): self
468521
return $this;
469522
}
470523

524+
/**
525+
* @return static
526+
*/
471527
public function references(object $document): self
472528
{
473529
$this->query->references($document);
@@ -480,6 +536,8 @@ public function references(object $document): self
480536
*
481537
* @see Expr::size()
482538
* @see https://docs.mongodb.com/manual/reference/operator/size/
539+
*
540+
* @return static
483541
*/
484542
public function size(int $size): self
485543
{
@@ -497,6 +555,8 @@ public function size(int $size): self
497555
*
498556
* @see Expr::text()
499557
* @see https://docs.mongodb.com/master/reference/operator/query/text/
558+
*
559+
* @return static
500560
*/
501561
public function text(string $search): self
502562
{
@@ -512,6 +572,8 @@ public function text(string $search): self
512572
* @see https://docs.mongodb.com/manual/reference/operator/type/
513573
*
514574
* @param int|string $type
575+
*
576+
* @return static
515577
*/
516578
public function type($type): self
517579
{

phpstan-baseline.neon

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@ parameters:
4949
count: 1
5050
path: tests/Doctrine/ODM/MongoDB/Tests/Aggregation/Stage/FacetTest.php
5151

52-
-
53-
message: "#^Call to an undefined method Doctrine\\\\ODM\\\\MongoDB\\\\Aggregation\\\\Stage\\\\MatchStage\\:\\:connectFromField\\(\\)\\.$#"
54-
count: 1
55-
path: tests/Doctrine/ODM/MongoDB/Tests/Aggregation/Stage/GraphLookupTest.php
56-
5752
-
5853
message: "#^Class Documents\\\\Account does not have a constructor and must be instantiated without any parameters\\.$#"
5954
count: 4

0 commit comments

Comments
 (0)