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