CacheTool\Proxy\ApcuProxy::apcu_inc PHP Method

apcu_inc() public method

Increase a stored number
Since: 3.1.1
public apcu_inc ( string $key, integer $step = 1, stdClass $ref = false ) : mixed
$key string The key of the value being increased.
$step integer The step, or value to increased.
$ref stdClass success is set to TRUE in success and FALSE in failure
return mixed Returns the current value of key's value on success, or FALSE on failure
    public function apcu_inc($key, $step = 1, $ref = false)
    {
        $code = new Code();
        $code->addStatement('$success = false;');
        $code->addStatement(sprintf('$result = apcu_inc(%s, %s, $success);', var_export($key, true), var_export($step, true)));
        $code->addStatement('return array($result, $success);');
        list($result, $success) = $this->adapter->run($code);
        if (is_object($ref)) {
            $ref->success = $success;
        }
        return $result;
    }