Hoa central
Public Member Functions | Protected Attributes | List of all members
Hoa\Iterator\Recursive\Mock Class Reference
Inheritance diagram for Hoa\Iterator\Recursive\Mock:

Public Member Functions

 __construct (\Traversable $iterator)
 
 current ()
 
 key ()
 
 next ()
 
 rewind ()
 
 valid ()
 
 getChildren ()
 
 hasChildren ()
 

Protected Attributes

 $_iterator = null
 

Detailed Description

Class .

Mock a recursive iterator with no children. It allows to use regular iterators with a recursive iterator iterator.

Definition at line 48 of file Mock.php.

Constructor & Destructor Documentation

Hoa\Iterator\Recursive\Mock::__construct ( \Traversable  $iterator)

Constructor.

Parameters
\Traversable$iteratorIterator.
Returns
void

Definition at line 65 of file Mock.php.

66  {
67  if ($iterator instanceof \IteratorAggregate) {
68  $iterator = $iterator->getIterator();
69  }
70 
71  $this->_iterator = $iterator;
72 
73  return;
74  }

Member Function Documentation

Hoa\Iterator\Recursive\Mock::current ( )

Return the current element.

Returns
mixed

Definition at line 81 of file Mock.php.

82  {
83  return $this->_iterator->current();
84  }
Hoa\Iterator\Recursive\Mock::getChildren ( )

Return an iterator for the current entry. It's a fake, we return null.

Returns
void

Definition at line 132 of file Mock.php.

133  {
134  return null;
135  }
Hoa\Iterator\Recursive\Mock::hasChildren ( )

Return if an iterator can be created for the current entry. It's a fake, we return false.

Returns
bool

Definition at line 143 of file Mock.php.

144  {
145  return false;
146  }
Hoa\Iterator\Recursive\Mock::key ( )

Return the key of the current element.

Returns
mixed

Definition at line 91 of file Mock.php.

92  {
93  return $this->_iterator->key();
94  }
Hoa\Iterator\Recursive\Mock::next ( )

Move forward to next element.

Returns
void

Definition at line 101 of file Mock.php.

102  {
103  return $this->_iterator->next();
104  }
Hoa\Iterator\Recursive\Mock::rewind ( )

Rewind the iterator to the first element.

Returns
void

Definition at line 111 of file Mock.php.

112  {
113  return $this->_iterator->rewind();
114  }
Hoa\Iterator\Recursive\Mock::valid ( )

Check if current position is valid.

Returns
bool

Definition at line 121 of file Mock.php.

122  {
123  return $this->_iterator->valid();
124  }

Member Data Documentation

Hoa\Iterator\Recursive\Mock::$_iterator = null
protected

Definition at line 55 of file Mock.php.


The documentation for this class was generated from the following file: