isRequestPost()) { throw new MethodNotAllowed(); } $this->getKeyChainGenerator()->generate(); $this->setSuccessJsonResponse([]); } catch (MethodNotAllowed $exception) { $this->setErrorJsonResponse($exception->getMessage(), 0, [], 404); } catch (Throwable $exception) { $this->setErrorJsonResponse($exception->getMessage(), 0, [], 500); } } private function getKeyChainGenerator(): KeyChainGeneratorInterface { return $this->getServiceLocator()->get(CachedKeyChainGenerator::class); } }