redis->get(AdminRedisKey::adminUserToken($userId),RedisCode::SYSTEM_DB) ?? false; } /** * @param $userId * @param string $token * @param int $ttl * @return bool * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface * @throws \RedisException */ public function setAdminToken($userId, string $token, int $ttl): bool { $key = AdminRedisKey::adminUserToken($userId); $this->redis->delete($key,RedisCode::SYSTEM_DB); return $this->redis->setEx($key, $token, $ttl, RedisCode::SYSTEM_DB); } }