From 2aefcfa551a6b5cba3e411d4b88453fe08e90573 Mon Sep 17 00:00:00 2001 From: Tony Messias Date: Tue, 9 Jul 2024 17:56:52 -0300 Subject: [PATCH] Remove casting as its being done in the getter methods --- src/Illuminate/Database/Concerns/BuildsQueries.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Illuminate/Database/Concerns/BuildsQueries.php b/src/Illuminate/Database/Concerns/BuildsQueries.php index 6e77ebe89964..e0151a218ce4 100644 --- a/src/Illuminate/Database/Concerns/BuildsQueries.php +++ b/src/Illuminate/Database/Concerns/BuildsQueries.php @@ -49,12 +49,12 @@ public function chunk($count, callable $callback) // Calculating the offset while considering any existing query offset // ensures user-defined offsets stay independent of the chunk size // and page numbers, providing precise control over the dataset. - $offset = (($page - 1) * $count) + intval($skip); + $offset = (($page - 1) * $count) + $skip; // If a limit was defined, we'll use that as the upper bound for chunks. // We'll decrement from the remainder limit on every iteration, until // the limit is reached. Otherwise, we use the chunk size as limit. - $limit = is_null($remaining) ? $count : min($count, intval($remaining)); + $limit = is_null($remaining) ? $count : min($count, $remaining); // Saves an unnecessary database query when the limit is already zero... if ($limit == 0) { @@ -71,7 +71,7 @@ public function chunk($count, callable $callback) // Decrements from the remainder (user-defined limits, if any) on each chunked iteration... if (!is_null($remaining)) { - $remaining = max(intval($remaining) - $countResults, 0); + $remaining = max($remaining - $countResults, 0); } // On each chunk result set, we will pass them to the callback and then let the @@ -196,7 +196,7 @@ public function orderedChunkById($count, callable $callback, $column = null, $al // If a limit was defined, we'll use that as the upper bound for chunks. // We'll decrement from the remainder limit on every iteration, until // the limit is reached. Otherwise, we use the chunk size as limit. - $limit = is_null($remaining) ? $count : min($count, intval($remaining)); + $limit = is_null($remaining) ? $count : min($count, $remaining); // Saves an unnecessary database query when the limit is already zero... if ($limit == 0) { @@ -220,7 +220,7 @@ public function orderedChunkById($count, callable $callback, $column = null, $al // Decrements from the remainder (user-defined limits, if any) on each chunked iteration... if (!is_null($remaining)) { - $remaining = max(intval($remaining) - $countResults, 0); + $remaining = max($remaining - $countResults, 0); } // On each chunk result set, we will pass them to the callback and then let the