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