Skip to content

Commit

Permalink
Fix PHP8.1 typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Moln committed Feb 11, 2023
1 parent b626154 commit 2fd6767
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/Paginator/CursorPaginator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

namespace Zfegg\ApiSerializerExt\Paginator;

use Traversable;

class CursorPaginator implements CursorPaginatorInterface
{
use CursorPropertyTrait;
Expand All @@ -23,7 +25,7 @@ public function __construct(
$this->itemsPerPage = $itemsPerPage;
}

public function getIterator()
public function getIterator(): Traversable
{
foreach ($this->data as $item) {
yield $item;
Expand Down
4 changes: 2 additions & 2 deletions src/Paginator/Paginator.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ public function __construct(iterable $data, int $count, int $currentPage = 1, in
$this->itemsPerPage = $itemsPerPage;
}

public function getIterator()
public function getIterator(): Traversable
{
return new \ArrayIterator($this->data);
}

public function count()
public function count(): int
{
return $this->count;
}
Expand Down

0 comments on commit 2fd6767

Please sign in to comment.