| 1 | <?php |
||
| 12 | class Cycle extends Combinatorics implements \Iterator, \Countable { |
||
| 13 | |||
| 14 | /** |
||
| 15 | * The key. |
||
| 16 | * |
||
| 17 | * @var int |
||
| 18 | */ |
||
| 19 | protected $key = 0; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Cycle constructor. |
||
| 23 | * |
||
| 24 | * @param array $dataset |
||
| 25 | * The dataset. |
||
| 26 | */ |
||
| 27 | 1 | public function __construct(array $dataset = array()) { |
|
| 30 | |||
| 31 | /** |
||
| 32 | * {@inheritdoc} |
||
| 33 | */ |
||
| 34 | public function key() { |
||
| 37 | |||
| 38 | /** |
||
| 39 | * {@inheritdoc} |
||
| 40 | */ |
||
| 41 | 1 | public function current() { |
|
| 44 | |||
| 45 | /** |
||
| 46 | * {@inheritdoc} |
||
| 47 | */ |
||
| 48 | 1 | public function next() { |
|
| 51 | |||
| 52 | /** |
||
| 53 | * {@inheritdoc} |
||
| 54 | */ |
||
| 55 | public function rewind() { |
||
| 58 | |||
| 59 | /** |
||
| 60 | * {@inheritdoc} |
||
| 61 | */ |
||
| 62 | public function valid() { |
||
| 65 | |||
| 66 | /** |
||
| 67 | * {@inheritdoc} |
||
| 68 | */ |
||
| 69 | 1 | public function count() { |
|
| 72 | |||
| 73 | } |
||
| 74 |