for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Indigo\Iterator;
/**
* Wraps an iterator and allows to set the count manually.
*
* Example: based on database COUNT result.
* @author Márk Sági-Kazár <[email protected]>
*/
class ManualCountIterator extends \IteratorIterator implements \Countable
{
* @var int
protected $count;
* @param \Traversable $iterator
* @param int $count
public function __construct(\Traversable $iterator, $count)
$this->count = $count;
parent::__construct($iterator);
}
* {@inheritdoc}
public function count()
return $this->count;