|
@@ 26-29 (lines=4) @@
|
| 23 |
|
|
| 24 |
|
public function next() |
| 25 |
|
{ |
| 26 |
|
if (isset($this->items[$this->position + 1]) === false) { |
| 27 |
|
$nextPosition = $this->position + 1; |
| 28 |
|
throw new ScannerReachedEnd("Tried to move to position {$nextPosition} but reached end"); |
| 29 |
|
} |
| 30 |
|
|
| 31 |
|
$this->position++; |
| 32 |
|
|
|
@@ 43-46 (lines=4) @@
|
| 40 |
|
|
| 41 |
|
public function back() |
| 42 |
|
{ |
| 43 |
|
if (isset($this->items[$this->position - 1]) === false) { |
| 44 |
|
$nextPosition = $this->position - 1; |
| 45 |
|
throw new ScannerReachedEnd("Tried to move to position {$nextPosition} but reached end"); |
| 46 |
|
} |
| 47 |
|
|
| 48 |
|
$this->position--; |
| 49 |
|
|