Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support new aggregation pipeline stages in builder #2513

Merged
merged 23 commits into from
Mar 24, 2023
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1f289a3
Add $densify stage to aggregation pipeline builder
alcaeus Mar 14, 2023
b10aed7
Add $fill stage to aggregation pipeline builder
alcaeus Mar 14, 2023
4da931e
Add $merge stage to aggregation pipeline builder
alcaeus Mar 14, 2023
8643261
Add $replaceWith stage to aggregation pipeline builder
alcaeus Mar 14, 2023
3c1ee8d
Add $set stage to aggregation pipeline builder
alcaeus Mar 14, 2023
6a3dd48
Add $unset stage to aggregation pipeline builder
alcaeus Mar 14, 2023
f1bd9a7
Add $unionWith stage to aggregation pipeline builder
alcaeus Mar 14, 2023
e35e5d8
Use templates for Builder::addStage
alcaeus Mar 15, 2023
4fe0c0f
Add template covariance error to psalm baseline
alcaeus Mar 22, 2023
c1117f2
Remove unnecessary abstraction for $addFields and $set
alcaeus Mar 23, 2023
6f72a6a
Use array_fields for lists in variadic arguments
alcaeus Mar 23, 2023
cc4abd9
Improve wording when field name is required in Expr classes
alcaeus Mar 23, 2023
227186b
Add missing type to whenMatched option
alcaeus Mar 23, 2023
acfe974
Update type for let option
alcaeus Mar 23, 2023
0568e90
Use ? syntax for nullable type
alcaeus Mar 23, 2023
7cd1777
Rename test methods to hide copy/paste
alcaeus Mar 23, 2023
f831285
Test all range options for $densify
alcaeus Mar 23, 2023
742d27c
Test complex values and sort for $fill
alcaeus Mar 23, 2023
b8c6aff
Test reusing same builder for $merge
alcaeus Mar 23, 2023
e517015
Simplify creation of UTCDateTime instances in tests
alcaeus Mar 23, 2023
77d5827
Allow expressions as partition in $fill stage
alcaeus Mar 23, 2023
67847c5
Define psalm types for most pipeline stages
alcaeus Mar 23, 2023
3596a4c
Improve handling of required options as typed arguments
alcaeus Mar 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/Doctrine/ODM/MongoDB/Aggregation/Aggregation.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use function array_merge;
use function assert;

/** @psalm-import-type PipelineExpression from Builder */
final class Aggregation implements IteratorAggregate
{
private DocumentManager $dm;
Expand All @@ -25,7 +26,10 @@ final class Aggregation implements IteratorAggregate

private Collection $collection;

/** @var array<string, mixed> */
/**
* @var array<string, mixed>
* @psalm-var PipelineExpression
*/
private array $pipeline;

/** @var array<string, mixed> */
Expand All @@ -36,6 +40,7 @@ final class Aggregation implements IteratorAggregate
/**
* @param array<string, mixed> $pipeline
* @param array<string, mixed> $options
* @psalm-param PipelineExpression $pipeline
*/
public function __construct(DocumentManager $dm, ?ClassMetadata $classMetadata, Collection $collection, array $pipeline, array $options = [], bool $rewindable = true)
{
Expand Down
Loading