| Total Complexity | 7 |
| Total Lines | 74 |
| Duplicated Lines | 0 % |
| Coverage | 70.83% |
| Changes | 4 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | class Shift extends Iterators |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * Shift constructor. |
||
| 16 | * |
||
| 17 | * @param array<int, mixed> $dataset |
||
| 18 | * The dataset |
||
| 19 | * @param int $length |
||
| 20 | * The shift length |
||
| 21 | */ |
||
| 22 | 4 | public function __construct(array $dataset = [], $length = 1) |
|
| 23 | { |
||
| 24 | 4 | parent::__construct($dataset, $length); |
|
| 25 | 4 | $this->current = $this->getDataset(); |
|
| 26 | 4 | } |
|
| 27 | |||
| 28 | /** |
||
| 29 | * {@inheritdoc} |
||
| 30 | */ |
||
| 31 | 4 | public function count() |
|
| 32 | { |
||
| 33 | 4 | return count($this->getDataset()); |
|
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * {@inheritdoc} |
||
| 38 | * |
||
| 39 | * @return void |
||
| 40 | */ |
||
| 41 | 4 | public function next() |
|
| 44 | 4 | } |
|
| 45 | |||
| 46 | /** |
||
| 47 | * {@inheritdoc} |
||
| 48 | */ |
||
| 49 | public function rewind() |
||
| 52 | } |
||
| 53 | |||
| 54 | /** |
||
| 55 | * {@inheritdoc} |
||
| 56 | * |
||
| 57 | * @return bool |
||
| 58 | */ |
||
| 59 | public function valid() |
||
| 60 | { |
||
| 61 | return true; |
||
| 62 | } |
||
| 63 | |||
| 64 | /** |
||
| 65 | * Internal function to do the shift. |
||
| 66 | * |
||
| 67 | * @param int $length |
||
| 68 | * |
||
| 69 | * @return void |
||
| 70 | */ |
||
| 71 | 4 | protected function doShift($length = 1) |
|
| 86 | ); |
||
| 87 | 4 | } |
|
| 88 | } |
||
| 89 |