/** * Increment the float value of a key by the given amount * * @param string $key * @param float $increment * * @return float * @link http://redis.io/commands/incrbyfloat * @example * <pre> * $redis = new Redis(); * $redis->connect('127.0.0.1'); * $redis->set('x', 3); * var_dump( $redis->incrByFloat('x', 1.5) ); // float(4.5) * // ! SIC * var_dump( $redis->get('x') ); // string(3) "4.5" * </pre> */ public function incrByFloat($key, $increment) { try { return $this->client->incrByFloat($key, $increment); } catch (Exception $e) { return $this->handleException($e, __FUNCTION__, func_get_args()); } }
/** * Increment the float value of a key by the given amount * * @param string $key * @param float $increment * * @return float * @link http://redis.io/commands/incrbyfloat * @example * <pre> * $redis = new Redis(); * $redis->connect('127.0.0.1'); * $redis->set('x', 3); * var_dump( $redis->incrByFloat('x', 1.5) ); // float(4.5) * // ! SIC * var_dump( $redis->get('x') ); // string(3) "4.5" * </pre> */ public function incrByFloat($key, $increment) { $this->appendToLog('INCRYBYFLOAT ' . $key . ' ' . $increment); return $this->client->incrByFloat($key, $increment); }
/** * {@inheritdoc} */ public function incrByFloat($key, $increment) { unset($this->cache[$key]); return $this->redis->incrByFloat($key, $increment); }