class CachingIterator extends CachingIterator implements Countable

internal  
 

Smarter caching iterator.

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
int read-only $counter0
mixed read-only $nextKey
mixed read-only $nextValue
?self read-only $parent

Methods

__construct(mixed $iterator, CachingIterator|null $parent = null)

No description

bool
isFirst(int|null $width = null)

Is the current element the first one?

bool
isLast(int|null $width = null)

Is the current element the last one?

bool
isEmpty()

Is the iterator empty?

bool
isOdd()

Is the counter odd?

bool
isEven()

Is the counter even?

int
getCounter()

Returns the 1-indexed counter.

int
getCounter0()

Returns the 0-indexed counter.

void
skipRound()

Decrements the counter (minimum 0) to skip the current iteration in counting.

string
__toString()

No description

int
count()

No description

void
next()

Forwards to the next element.

void
rewind()

Rewinds the Iterator.

mixed
getNextKey()

Returns the next key or null if position is not valid.

mixed
getNextValue()

Returns the next element or null if position is not valid.

getParent()

Returns the iterator surrounding the current one.

mixed
__get(string $name)

Returns property value.

bool
__isset(string $name)

Is property defined?

Details

at line 35
__construct(mixed $iterator, CachingIterator|null $parent = null)

No description

Parameters

mixed $iterator
CachingIterator|null $parent

at line 60
bool isFirst(int|null $width = null)

Is the current element the first one?

Parameters

int|null $width

Return Value

bool

at line 69
bool isLast(int|null $width = null)

Is the current element the last one?

Parameters

int|null $width

Return Value

bool

at line 78
bool isEmpty()

Is the iterator empty?

Return Value

bool

at line 87
bool isOdd()

Is the counter odd?

Return Value

bool

at line 96
bool isEven()

Is the counter even?

Return Value

bool

at line 105
int getCounter()

Returns the 1-indexed counter.

Return Value

int

at line 114
int getCounter0()

Returns the 0-indexed counter.

Return Value

int

at line 123
void skipRound()

Decrements the counter (minimum 0) to skip the current iteration in counting.

Return Value

void

at line 129
string __toString()

No description

Return Value

string

at line 135
int count()

No description

Return Value

int

at line 150
void next()

Forwards to the next element.

Return Value

void

at line 162
void rewind()

Rewinds the Iterator.

Return Value

void

at line 172
mixed getNextKey()

Returns the next key or null if position is not valid.

Return Value

mixed

at line 182
mixed getNextValue()

Returns the next element or null if position is not valid.

Return Value

mixed

at line 192
CachingIterator|null getParent()

Returns the iterator surrounding the current one.

Return Value

CachingIterator|null

at line 205
mixed __get(string $name)

Returns property value.

Parameters

string $name

Return Value

mixed

Exceptions

LogicException

at line 218
bool __isset(string $name)

Is property defined?

Parameters

string $name

Return Value

bool