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