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