actorRepository = $actorRepository; $this->actorStoreFactory = $actorStoreFactory; } /** * {@inheritdoc} */ protected function action(): Response { $params = $this->request->getQueryParams(); $didParam = $params['did'] ?? null; if (!is_string($didParam) || trim($didParam) === '') { $this->throwMissingKeyException('did'); } $did = trim($didParam); if (!Did::isValid($did)) { throw XrpcException::invalidParam($this->actionName, 'Invalid DID', $did); } try { $actor = $this->actorRepository->findActorByDid($did); } catch (ActorNotFoundException $e) { throw new XrpcException( 'RepoNotFound', sprintf('Could not find repo for DID: %s', $did), StatusCodeInterface::STATUS_BAD_REQUEST ); } $status = $actor->getRepoStatus(); $active = $status === null; $rev = null; if ($active) { try { $root = $this->actorStoreFactory->get($did)->getRepoRoot()->findByDid($did); $rev = $root->getRev(); } catch (RepoRootNotFoundException $e) { // active actor without an initialised repo $rev = null; } } return $this->respondWithData(new GetRepoStatusResponse( did: $did, active: $active, status: $status, rev: $rev, )); } }