| @@ 575-582 (lines=8) @@ | ||
| 572 | /** |
|
| 573 | * {@inheritdoc} |
|
| 574 | */ |
|
| 575 | public function first() |
|
| 576 | { |
|
| 577 | if ($this->count() === 0) { |
|
| 578 | throw new OutOfBoundException('There is no first item'); |
|
| 579 | } |
|
| 580 | ||
| 581 | return array_values($this->values)[0]; |
|
| 582 | } |
|
| 583 | ||
| 584 | /** |
|
| 585 | * {@inheritdoc} |
|
| @@ 587-596 (lines=10) @@ | ||
| 584 | /** |
|
| 585 | * {@inheritdoc} |
|
| 586 | */ |
|
| 587 | public function last() |
|
| 588 | { |
|
| 589 | if ($this->count() === 0) { |
|
| 590 | throw new OutOfBoundException('There is no last item'); |
|
| 591 | } |
|
| 592 | ||
| 593 | $values = array_values($this->values); |
|
| 594 | ||
| 595 | return end($values); |
|
| 596 | } |
|
| 597 | ||
| 598 | /** |
|
| 599 | * {@inheritdoc} |
|