| Total Complexity | 9 |
| Total Lines | 94 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 11 | class ResourceCursor implements ResourceCursorInterface |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var int|null |
||
| 15 | */ |
||
| 16 | private $limit; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var PageInterface |
||
| 20 | */ |
||
| 21 | private $currentPage; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var PageInterface |
||
| 25 | */ |
||
| 26 | private $firstPage; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var int |
||
| 30 | */ |
||
| 31 | private $currentIndex = 0; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @var int |
||
| 35 | */ |
||
| 36 | private $totalIndex = 0; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @param int|null $limit |
||
| 40 | * @param PageInterface $firstPage |
||
| 41 | */ |
||
| 42 | public function __construct(?int $limit, PageInterface $firstPage) |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @inheritDoc |
||
| 51 | */ |
||
| 52 | public function current() |
||
| 53 | { |
||
| 54 | return $this->currentPage->getItems()[$this->currentIndex]; |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @inheritDoc |
||
| 59 | */ |
||
| 60 | public function next() |
||
| 70 | } |
||
| 71 | } |
||
| 72 | |||
| 73 | /** |
||
| 74 | * @inheritDoc |
||
| 75 | */ |
||
| 76 | public function key() |
||
| 77 | { |
||
| 78 | return $this->totalIndex; |
||
| 79 | } |
||
| 80 | |||
| 81 | /** |
||
| 82 | * @inheritDoc |
||
| 83 | */ |
||
| 84 | public function valid() |
||
| 85 | { |
||
| 86 | return isset($this->currentPage->getItems()[$this->currentIndex]); |
||
| 87 | } |
||
| 88 | |||
| 89 | /** |
||
| 90 | * @inheritDoc |
||
| 91 | */ |
||
| 92 | public function rewind() |
||
| 97 | } |
||
| 98 | |||
| 99 | /** |
||
| 100 | * @inheritDoc |
||
| 101 | */ |
||
| 102 | public function getLimit(): ?int |
||
| 105 | } |
||
| 106 | } |
||
| 107 |