Skip to content

Commit 2fd6767

Browse files
committed
Fix PHP8.1 typing
1 parent b626154 commit 2fd6767

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/Paginator/CursorPaginator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
namespace Zfegg\ApiSerializerExt\Paginator;
55

6+
use Traversable;
7+
68
class CursorPaginator implements CursorPaginatorInterface
79
{
810
use CursorPropertyTrait;
@@ -23,7 +25,7 @@ public function __construct(
2325
$this->itemsPerPage = $itemsPerPage;
2426
}
2527

26-
public function getIterator()
28+
public function getIterator(): Traversable
2729
{
2830
foreach ($this->data as $item) {
2931
yield $item;

src/Paginator/Paginator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ public function __construct(iterable $data, int $count, int $currentPage = 1, in
2222
$this->itemsPerPage = $itemsPerPage;
2323
}
2424

25-
public function getIterator()
25+
public function getIterator(): Traversable
2626
{
2727
return new \ArrayIterator($this->data);
2828
}
2929

30-
public function count()
30+
public function count(): int
3131
{
3232
return $this->count;
3333
}

0 commit comments

Comments
 (0)