PHPLIB-1617 Accept a Pipeline instance in aggregate and watch methods#1580
Merged
GromNaN merged 1 commit intomongodb:v2.xfrom Feb 10, 2025
Merged
PHPLIB-1617 Accept a Pipeline instance in aggregate and watch methods#1580GromNaN merged 1 commit intomongodb:v2.xfrom
GromNaN merged 1 commit intomongodb:v2.xfrom
Conversation
jmikola
approved these changes
Feb 10, 2025
Contributor
jmikola
left a comment
There was a problem hiding this comment.
I'll defer to you about using a list of stages as the default code path for tests and then only conditionally converting that into a Pipeline object (presumably with the ... operator, just as is done in the helper methods).
|
|
||
| if ($pipelineAsArray) { | ||
| $pipeline = iterator_to_array($pipeline); | ||
| } |
Contributor
There was a problem hiding this comment.
I don't disagree that this tests the underlying behavior, but it seems a bit backwards that this operates by converting the Pipeline back into an array, instead of creating a list of stages and then conditionally converting that to a pipeline.
The latter approach seems more straightforward.
Member
Author
There was a problem hiding this comment.
You're right, I hadn't thought of it like that. #1596
This was referenced Feb 10, 2025
alcaeus
added a commit
that referenced
this pull request
Feb 28, 2025
* v2.x: Add return type hint for Encoder::encode() implementation Reverse pipeline init from an array (#1596) PHPLIB-1617 Accept a Pipeline instance in aggregate and watch methods (#1580) Fix CS Require latest python version (#1564) (#1565) Update src/Operation/Find.php Ignore `disableMD5` option as `md5` field is removed from the spec (#1502) Remove obsolete baseline entries Regenerate evergreen configuration (#1503) PHPLIB-1546 and PHPLIB-1159: Remove CreateCollection flags and autoIndexId options (#1478) PHPLIB-1227 Use void return types for operations without meaningful result document (#1468) Remove deprecated functionality (#1439) PHPLIB-1518 `WriteResult::get*Count()` always return an int on acknowledged result (#1454) PHPLIB-954: Add return types to all methods (#1391) PHPLIB-797: Remove unused methods in UnsupportedException (#1436) Revert "Add final annotations to non-internal Operation classes (#1410)" PHPLIB-953 Make internal classes and Operation classes final (#1392) PHPLIB-1218 Remove deprecated fields from GridFS files (#1398)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix PHPLIB-1617
In v1.x, we could not change the signature of some methods to accept a
Pipelineinstance, so in #1383 I added a workaround.But for v2.0.0, we allow ourselves this breaking change to simplify the API.