Skip to content

Commit fb14785

Browse files
Vincent Le Henaffvincent-le-henaff
authored andcommitted
+ add exprOp test
+ add contextual missing type hint for exprOr
1 parent 839adc2 commit fb14785

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ public function expr(): self
475475
* @see Builder::expr()
476476
* @see https://docs.mongodb.com/manual/reference/operator/query/expr/
477477
*
478-
* @param array|\Doctrine\ODM\MongoDB\Query\Expr $expression
478+
* @param array|self $expression
479479
*/
480480
public function exprOp($expression): self
481481
{

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ public function expr(): Expr
187187
*
188188
* @see Expr::exprOp()
189189
* @see https://docs.mongodb.com/manual/reference/operator/query/expr/
190+
*
191+
* @param array|\Doctrine\ODM\MongoDB\Aggregation\Expr $expression
190192
*/
191193
public function exprOp($expression): self
192194
{

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,8 @@ public function expr(): Expr
507507
*
508508
* @see Expr::exprOp()
509509
* @see https://docs.mongodb.com/manual/reference/operator/query/expr/
510+
*
511+
* @param array|Expr $expression
510512
*/
511513
public function exprOp($expression): self
512514
{

tests/Doctrine/ODM/MongoDB/Tests/Aggregation/AggregationOperatorsProviderTrait.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,11 @@ public static function provideExpressionOperators(): array
192192
'operator' => 'exp',
193193
'args' => ['$field'],
194194
],
195+
'exprOp' => [
196+
'expected' => ['$expr' => '$array'],
197+
'operator' => 'expr',
198+
'args' => ['$array'],
199+
],
195200
'filter' => [
196201
'expected' => ['$filter' => ['input' => '$array', 'as' => '$as', 'cond' => '$cond']],
197202
'operator' => 'filter',

0 commit comments

Comments
 (0)