/** * Prepend a Box to the beginning of the linked list and return this instance. */ public function prepend(Box $b) : Box { if ($this->prev === null && $b->next === null) { $this->prev = $b; $b->next = $this; } else { $this->head()->prepend($b->tail()); } return $this; }