items[] = $item; } public function remove(mixed $item): void { $key = array_search($item, $this->items, true); if ($key) { unset($this->items[$key]); } $this->items = array_values($this->items); } public function toArray(): array { return $this->items; } }