Skip to content

Commit

Permalink
Support new aggregation operators in builder (doctrine#2514)
Browse files Browse the repository at this point in the history
* Add interfaces for aggregation pipeline operators

* Implement new aggregation pipeline operators in stages

* Update static analysis baselines

* Use consistent formatting for operators with optional arguments

* Use consistent capitalisation for "date object"

* Wrap docblock comments

* Rename ensureArray to something more descriptive

* Remove duplicated docblocks

* Use func_get_args when proxying expression methods

* Fix wrong return types for internal expr methods

* Use func_get_args for operators where possible

* Disambiguate closure param in tests

* Fix docblock errors

Note: ProvidesGroupAccumulatorOperators errors were ignored as the trait is designed to be used in conjunction with the corresponding interface.

* Make initArgs parameter for $accumulator optional

* Use static return types across aggregation builder

* Fix handling of optional parameters for $range and $slice
  • Loading branch information
alcaeus authored and notrix committed Apr 6, 2023
1 parent 0be082c commit bf28e29
Show file tree
Hide file tree
Showing 47 changed files with 5,199 additions and 5,533 deletions.
4 changes: 2 additions & 2 deletions lib/Doctrine/ODM/MongoDB/Aggregation/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ public function group(): Stage\Group
/**
* Set which class to use when hydrating results as document class instances.
*/
public function hydrate(?string $className): self
public function hydrate(?string $className): static
{
$this->hydrationClass = $className;

Expand Down Expand Up @@ -524,7 +524,7 @@ public function replaceWith($expression = null): Stage\ReplaceWith
/**
* Controls if resulting iterator should be wrapped with CachingIterator.
*/
public function rewindable(bool $rewindable = true): self
public function rewindable(bool $rewindable = true): static
{
$this->rewindable = $rewindable;

Expand Down
Loading

0 comments on commit bf28e29

Please sign in to comment.