Hoa central
Mock.php
Go to the documentation of this file.
1 <?php
2 
37 namespace Hoa\Iterator\Recursive;
38 
48 class Mock implements Recursive
49 {
55  protected $_iterator = null;
56 
57 
58 
65  public function __construct(\Traversable $iterator)
66  {
67  if ($iterator instanceof \IteratorAggregate) {
68  $iterator = $iterator->getIterator();
69  }
70 
71  $this->_iterator = $iterator;
72 
73  return;
74  }
75 
81  public function current()
82  {
83  return $this->_iterator->current();
84  }
85 
91  public function key()
92  {
93  return $this->_iterator->key();
94  }
95 
101  public function next()
102  {
103  return $this->_iterator->next();
104  }
105 
111  public function rewind()
112  {
113  return $this->_iterator->rewind();
114  }
115 
121  public function valid()
122  {
123  return $this->_iterator->valid();
124  }
125 
132  public function getChildren()
133  {
134  return null;
135  }
136 
143  public function hasChildren()
144  {
145  return false;
146  }
147 }
__construct(\Traversable $iterator)
Definition: Mock.php:65