| Total Complexity | 4 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Coverage | 81.25% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class NGrams extends Shift |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var mixed |
||
| 13 | */ |
||
| 14 | protected $currentValue; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * NGrams constructor. |
||
| 18 | * |
||
| 19 | * @param array<int, mixed> $dataset |
||
| 20 | * The dataset |
||
| 21 | * @param int $length |
||
| 22 | * The shift length |
||
| 23 | */ |
||
| 24 | 4 | public function __construct(array $dataset = [], $length = 1) |
|
| 32 | ); |
||
| 33 | 4 | } |
|
| 34 | |||
| 35 | /** |
||
| 36 | * {@inheritdoc} |
||
| 37 | */ |
||
| 38 | 4 | public function current(): mixed |
|
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * {@inheritdoc} |
||
| 45 | * |
||
| 46 | * @return void |
||
| 47 | */ |
||
| 48 | 4 | public function next(): void |
|
| 49 | { |
||
| 50 | 4 | parent::next(); |
|
| 51 | 4 | $this->currentValue = array_slice($this->current, 0, $this->getLength()); |
|
| 52 | 4 | } |
|
| 53 | |||
| 54 | /** |
||
| 55 | * {@inheritdoc} |
||
| 56 | * |
||
| 57 | * @return void |
||
| 58 | */ |
||
| 59 | public function rewind(): void |
||
| 63 | } |
||
| 64 | } |
||
| 65 |