Skip to content

Commit

Permalink
Add GeneratorPaginatorTrait
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud-lb committed Dec 6, 2023
1 parent 3f0a2b4 commit e50d172
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/GeneratorPaginatorTrait.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

namespace Mention\Paginator;

/**
* @template ItemT
*/
trait GeneratorPaginatorTrait
{
/**
* @return PaginatorPageInterface<ItemT>
*/
public function current(): PaginatorPageInterface
{
return $this->generator->current();
}

public function key(): int
{
return $this->generator->key();
}

public function next(): void
{
$this->generator->next();
}

public function rewind(): void
{
$this->generator->rewind();
}

public function valid(): bool
{
return $this->generator->valid();
}
}

0 comments on commit e50d172

Please sign in to comment.