8000 [8.x] Update return type for tap by driesvints · Pull Request #38353 · laravel/framework · GitHub
[go: up one dir, main page]

Skip to content

[8.x] Update return type for tap #38353

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

Merged
merged 1 commit into from
Aug 12, 2021
Merged

[8.x] Update return type for tap #38353

merged 1 commit into from
Aug 12, 2021

Conversation

driesvints
Copy link
Member

when already has $this|mixed so this should be reflected in tap on BuildsQueries. If you look at the logic inside when you'll see that this is the correct return type as it's either the return value of the given callback or $this. A previous attempt was made here: #32717

See a more thorough explanation here: #38343

`when` already has `$this|mixed` so this should be reflected in `tap` on `BuildsQueries`. If you look at the logic inside `when` you'll see that this is the correct return type as it's either the return value of the given callback or `$this`. A previous attempt was made here: #32717

See a more thorough explanation here: #38343
@axlon
Copy link
Contributor
axlon commented Aug 12, 2021

Thanks for creating the PR @driesvints!

Do you think we should alter this function's behaviour on 9.x to be the same as Collection::tap() and tap()?

@driesvints
Copy link
Member Author

@axlon that's for @taylorotwell to decide.

@taylorotwell taylorotwell merged commit f67efea into 8.x Aug 12, 2021
@taylorotwell
Copy link
Member

Merging this for now but this tap method is not correct. It should always return $this so it has the same behavior as the tap helper.

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.

3 participants
0