for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace drupol\phpermutations\Iterators;
use drupol\phpermutations\Combinatorics;
use drupol\phpermutations\IteratorInterface;
/**
* Class Cycle.
*/
class Cycle extends Combinatorics implements IteratorInterface
{
* The key.
*
* @var int
protected $key = 0;
* {@inheritdoc}
public function current()
return $this->dataset[$this->key];
}
public function next()
$this->key = ($this->key + 1) % $this->datasetCount;
public function rewind()
$this->key = 0;
public function valid()
return true;
public function count()
return count($this->getDataset());