src/LinguaLeo/Cache/Provider/MemCache.php
public function update($key, callable $modifier, $ttl = 0)
    {
        list($data, $token) = $this->get_with_cas($key);
        if (false === $data) {
            return false;
        }
        $modifier($data);
        if ($this->memcached->cas($token, $key, $data, $ttl)) {
            return $data;
        }
        throw new AtomicViolationException(
            sprintf(
                'Atomic violation occurred "%s" when updating the key "%s" with the token "%g".',
                $this->memcached->getResultMessage(),
                $key,
                $token
            )
        );
    }
public function update($key, callable $modifier, $ttl = 0)
    {
        list($data, $token) = $this->get_with_cas($key);
        if (false === $data) {
            return false;
        }
        $modifier($data);
        if ($this->memcached->cas($token, $key, $data, $ttl)) {
            return $data;
        }
        throw new AtomicViolationException(
            sprintf(
                'Atomic violation occurred "%s" when updating the key "%s" with the token "%g".',
                $this->memcached->getResultMessage(),
                $key,
                $token
            )
        );
    }
{@inheritdoc}