Skip to content

Conversation

@jasonmm
Copy link
Contributor

@jasonmm jasonmm commented Mar 20, 2020

This pull request updates the select, reject, some, none, and every functions so that the default callback argument is the id function.

PHP allows only null to be set as the default value of a callable argument. This requires a null check in the body of each function.

@lstrojny
Copy link
Owner

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.
@jasonmm jasonmm force-pushed the default-callbacks branch from dd658db to cd2b718 Compare March 22, 2020 11:26
@jasonmm
Copy link
Contributor Author

jasonmm commented Mar 27, 2020

The file docs/functional-php.md and the functions' docstrings have been updated. Changes to select and reject have been added as well.

Copy link
Owner

@lstrojny lstrojny left a 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

}
```

The default value for $callback is `id()`.
Copy link
Owner

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"

}
```

The default value for $callback is `id()`.
Copy link
Owner

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

}
```

The default value for $callback is `id()`.
Copy link
Owner

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

@jasonmm
Copy link
Contributor Author

jasonmm commented Mar 29, 2020

Thanks for the suggestions! The docs were updated in 8a23e41. Let me know if further refinement is necessary.

@lstrojny lstrojny merged commit e495a97 into lstrojny:master Mar 29, 2020
@jasonmm jasonmm deleted the default-callbacks branch April 7, 2020 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants