src/M6Web/Component/Redis/Cache.php
public function incr($key, $incr = 1)
    {
        $keyP = $this->getPatternKey().$key;
        $func = function ($redis) use ($keyP, $incr) {
            try {
                $start = microtime(true);
                $ret = $redis->incrby($keyP, $incr);
                $this->notifyEvent('incrby', array($keyP, $incr), microtime(true) - $start);

                return $ret;
            } catch (Predis\ServerException $e) {
                return null;
            }
        };

        if (true === $this->multi) {
            $this->addToExecList($key, $func);

            return $this;
        } else {
            if (is_null($ret = $func($this->getRedis($key)))) {
                throw new Exception("Cant increment key ".$key.", not an integer ?");
            }

            return $ret;
        }
    }
public function incr($key, $incr = 1)
    {
        $keyP = $this->getPatternKey().$key;
        $func = function ($redis) use ($keyP, $incr) {
            try {
                $start = microtime(true);
                $ret = $redis->incrby($keyP, $incr);
                $this->notifyEvent('incrby', array($keyP, $incr), microtime(true) - $start);

                return $ret;
            } catch (Predis\ServerException $e) {
                return null;
            }
        };

        if (true === $this->multi) {
            $this->addToExecList($key, $func);

            return $this;
        } else {
            if (is_null($ret = $func($this->getRedis($key)))) {
                throw new Exception("Cant increment key ".$key.", not an integer ?");
            }

            return $ret;
        }
    }
increment a value (incr)

@param string  $key  la clé
@param integer $incr valeur

@throws Exception
@return int