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

Add All Operation #133

Merged
merged 4 commits into from
Jul 11, 2021
Merged

Add All Operation #133

merged 4 commits into from
Jul 11, 2021

Conversation

AlexandruGG
Copy link
Collaborator

This PR:

  • Adds an All operation
  • Has unit tests (phpspec)
  • Has static analysis tests (psalm, phpstan)
  • Has documentation

Even though this is a simple one, it's good to have it in an operation so that users that want to use the operations separately can benefit from it and don't have to use iterator_to_array all the time.

@@ -26,31 +24,31 @@ final class Pipe extends AbstractOperation
/**
* @pure
*
* @return Closure(...callable(Iterator<TKey, T>):Generator<TKey, T, mixed, mixed>):Closure(Iterator<TKey, T>):Iterator<TKey, T>
* @return Closure(callable(iterable<TKey, T>): iterable<TKey, T> ...): Closure(iterable<TKey, T>): iterable<TKey, T>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expanded the type here from Iterator to iterable to allow for the All usage, which returns an array

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one!

@AlexandruGG AlexandruGG marked this pull request as ready for review July 11, 2021 17:02
@drupol drupol merged commit 85d7e9c into master Jul 11, 2021
@drupol drupol deleted the feature/all-operation branch July 11, 2021 18:13
@drupol
Copy link
Collaborator

drupol commented Jul 11, 2021

Thanks 👯‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants