-
-
Notifications
You must be signed in to change notification settings - Fork 35
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 When operation. #105
Add When operation. #105
Conversation
At first glance I can't tell what's the difference between this and |
This operation operates on the collection object once, while the |
* @return \loophp\collection\Collection<TKey, T> | ||
*/ | ||
public function when(callable $predicate, callable $whenTrue, ?callable $whenFalse = null): Collection; |
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.
should this return Collection
the implementation or Collection
the contract?
Isn't there a mismatch here? the @return
is showing the implementation, but the actual return type of the function is the contract
I understand now, thanks for clarifying this in the docs! 🙌 |
@drupol do you mind adding the static analysis check with any new operation please? This ensures we get the types right on the user side 😁 |
True ! I have to get used to that, will do that later in the day for sure. |
This PR