id) { return $this->repo->ofId($cmd->id); } if ($cmd->gateway && $cmd->externalId) { return $this->repo->ofExteranlId($cmd->gateway, $cmd->externalId); } throw new InvalidArgumentException('Invalid command: ' . $cmd::class); } }