-
-
Notifications
You must be signed in to change notification settings - Fork 0
RepeatableIteratorIterator
github-actions edited this page Mar 31, 2026
·
2 revisions
An iterator that enables repeated iteration over a finite subset of an infinite iterator.
This iterator wraps an Iterator and applies a LimitIterator over an InfiniteIterator,
allowing a limited number of repeated iterations without modifying the underlying iterator.
It also implements Countable to return the number of elements available in the limited iteration.
- Full name:
\FastForward\Iterator\RepeatableIteratorIterator - Parent class:
LimitIterator - This class implements:
Countable
Initializes the RepeatableIteratorIterator.
public __construct(iterable $iterator, int $limit, int $offset = 0): mixedParameters:
| Parameter | Type | Description |
|---|---|---|
$iterator |
iterable | the iterator to be wrapped in an infinite loop |
$limit |
int | the maximum number of elements to iterate over per cycle |
$offset |
int | the starting offset within the iterator |
Returns the number of elements that can be iterated per cycle.
public count(): intReturn Value:
the count of items in the limited iteration