next(); } public function next(): int { $current = $this->value++; if ($current > $this->maxValue()) { throw new \OverflowException(sprintf( 'Sequence "%s" exceeded its maximum value of %d.', $this->name, $this->maxValue() )); } return $current; } public function reset(): self { $this->value = 0; return $this; } }