| Conditions | 5 |
| Paths | 4 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 7 | private function map() |
|
| 19 | { |
||
| 20 | 7 | if ($this->valid()) { |
|
| 21 | 7 | $result = ($this->callback)($this->getInnerIterator()); |
|
| 22 | 7 | if (is_array($result)) { |
|
| 23 | 4 | list($this->currentKey, $this->currentValue) = $result; |
|
| 24 | 4 | if (is_numeric($this->currentKey) && intval($this->currentKey) >= $this->currentIdx) { |
|
| 25 | 2 | $this->currentIdx = intval($this->currentKey) + 1; |
|
| 26 | } |
||
| 27 | } else { |
||
| 28 | 3 | $this->currentKey = $this->currentIdx++; |
|
| 29 | 3 | $this->currentValue = $result; |
|
| 30 | } |
||
| 31 | } else { |
||
| 32 | 7 | $this->currentKey = null; |
|
| 33 | 7 | $this->currentValue = null; |
|
| 34 | } |
||
| 35 | 7 | } |
|
| 36 | |||
| 60 |