for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Zenstruck\Porpaginas\Factory;
use Zenstruck\Porpaginas\Page;
/**
* @author Kevin Bond <[email protected]>
*/
final class FactoryPage implements Page
{
private $factory;
private $page;
public function __construct(callable $factory, Page $page)
$this->factory = $factory;
$this->page = $page;
}
* {@inheritdoc}
public function getCurrentOffset()
return $this->page->getCurrentOffset();
public function getCurrentPage()
return $this->page->getCurrentPage();
public function getCurrentLimit()
return $this->page->getCurrentLimit();
public function count()
return $this->page->count();
public function totalCount()
return $this->page->totalCount();
public function getIterator()
foreach ($this->page as $result) {
yield call_user_func($this->factory, $result);