You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make default callback the identity function. (#214)
* Make default callback the identity function.
This commit changes the `select`, `reject`, `some`, `none`, and `every`
functions so that the default callback argument is the `id` function.
* Provide more clarity in docs when $callback is id().
For both functions if a value for $callback is not provided then the `id()` function is used. For `select`, this means that only the truthy values in the collection will be returned. For `reject`, this means that only the falsey values in the collection will be returned.
163
+
157
164
Alias for `Functional\select()` is `Functional\filter()`
158
165
159
166
**Note:** This may unexpectedly turn your indexed array into an associative array, [see here](https://github.com/lstrojny/functional-php/issues/39#issuecomment-48034617) if you always want to keep an indexed array.
0 commit comments