/**
  * {@inheritdoc}
  */
 public function create($token, $expireTime, $sessionId)
 {
     $payload = ['id' => $token, 'expire_time' => $expireTime, 'session_id' => $sessionId];
     $key = RedisUtil::prefix($token, 'oauth_access_tokens');
     $this->cache[$key] = $payload;
     RedisCapsule::set($key, RedisUtil::prepare($payload));
     $key = RedisUtil::prefix(null, 'oauth_access_tokens');
     if (!isset($this->cache[$key])) {
         $this->cache[$key] = [];
     }
     array_push($this->cache[$key], $token);
     RedisCapsule::sadd($key, RedisUtil::prepare($token));
 }
 /**
  * {@inheritdoc}
  */
 public function create($ownerType, $ownerId, $clientId, $clientRedirectUri = null)
 {
     $key = RedisUtil::prefix(null, 'oauth_session_ids');
     $sessionId = RedisCapsule::incr($key);
     $key = RedisUtil::prefix($sessionId, 'oauth_sessions');
     $value = ['id' => $sessionId, 'client_id' => $clientId, 'owner_type' => $ownerType, 'owner_id' => $ownerId];
     $this->cache[$key] = $value;
     RedisCapsule::set($key, RedisUtil::prepare($value));
     return $sessionId;
 }