-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add RecursiveIterableAggregate
#61
Conversation
PR Summary
|
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.
Thank you for this PR, very nice!
I added a comment for performance, let me know if this could be improved.
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.
The code LGTM, nothing to add any more. So sad we had to add so many things when it can be replaced with a single line and recursion... but this is how it is in PHP.
The only missing thing is the documentation in the README file, if you could add an entry in there, it would be really nice.
I am glad I could help.
Yeah but that's why we have encapsulation:) You made a good point about performance.
I am on it. Thank you for the nice review BTW! |
Thank you <3 ! |
Hello,
First, I'd like to say: great library you have here!
I was hoping to contribute by adding
RecursiveIterableAggregate
for traversing tree-like structures, but I didn't check the open pull requests first and, ironically, found a very similar PR already in progress. Since the work I've done isn't much, feel free to discard this PR if you find it unnecessary.I’m not sure if the class name is correct, but I’ve tried to find inspiration in
MapIterableAggregate
and model this class similarly. I’ve also aimed to pass the callback arguments in the same way thatMapIterableAggregate
does (i.e., passing value, key, and the original iterable).