| Total Complexity | 5 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 12 | final class FactoryResult implements Result |
||
| 13 | { |
||
| 14 | use ResultPaginator; |
||
| 15 | |||
| 16 | private $factory; |
||
| 17 | private Result $result; |
||
| 18 | |||
| 19 | 46 | public function __construct(callable $factory, Result $result) |
|
| 20 | { |
||
| 21 | 46 | $this->factory = $factory; |
|
| 22 | 46 | $this->result = $result; |
|
| 23 | 46 | } |
|
| 24 | |||
| 25 | 8 | public function take(int $offset, int $limit): Page |
|
| 26 | { |
||
| 27 | 8 | return new FactoryPage($this->factory, $this->result->take($offset, $limit)); |
|
| 28 | } |
||
| 29 | |||
| 30 | 35 | public function count(): int |
|
| 31 | { |
||
| 32 | 35 | return $this->result->count(); |
|
| 33 | } |
||
| 34 | |||
| 35 | 35 | public function getIterator(): \Traversable |
|
| 39 | } |
||
| 40 | 35 | } |
|
| 41 | } |
||
| 42 |