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