Skip to content

Commit e865bd0

Browse files
author
Vincent Le Henaff
committed
* fix MatchStage expr revision introduced bug
1 parent 5b6a368 commit e865bd0

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
@@ -194,8 +194,6 @@ public function execute(array $options = []): Iterator
194194
}
195195

196196
/**
197-
* @return Expr
198-
*
199197
* @deprecated use createExpr instead
200198
*/
201199
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
@@ -113,21 +113,12 @@ public function all(array $values): self
113113
}
114114

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

133124
/**
@@ -182,21 +173,11 @@ public function exists(bool $bool): self
182173
}
183174

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

202183
/**

0 commit comments

Comments
 (0)