| 1 | <?php | ||
| 8 | class Container | ||
| 9 | { | ||
| 10 | private $items; | ||
| 11 | |||
| 12 | /** | ||
| 13 | * Container constructor. | ||
| 14 | * | ||
| 15 | * @param array ...$items | ||
| 16 | */ | ||
| 17 | public function __construct(...$items) | ||
| 21 | |||
| 22 | /** | ||
| 23 | * @return array | ||
| 24 | */ | ||
| 25 | public function getItems() | ||
| 29 | |||
| 30 | /** | ||
| 31 | * @param $index | ||
| 32 | * | ||
| 33 | * @return mixed|null | ||
| 34 | */ | ||
| 35 | public function getItem($index) | ||
| 39 | |||
| 40 | /** | ||
| 41 | * Get first item of container | ||
| 42 | * | ||
| 43 | * @return mixed | ||
| 44 | */ | ||
| 45 | public function first() | ||
| 49 | |||
| 50 | /** | ||
| 51 | * Get last item of container | ||
| 52 | * | ||
| 53 | * @return mixed | ||
| 54 | */ | ||
| 55 | public function last() | ||
| 59 | } | ||
| 60 |