-
Notifications
You must be signed in to change notification settings - Fork 266
PHPLIB-609: Allow CachingIterator to handle Iterators with non-unique keys #896
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally, please add a new test case to CachingIteratorTest that shows the class can now support iterators that return duplicate keys. The existing helper methods in that class (e.g. getTraversable
) might not be usable for that purpose, but you can likely get by with creating a generator. For example:
$duplicateKeyGenerator = function() {
yield 0 => 'a';
yield 0 => 'b';
yield 0 => 'c';
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One suggestion to rename the count test and add testIterationNonUniqueKeys
. I think we'll be good after that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but please hold off on merging until I branch v1.12.
The one build failure is unrelated to this change and is due to upstream changes in MongoDB 6.0. I added a comment in PHPLIB-810 to track it.
https://jira.mongodb.org/browse/PHPLIB-609