public static function incr(string $key)
    {
        $currentValue = self::get($key);

        return self::set($key, (int)$currentValue + 1);
    }
public static function incr(string $key)
    {
        $currentValue = self::get($key);

        return self::set($key, (int)$currentValue + 1);
    }
public static function incr ( string $ key ) { $ currentValue = self :: get ( $ key ) ; return self :: set ( $ key , ( int ) $ currentValue + 1 ) ; }
Increments the value of the value that was previously set for the given key. If no value is known, it will assume it to be 0.
It casts non-integer values to an integer if necessary.

@param string $key
@return int The new value
Increments the value of the value that was previously set for the given key . If no value is known it will assume it to be 0 . It casts non - integer values to an integer if necessary .