Skip to content

Commit 839adc2

Browse files
Vincent Le Henaffvincent-le-henaff
authored andcommitted
* fix MatchStage expr revision introduced bug
1 parent 0b458de commit 839adc2

File tree

2 files changed

+6
-27
lines changed

2 files changed

+6
-27
lines changed

lib/Doctrine/ODM/MongoDB/Aggregation/Builder.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,6 @@ public function execute(array $options = []): Iterator
189189
}
190190

191191
/**
192-
* @return Expr
193-
*
194192
* @deprecated use createExpr instead
195193
*/
196194
public function expr(): Expr

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

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -115,21 +115,12 @@ public function all(array $values): self
115115
}
116116

117117
/**
118-
* Specify $expr criteria for the current field.
119-
*
120-
* You can create a new expression using the {@link Builder::matchExpr()}
121-
* method.
122-
*
123-
* @see Expr::expr()
124-
* @see https://docs.mongodb.com/manual/reference/operator/query/expr/
125-
*
126-
* @param array|Expr $expression
118+
* Create a new Expr instance that can be used to build partial expressions
119+
* for other operator methods.
127120
*/
128-
public function createExpr($expression): self
121+
public function createExpr(): Expr
129122
{
130-
$this->query->expr($expression);
131-
132-
return $this;
123+
return $this->builder->matchExpr();
133124
}
134125

135126
/**
@@ -184,21 +175,11 @@ public function exists(bool $bool): self
184175
}
185176

186177
/**
187-
* Specify $expr criteria for the current field.
188-
*
189-
* You can create a new expression using the {@link Builder::matchExpr()}
190-
* method.
191-
*
192-
* @see Expr::expr()
193-
* @see https://docs.mongodb.com/manual/reference/operator/query/expr/
194-
*
195-
* @param array|Expr $expression
196-
*
197178
* @deprecated use createExpr instead
198179
*/
199-
public function expr($expression): self
180+
public function expr(): Expr
200181
{
201-
return $this->createExpr($expression);
182+
return $this->createExpr();
202183
}
203184

204185
/**

0 commit comments

Comments
 (0)