Skip to content

Commit

Permalink
fix(add-paging-to-result-set): fixed type-hinting
Browse files Browse the repository at this point in the history
  • Loading branch information
ncosta-ic committed Apr 12, 2024
1 parent 8c57666 commit 52e3d0d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/ResultSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
use Traversable;

/**
* Dataset containing hydrated data by {@see Hydrator} in form of {@see Model} entries from the given {@see Query}
* Dataset containing database rows
*
* @implements Iterator<int, Model>
* @implements Iterator<int, mixed>
*/
class ResultSet implements Iterator
{
/** @var ArrayIterator<int, Model> */
/** @var ArrayIterator<int, mixed> */
protected $cache;

/** @var bool Whether cache is disabled */
protected $isCacheDisabled = false;

/** @var Generator<int, Model, Model, Model> */
/** @var Generator<int, mixed, mixed, mixed> */
protected $generator;

/** @var ?int */
Expand All @@ -37,7 +37,7 @@ class ResultSet implements Iterator
protected $pageSize;

/**
* @param Traversable<int, Model> $traversable
* @param Traversable<int, mixed> $traversable
* @param ?int $limit
* @param ?int $offset
*/
Expand Down Expand Up @@ -86,9 +86,9 @@ public function hasResult(): bool
}

/**
* @return ?Model
* @return mixed
*/
public function current(): ?Model
public function current()
{
if ($this->position === null) {
$this->advance();
Expand All @@ -111,7 +111,7 @@ public function next(): void
}
}

public function key(): int
public function key(): ?int
{
if ($this->position === null) {
$this->advance();
Expand Down Expand Up @@ -163,7 +163,7 @@ protected function advance(): void
}

/**
* @param Traversable<int, Model> $traversable
* @param Traversable<int, mixed> $traversable
* @return Generator
*/
protected function yieldTraversable(Traversable $traversable): Generator
Expand Down

0 comments on commit 52e3d0d

Please sign in to comment.