Skip to content

Commit 4285401

Browse files
author
Vincent Le Henaff
committed
+ add exprOp test
+ add contextual missing type hint for exprOr
1 parent e865bd0 commit 4285401

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
@@ -481,7 +481,7 @@ public function expr(): self
481481
* @see Builder::expr()
482482
* @see https://docs.mongodb.com/manual/reference/operator/query/expr/
483483
*
484-
* @param array|\Doctrine\ODM\MongoDB\Query\Expr $expression
484+
* @param array|self $expression
485485
*/
486486
public function exprOp($expression): self
487487
{

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ public function expr(): Expr
185185
*
186186
* @see Expr::exprOp()
187187
* @see https://docs.mongodb.com/manual/reference/operator/query/expr/
188+
*
189+
* @param array|\Doctrine\ODM\MongoDB\Aggregation\Expr $expression
188190
*/
189191
public function exprOp($expression): self
190192
{

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,8 @@ public function expr(): Expr
517517
*
518518
* @see Expr::exprOp()
519519
* @see https://docs.mongodb.com/manual/reference/operator/query/expr/
520+
*
521+
* @param array|Expr $expression
520522
*/
521523
public function exprOp($expression): self
522524
{

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,11 @@ public static function provideExpressionOperators(): array
194194
'operator' => 'exp',
195195
'args' => ['$field'],
196196
],
197+
'exprOp' => [
198+
'expected' => ['$expr' => '$array'],
199+
'operator' => 'expr',
200+
'args' => ['$array'],
201+
],
197202
'filter' => [
198203
'expected' => ['$filter' => ['input' => '$array', 'as' => '$as', 'cond' => '$cond']],
199204
'operator' => 'filter',

0 commit comments

Comments
 (0)