/** * Decrement the number stored at key by one. If the second argument is filled, it will be used as the integer * value of the decrement. * * @param string $key * @param int $value that will be substracted to key (only for decrBy) * * @return int the new value * @link http://redis.io/commands/decrby * @example * <pre> * $redis->decr('key1'); // key1 didn't exists, set to 0 before the increment and now has the value -1 * $redis->decr('key1'); // -2 * $redis->decr('key1'); // -3 * $redis->decrBy('key1', 10); // -13 * </pre> */ public function decrBy($key, $value) { try { return $this->client->decrBy($key, $value); } catch (Exception $e) { return $this->handleException($e, __FUNCTION__, func_get_args()); } }
/** * Decrement the number stored at key by one. If the second argument is filled, it will be used as the integer * value of the decrement. * * @param string $key * @param int $value that will be substracted to key (only for decrBy) * * @return int the new value * @link http://redis.io/commands/decrby * @example * <pre> * $redis->decr('key1'); // key1 didn't exists, set to 0 before the increment and now has the value -1 * $redis->decr('key1'); // -2 * $redis->decr('key1'); // -3 * $redis->decrBy('key1', 10); // -13 * </pre> */ public function decrBy($key, $value) { $this->appendToLog('DECRBY ' . $key . ' ' . $value); return $this->client->decrBy($key, $value); }
/** * {@inheritdoc} */ public function decrBy($key, $value) { unset($this->cache[$key]); return $this->redis->decrBy($key, $value); }