Skip to content

Commit f67efea

Browse files
authored
Update return type for tap (#38353)
`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
1 parent eb4eca9 commit f67efea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Illuminate/Database/Concerns/BuildsQueries.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ protected function cursorPaginator($items, $perPage, $cursor, $options)
422422
* Pass the query to a given callback.
423423
*
424424
* @param callable $callback
425-
* @return $this
425+
* @return $this|mixed
426426
*/
427427
public function tap($callback)
428428
{

0 commit comments

Comments
 (0)