public function getById(OrderId $orderId) : Order { if (!array_key_exists((string) $orderId, $this->orders)) { throw OrderNotFoundException::byId($orderId); } return $this->orders[(string) $orderId]; }