| @@ 24-31 (lines=8) @@ | ||
| 21 | * |
|
| 22 | * @return mixed|null |
|
| 23 | */ |
|
| 24 | public function current() |
|
| 25 | { |
|
| 26 | $this->checkLazyLoad(); |
|
| 27 | ||
| 28 | $currentKey = $this->keys[$this->position]; |
|
| 29 | ||
| 30 | return isset($this->items[$currentKey]) ? $this->items[$currentKey] : null; |
|
| 31 | } |
|
| 32 | ||
| 33 | /** |
|
| 34 | * Current iterator position. |
|
| @@ 70-81 (lines=12) @@ | ||
| 67 | * |
|
| 68 | * @return bool |
|
| 69 | */ |
|
| 70 | public function valid() |
|
| 71 | { |
|
| 72 | $this->checkLazyLoad(); |
|
| 73 | ||
| 74 | if (!isset($this->keys[$this->position])) { |
|
| 75 | return false; |
|
| 76 | } |
|
| 77 | ||
| 78 | $currentKey = $this->keys[$this->position]; |
|
| 79 | ||
| 80 | return isset($this->items[$currentKey]); |
|
| 81 | } |
|
| 82 | } |
|
| 83 | ||