-
Notifications
You must be signed in to change notification settings - Fork 11.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[9.x] Improve Collection's callable default return types #39805
[9.x] Improve Collection's callable default return types #39805
Conversation
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.
Thank you for this pull request. Feedback that must be addressed before merging:
- Please replace
callable
by\Closure
. - Please adjust the types on the interface `Illuminate\Support\Enumerable'.
@nunomaduro Thanks for the review. Done. |
Hi there, we've temporarily disabled our PostgreSQL build until we've managed to fix it. I've marked your PR as draft for now. Please rebase with master and mark this PR as ready when all tests pass again. Thanks. |
…tanYadaev/framework into improve_default_callable_return_types
@MatanYadaev you incorrectly rebased this PR, causing some commits to duplicate. Luckily this PR was squash-merged. Please be mindful when rebasing PR's to avoid this as this can cause real-havoc on projects. |
Currently, Collection methods that have a default parameter return incorrect type when the default parameter value is a closure.
The methods are:
Collection::first
Collection::last
Collection::get
Collection::pull
LazyCollection::first
LazyCollection::last
LazyCollection::get
Code example:
After this PR: