getKeyChainRepository() ->findAll($query) ->getKeyChains(); $keyChain = reset($keyChainCollection); if (false === $keyChain) { throw new OAuthServerException( 'Invalid key chain identifier', 11, 'key_chain_not_found', 404 ); } return $this->getAuthorizationServerFactory() ->create($keyChain) ->respondToAccessTokenRequest($request, $response); } private function getKeyChainRepository(): KeyChainRepositoryInterface { return $this->getServiceLocator()->get(CachedPlatformKeyChainRepository::class); } private function getAuthorizationServerFactory(): AuthorizationServerFactory { return $this->getServiceLocator()->get(AuthorizationServerFactory::class); } }