protected function doIncrement($key, $offset, $initial, $expire)
{
if (!$this->exists($key)) {
$this->set($key, $initial, $expire);
return $initial;
}
$value = $this->get($key);
if (!is_numeric($value) || $value < 0) {
return false;
}
$value += $offset;
// value can never be lower than 0
$value = max(0, $value);
$this->set($key, $value, $expire);
return $value;
}