public function addItem(Title $title, Label $label, $description) { $count = count($this->items); $this->items[$count]['title'] = $title->toArray(); $this->items[$count]['label'] = $label->toArray(); $this->items[$count]['description'] = $description; }
public function addItem(Title $title, $label, $description) { $count = count($this->items); $this->items[$count]['title'] = $title->toArray(); if ($label instanceof Label) { $this->items[$count]['label'] = $label->toArray(); } $this->items[$count]['description'] = $description; }