for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Oqq\Minc\Common\Iterator;
use RecursiveIterator;
/**
* @author Eric Braun <[email protected]>
*/
class RecursiveGeneratorIterator implements \RecursiveIterator
{
/** @var \Generator */
protected $generator;
* @param \Generator $generator
public function __construct(\Generator $generator)
$this->generator = $generator;
}
* @inheritdoc
public function current()
return $this->generator->current();
public function next()
$this->generator->next();
public function key()
return $this->generator->key();
public function valid()
return $this->generator->valid();
public function rewind()
$this->generator->rewind();
public function hasChildren()
return $this->generator->current() instanceof \Generator;
public function getChildren()
return new self($this->generator->current());