From dd6349c884bdb73ceaa22258030e28044347d8cf Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Thu, 12 Aug 2021 11:18:48 +0200 Subject: [PATCH] Update return type for tap `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: https://github.com/laravel/framework/pull/32717 See a more thorough explanation here: https://github.com/laravel/framework/issues/38343 --- src/Illuminate/Database/Concerns/BuildsQueries.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Database/Concerns/BuildsQueries.php b/src/Illuminate/Database/Concerns/BuildsQueries.php index 76a56b57993f..8e712f0d7434 100644 --- a/src/Illuminate/Database/Concerns/BuildsQueries.php +++ b/src/Illuminate/Database/Concerns/BuildsQueries.php @@ -422,7 +422,7 @@ protected function cursorPaginator($items, $perPage, $cursor, $options) * Pass the query to a given callback. * * @param callable $callback - * @return $this + * @return $this|mixed */ public function tap($callback) {