/**
  * {@inheritdoc}
  */
 public function delete(RefreshTokenEntity $token)
 {
     // Deletes the access token entry.
     $key = RedisUtil::prefix($token->getId(), 'oauth_refresh_tokens');
     if (isset($this->cache[$key])) {
         unset($this->cache[$key]);
     }
     RedisCapsule::del($key);
     // Deletes the access token entry from the access tokens set.
     $key = RedisUtil::prefix(null, 'oauth_refresh_tokens');
     if (isset($this->cache[$key]) && ($cacheKey = array_search($token->getId(), $this->cache[$key])) !== false) {
         unset($this->cache[$key][$cacheKey]);
     }
     RedisCapsule::srem($key, $token->getId());
 }
 /**
  * {@inheritdoc}
  */
 public function delete(AuthCodeEntity $token)
 {
     // // Deletes the authorization code entry.
     $key = RedisUtil::prefix($token->getId(), 'oauth_auth_codes');
     if (isset($this->cache[$key])) {
         unset($this->cache[$key]);
     }
     RedisCapsule::del($key);
     // // Deletes the authorization code entry from the authorization codes set.
     $key = RedisUtil::prefix(null, 'oauth_auth_codes');
     if (isset($this->cache[$key]) && ($cacheKey = array_search($token->getId(), $this->cache[$key])) !== false) {
         unset($this->cache[$key][$cacheKey]);
     }
     RedisCapsule::srem($key, $token->getId());
     // // Deletes the authorization codes associated scopes.
     $key = RedisUtil::prefix($token->getId(), 'oauth_auth_code_scopes');
     if (isset($this->cache[$key])) {
         unset($this->cache[$key]);
     }
     RedisCapsule::del($key);
 }