Skip to content

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.

4 participants