Skip to content

Commit b01a51f

Browse files
committed
Applying suggested changes.
1 parent d971f33 commit b01a51f

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

system/BaseModel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,12 +595,12 @@ abstract public function chunk(int $size, Closure $userFunc);
595595
*
596596
* @param Closure(list<array<string, string>>|list<object>): mixed $userFunc
597597
*
598-
* @return void
598+
* @returns void
599599
*
600600
* @throws DataException
601601
* @throws InvalidArgumentException if $size is not a positive integer
602602
*/
603-
abstract public function chunkRows(int $size, Closure $userFunc);
603+
abstract public function chunkRows(int $size, Closure $userFunc): void;
604604

605605
/**
606606
* Fetches the row of database.

system/Model.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
use CodeIgniter\Validation\ValidationInterface;
2727
use Config\Database;
2828
use Config\Feature;
29-
use Generator;
3029
use stdClass;
3130

3231
/**
@@ -526,7 +525,7 @@ public function countAllResults(bool $reset = true, bool $test = false)
526525
return $this->builder()->testMode($test)->countAllResults($reset);
527526
}
528527

529-
private function iterateChunks(int $size): Generator
528+
private function iterateChunks(int $size): \Generator
530529
{
531530
if ($size <= 0) {
532531
throw new InvalidArgumentException('$size must be a positive integer.');
@@ -580,7 +579,7 @@ public function chunk(int $size, Closure $userFunc)
580579
* determine the rows to operate on.
581580
* This method works only with dbCalls.
582581
*/
583-
public function chunkRows(int $size, Closure $userFunc)
582+
public function chunkRows(int $size, Closure $userFunc): void
584583
{
585584
foreach ($this->iterateChunks($size) as $rows) {
586585
if ($userFunc($rows) === false) {

0 commit comments

Comments
 (0)