-
-
Notifications
You must be signed in to change notification settings - Fork 209
Make default callback the identity function. #214
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
|
Looks good, thank you! Could you update the docs as well? I've commented on #212 wrt to reject/select |
This commit changes the `select`, `reject`, `some`, `none`, and `every` functions so that the default callback argument is the `id` function.
dd658db to
cd2b718
Compare
|
The file docs/functional-php.md and the functions' docstrings have been updated. Changes to |
lstrojny
left a comment
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.
Looks good, just three editorial questions
docs/functional-php.md
Outdated
| } | ||
| ``` | ||
|
|
||
| The default value for $callback is `id()`. |
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.
Can you elaborate on thwat that means? Like "Will return true if every value in the collection is truthy"
docs/functional-php.md
Outdated
| } | ||
| ``` | ||
|
|
||
| The default value for $callback is `id()`. |
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.
A bit elaboration would be nice here as well
docs/functional-php.md
Outdated
| } | ||
| ``` | ||
|
|
||
| The default value for $callback is `id()`. |
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.
A bit elaboration would be nice here as well
|
Thanks for the suggestions! The docs were updated in 8a23e41. Let me know if further refinement is necessary. |
This pull request updates the
select,reject,some,none, andeveryfunctions so that the default callback argument is theidfunction.PHP allows only
nullto be set as the default value of acallableargument. This requires a null check in the body of each function.