Skip to content

Commit af66f94

Browse files
authored
Merge pull request #175 from zoul0813/hotfix/fix-chunk
updated DynamoDbQueryBuilder::chunk to follow Laravel's chunk
2 parents 413af4e + 8eef36b commit af66f94

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/DynamoDbQueryBuilder.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,13 +428,17 @@ public function chunk($chunkSize, callable $callback)
428428
$results = $this->getAll([], $chunkSize, false);
429429

430430
if ($results->isNotEmpty()) {
431-
call_user_func($callback, $results);
431+
if (call_user_func($callback, $results) === false) {
432+
return false;
433+
}
432434
}
433435

434436
if (empty($this->lastEvaluatedKey)) {
435437
break;
436438
}
437439
}
440+
441+
return true;
438442
}
439443

440444
/**

0 commit comments

Comments
 (0)