| @@ 80-91 (lines=12) @@ | ||
| 77 | * @return void |
|
| 78 | * @throws IllegalStateException |
|
| 79 | */ |
|
| 80 | public function remove() |
|
| 81 | { |
|
| 82 | if($this->canRemove) |
|
| 83 | { |
|
| 84 | $this->list->removeAt($this->index--); |
|
| 85 | $this->canRemove = false; |
|
| 86 | } |
|
| 87 | else |
|
| 88 | { |
|
| 89 | throw new IllegalStateException("Cannot remove element unless next has been called"); |
|
| 90 | } |
|
| 91 | } |
|
| 92 | } |
|
| @@ 75-86 (lines=12) @@ | ||
| 72 | * @return void |
|
| 73 | * @throws IllegalStateException |
|
| 74 | */ |
|
| 75 | public function remove() |
|
| 76 | { |
|
| 77 | if($this->canRemove) |
|
| 78 | { |
|
| 79 | $this->list->removeAt($this->index); |
|
| 80 | $this->canRemove = false; |
|
| 81 | } |
|
| 82 | else |
|
| 83 | { |
|
| 84 | throw new IllegalStateException("Cannot remove element unless next has been called"); |
|
| 85 | } |
|
| 86 | } |
|
| 87 | } |
|