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