class CachingIterator extends CachingIterator implements Countable

Enhanced caching iterator with first/last/counter tracking.

Properties

bool read-only $first
bool read-only $last
bool read-only $empty
bool read-only $odd
bool read-only $even
int read-only $counter
TKey read-only $nextKey
TValue read-only $nextValue

Methods

__construct(iterable|stdClass $iterable)

No description

bool
isFirst(int|null $gridWidth = null)

Is the current element the first one?

bool
isLast(int|null $gridWidth = null)

Is the current element the last one?

bool
isEmpty()

No description

bool
isOdd()

No description

bool
isEven()

No description

int
getCounter()

No description

int
count()

No description

void
next()

Forwards to the next element.

void
rewind()

Rewinds the Iterator.

mixed
getNextKey()

No description

mixed
getNextValue()

No description

Details

at line 36
__construct(iterable|stdClass $iterable)

No description

Parameters

iterable|stdClass $iterable

at line 48
bool isFirst(int|null $gridWidth = null)

Is the current element the first one?

Parameters

int|null $gridWidth

Return Value

bool

at line 57
bool isLast(int|null $gridWidth = null)

Is the current element the last one?

Parameters

int|null $gridWidth

Return Value

bool

at line 63
bool isEmpty()

No description

Return Value

bool

at line 69
bool isOdd()

No description

Return Value

bool

at line 75
bool isEven()

No description

Return Value

bool

at line 81
int getCounter()

No description

Return Value

int

at line 87
int count()

No description

Return Value

int

at line 102
void next()

Forwards to the next element.

Return Value

void

at line 114
void rewind()

Rewinds the Iterator.

Return Value

void

at line 122
mixed getNextKey()

No description

Return Value

mixed

at line 129
mixed getNextValue()

No description

Return Value

mixed

Traits

Strict class for better experience.