apiKeyService = $apiKeyService; } /** * @throws VerifyAuthenticationException */ public function verify(ServerRequestInterface $request): void { $apiKey = $request->getHeaderLine(self::HEADER_NAME); if ($this->apiKeyService->check($apiKey)) { return; } throw VerifyAuthenticationException::withError( RestUtils::INVALID_API_KEY_ERROR, 'Provided API key does not exist or is invalid.' ); } public function update(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface { return $response; } }