| 1 | <?php |
||
| 12 | class Rotation extends Combinatorics implements \Iterator, \Countable { |
||
| 13 | |||
| 14 | /** |
||
| 15 | * The key. |
||
| 16 | * |
||
| 17 | * @var int |
||
| 18 | */ |
||
| 19 | protected $key = 0; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * A copy of the original data. |
||
| 23 | * |
||
| 24 | * @var mixed[] |
||
| 25 | */ |
||
| 26 | protected $rotation; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Rotation constructor. |
||
| 30 | * |
||
| 31 | * @param array $dataset |
||
| 32 | * The dataset. |
||
| 33 | */ |
||
| 34 | 4 | public function __construct(array $dataset = array()) { |
|
| 38 | |||
| 39 | /** |
||
| 40 | * {@inheritdoc} |
||
| 41 | */ |
||
| 42 | public function key() { |
||
| 45 | |||
| 46 | /** |
||
| 47 | * {@inheritdoc} |
||
| 48 | */ |
||
| 49 | 4 | public function current() { |
|
| 52 | |||
| 53 | /** |
||
| 54 | * Compute the next value of the Iterator. |
||
| 55 | * |
||
| 56 | * @param int $offset |
||
| 57 | * The offset. |
||
| 58 | */ |
||
| 59 | 4 | public function next($offset = 1) { |
|
| 63 | |||
| 64 | /** |
||
| 65 | * {@inheritdoc} |
||
| 66 | */ |
||
| 67 | 4 | public function rewind() { |
|
| 70 | |||
| 71 | /** |
||
| 72 | * {@inheritdoc} |
||
| 73 | */ |
||
| 74 | public function valid() { |
||
| 77 | |||
| 78 | /** |
||
| 79 | * {@inheritdoc} |
||
| 80 | */ |
||
| 81 | 3 | public function count() { |
|
| 84 | |||
| 85 | } |
||
| 86 |