redis->hSet($key, (string)$userId, $token); } /** * @param int $userId * @return false|mixed|\Redis|string * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ public function getUserToken(int $userId): mixed { $key = CommonRedisKey::userTokenHashKey(); return $this->redis->hGet($key, (string)$userId); } /** * @param int $userId * @return void * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ public function removeUserToken(int $userId): void { $key = CommonRedisKey::userTokenHashKey(); $this->redis->hDel($key, (string)$userId); } }