public function getById(OrderId $id) : Order { if (!$this->exists($id)) { throw new OrderNotFoundException(); } return $this->orders[(string) $id]; }