Skip to content

Commit

Permalink
Remove casting as its being done in the getter methods
Browse files Browse the repository at this point in the history
  • Loading branch information
tonysm committed Jul 9, 2024
1 parent b2b82ce commit 2aefcfa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Illuminate/Database/Concerns/BuildsQueries.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
Expand Down Expand Up @@ -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) {
Expand All @@ -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
Expand Down

0 comments on commit 2aefcfa

Please sign in to comment.