| Total Complexity | 7 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | class ManyManyIterator implements \Iterator { |
||
| 6 | private $iterator; |
||
| 7 | private $intermediateName; |
||
| 8 | |||
| 9 | public function __construct(\Maphper\Iterator $iterator, $intermediateName = null) { |
||
| 10 | $this->iterator = $iterator; |
||
| 11 | $this->intermediateName = $intermediateName; |
||
| 12 | } |
||
| 13 | |||
| 14 | public function current() { |
||
| 15 | if ($this->intermediateName) return $this->iterator->current()->{$this->intermediateName}; |
||
| 16 | return $this->iterator->current(); |
||
| 17 | } |
||
| 18 | |||
| 19 | public function key() { |
||
| 20 | return $this->iterator->key(); |
||
| 21 | } |
||
| 22 | |||
| 23 | public function next() { |
||
| 24 | $this->iterator->next(); |
||
| 25 | } |
||
| 26 | |||
| 27 | public function valid() { |
||
| 28 | return $this->iterator->valid(); |
||
| 29 | } |
||
| 30 | |||
| 31 | public function rewind() { |
||
| 33 | } |
||
| 34 | } |
||
| 35 |