src/LinguaLeo/Cache/Provider/RedisCache.php
public function add($key, $data, $ttl = 0)
    {
        if ($ttl > 0) {
            $uid = uniqid('temp_key', true);
            $result = $this->multi($key)
                ->setex($uid, (int)$ttl, $data)
                ->renameNx($uid, $key)
                ->delete($uid)
                ->exec();
            return !empty($result[1]);
        }
        return $this->redis->setnx($key, $data);
    }
public function add($key, $data, $ttl = 0)
    {
        if ($ttl > 0) {
            $uid = uniqid('temp_key', true);
            $result = $this->multi($key)
                ->setex($uid, (int)$ttl, $data)
                ->renameNx($uid, $key)
                ->delete($uid)
                ->exec();
            return !empty($result[1]);
        }
        return $this->redis->setnx($key, $data);
    }
{@inheritdoc}