ManyManyIterator::next()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Maphper\Relation;
4
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() {
32
		$this->iterator->rewind();
33
	}
34
}
35