src/LinguaLeo/Cache/Provider/RedisCache.php
public function update($key, callable $modifier, $ttl = 0)
    {
        $this->redis->watch($key);
        $data = $this->redis->get($key);
        if ($data === false) {
            $this->redis->unwatch();
            return false;
        } else {
            $modifier($data);
            if ($this->setInTransaction($key, $data, (int)$ttl)) {
                return $data;
            }
        }
        throw new AtomicViolationException("Atomic violation occurred when updating key \"{$key}\".");
    }
public function update($key, callable $modifier, $ttl = 0)
    {
        $this->redis->watch($key);
        $data = $this->redis->get($key);
        if ($data === false) {
            $this->redis->unwatch();
            return false;
        } else {
            $modifier($data);
            if ($this->setInTransaction($key, $data, (int)$ttl)) {
                return $data;
            }
        }
        throw new AtomicViolationException("Atomic violation occurred when updating key \"{$key}\".");
    }
{@inheritdoc}