Mock
in package
implements
Recursive
Class \Hoa\Iterator\Recursive\Mock.
Mock a recursive iterator with no children. It allows to use regular iterators with a recursive iterator iterator.
Tags
Table of Contents
Interfaces
- Recursive
- Class \Hoa\Iterator\Recursive.
Properties
- $_iterator : Traversable
- Current iterator.
Methods
- __construct() : mixed
- Constructor.
- current() : mixed
- Return the current element.
- getChildren() : void
- Return an iterator for the current entry.
- hasChildren() : bool
- Return if an iterator can be created for the current entry.
- key() : mixed
- Return the key of the current element.
- next() : void
- Move forward to next element.
- rewind() : void
- Rewind the iterator to the first element.
- valid() : bool
- Check if current position is valid.
Properties
$_iterator
Current iterator.
protected
Traversable
$_iterator
= null
Methods
__construct()
Constructor.
public
__construct(Traversable $iterator) : mixed
Parameters
- $iterator : Traversable
-
Iterator.
current()
Return the current element.
public
current() : mixed
getChildren()
Return an iterator for the current entry.
public
getChildren() : void
It's a fake, we return null.
hasChildren()
Return if an iterator can be created for the current entry.
public
hasChildren() : bool
It's a fake, we return false.
Return values
boolkey()
Return the key of the current element.
public
key() : mixed
next()
Move forward to next element.
public
next() : void
rewind()
Rewind the iterator to the first element.
public
rewind() : void
valid()
Check if current position is valid.
public
valid() : bool