diff --git a/src/Paginator/CursorPaginator.php b/src/Paginator/CursorPaginator.php index 7a87553..9bcb816 100644 --- a/src/Paginator/CursorPaginator.php +++ b/src/Paginator/CursorPaginator.php @@ -3,6 +3,8 @@ namespace Zfegg\ApiSerializerExt\Paginator; +use Traversable; + class CursorPaginator implements CursorPaginatorInterface { use CursorPropertyTrait; @@ -23,7 +25,7 @@ public function __construct( $this->itemsPerPage = $itemsPerPage; } - public function getIterator() + public function getIterator(): Traversable { foreach ($this->data as $item) { yield $item; diff --git a/src/Paginator/Paginator.php b/src/Paginator/Paginator.php index 0dfaa21..73f9846 100644 --- a/src/Paginator/Paginator.php +++ b/src/Paginator/Paginator.php @@ -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; }