From aa0a89acde5a2cb857e2c7c8f5241f4b5c470298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Ballang=C3=A9?= Date: Wed, 20 Jun 2012 13:14:34 -0300 Subject: [PATCH 01/97] Add missing {} after incrByFloat() --- redisphp.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redisphp.php b/redisphp.php index 6195584..953c583 100644 --- a/redisphp.php +++ b/redisphp.php @@ -380,7 +380,7 @@ public function incr( $key ) {} * var_dump( $redis->get('x') ); // string(3) "4.5" * */ - public function incrByFloat( $key, $increment ) + public function incrByFloat( $key, $increment ) {} /** * Increment the number stored at key by one. If the second argument is filled, it will be used as the integer From c5f13d2c0819be8098fde8c321fab98753718546 Mon Sep 17 00:00:00 2001 From: Max Kamashev Date: Sun, 15 Jul 2012 18:00:40 +0400 Subject: [PATCH 02/97] Add new commands bitCount(), bitOp() Change info for Info() --- redisphp.php | 50 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/redisphp.php b/redisphp.php index 6195584..3208241 100644 --- a/redisphp.php +++ b/redisphp.php @@ -1703,6 +1703,44 @@ public function getBit( $key, $offset ) {} */ public function setBit( $key, $offset, $value ) {} + /** + * Count bits in a string. + * + * @param string $key + * @return int The number of bits set to 1 in the value behind the input key. + * @link http://redis.io/commands/bitcount + * @example + *
+     * $redis->set('bit', '345'); // // 11 0011  0011 0100  0011 0101
+     * var_dump( $redis->bitCount('bit', 0, 0) ); // int(4)
+     * var_dump( $redis->bitCount('bit', 1, 1) ); // int(3)
+     * var_dump( $redis->bitCount('bit', 2, 2) ); // int(4)
+     * var_dump( $redis->bitCount('bit', 0, 2) ); // int(11)
+     * 
+ */ + public function bitCount( $key ) {} + + /** + * Bitwise operation on multiple keys. + * + * @param string $operation either "AND", "OR", "NOT", "XOR" + * @param string $retKey return key + * @param string $key1 + * @param string $key2 + * @return int The size of the string stored in the destination key. + * @link http://redis.io/commands/bitop + * @example + *
+     * $redis->set('bit1', '1'); // 11 0001
+     * $redis->set('bit2', '2'); // 11 0010
+     *
+     * $redis->bitOp('AND', 'bit', 'bit1', 'bit2'); // bit = 110000
+     * $redis->bitOp('OR',  'bit', 'bit1', 'bit2'); // bit = 110011
+     * $redis->bitOp('NOT', 'bit', 'bit1', 'bit2'); // bit = 110011
+     * $redis->bitOp('XOR', 'bit', 'bit1', 'bit2'); // bit = 11
+     * 
+ */ + public function bitOp( $operation, $retKey, $key1, $key2, $key3 = null ) {} /** * Removes all entries from the current database. @@ -1802,7 +1840,15 @@ public function sort( $key, $option = null ) {} * - vm_enabled * - role * @link http://redis.io/commands/info - * @example $redis->info(); + * @example + *
+     * $redis->info();
+     *
+     * or
+     *
+     * $redis->info("COMMANDSTATS"); //Information on the commands that have been run (>=2.6 only)
+     * $redis->info("CPU"); // just CPU information from Redis INFO
+     * 
*/ public function info( $option = null ) {} @@ -2112,7 +2158,7 @@ public function zRangeByScore( $key, $start, $end, array $options = array() ) {} * @param int $start * @param int $end * @param array $options - * + * * @return array */ public function zRevRangeByScore( $key, $start, $end, array $options = array() ) {} From 522f301950ef40b7d52aa9e811cdffcae7ada409 Mon Sep 17 00:00:00 2001 From: Max Kamashev Date: Sun, 15 Jul 2012 19:04:00 +0400 Subject: [PATCH 03/97] Add new commands: eval(), evalSha(), script(), getLastError(), _prefix(), _unserialize(), dump(), restore(), migrate(), time() --- redisphp.php | 169 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 169 insertions(+) diff --git a/redisphp.php b/redisphp.php index eed0524..5c20833 100644 --- a/redisphp.php +++ b/redisphp.php @@ -5,6 +5,29 @@ * @link https://github.com/ukko/phpredis-phpdoc * * @method echo string $string Sends a string to Redis, which replies with the same string + * + * @method eval( $script, $args = array(), $numKeys = 0 ) + * Evaluate a LUA script serverside + * @param string $script + * @param array $args + * @param int $numKeys + * @return Mixed. What is returned depends on what the LUA script itself returns, which could be a scalar value + * (int/string), or an array. Arrays that are returned can also contain other arrays, if that's how it was set up in + * your LUA script. If there is an error executing the LUA script, the getLastError() function can tell you the + * message that came back from Redis (e.g. compile error). + * @link http://redis.io/commands/eval + * @example + *
+ *  $redis->eval("return 1"); // Returns an integer: 1
+ *  $redis->eval("return {1,2,3}"); // Returns Array(1,2,3)
+ *  $redis->del('mylist');
+ *  $redis->rpush('mylist','a');
+ *  $redis->rpush('mylist','b');
+ *  $redis->rpush('mylist','c');
+ *  // Nested response:  Array(1,2,3,Array('a','b','c'));
+ *  $redis->eval("return {1,2,3,redis.call('lrange','mylist',0,-1)}}");
+ * 
+ * */ class Redis { @@ -2706,6 +2729,152 @@ public function hMGet( $key, $hashKeys ) {} * */ public function config( $operation, $key, $value ) {} + + /** + * Evaluate a LUA script serverside, from the SHA1 hash of the script instead of the script itself. + * In order to run this command Redis will have to have already loaded the script, either by running it or via + * the SCRIPT LOAD command. + * @param string $scriptSha + * @param array $args + * @param int $numKeys + * @return mixed. @see eval() + * @see eval() + * @link http://redis.io/commands/evalsha + * @example + *
+     * $script = 'return 1';
+     * $sha = $redis->script('load', $script);
+     * $redis->evalSha($sha); // Returns 1
+     * 
+ */ + public function evalSha( $scriptSha, $args = array(), $numKeys = 0 ) {} + + /** + * Execute the Redis SCRIPT command to perform various operations on the scripting subsystem. + * @param string $command load | flush | kill | exists + * @param string $script + * @return mixed + * @link http://redis.io/commands/script-load + * @link http://redis.io/commands/script-kill + * @link http://redis.io/commands/script-flush + * @link http://redis.io/commands/script-exists + * @example + *
+     * $redis->script('load', $script);
+     * $redis->script('flush');
+     * $redis->script('kill');
+     * $redis->script('exists', $script1, [$script2, $script3, ...]);
+     * 
+ * + * SCRIPT LOAD will return the SHA1 hash of the passed script on success, and FALSE on failure. + * SCRIPT FLUSH should always return TRUE + * SCRIPT KILL will return true if a script was able to be killed and false if not + * SCRIPT EXISTS will return an array with TRUE or FALSE for each passed script + */ + public function script( $command, $script ) {} + + /** + * The last error message (if any) returned from a SCRIPT call + * @return string A string with the last returned script based error message, or NULL if there is no error + * @example + *
+     * $redis->eval('this-is-not-lua');
+     * $err = $redis->getLastError();
+     * // "ERR Error compiling script (new function): user_script:1: '=' expected near '-'"
+     * 
+ */ + public function getLastError() {} + + /** + * A utility method to prefix the value with the prefix setting for phpredis. + * @param $value The value you wish to prefix + * @return string If a prefix is set up, the value now prefixed. If there is no prefix, the value will be returned unchanged. + * @example + *
+     * $redis->setOpt(Redis::OPT_PREFIX, 'my-prefix:');
+     * $redis->_prefix('my-value'); // Will return 'my-prefix:my-value'
+     * 
+ */ + public function _prefix( $value ) {} + + /** + * A utility method to unserialize data with whatever serializer is set up. If there is no serializer set, the + * value will be returned unchanged. If there is a serializer set up, and the data passed in is malformed, an + * exception will be thrown. This can be useful if phpredis is serializing values, and you return something from + * redis in a LUA script that is serialized. + * @param string $value The value to be unserialized + * @return mixed + * @example + *
+     * $redis->setOpt(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP);
+     * $redis->_unserialize('a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}'); // Will return Array(1,2,3)
+     * 
+ */ + public function _unserialize( $value ) {} + + /** + * Dump a key out of a redis database, the value of which can later be passed into redis using the RESTORE command. + * The data that comes out of DUMP is a binary representation of the key as Redis stores it. + * @param string $key + * @return string The Redis encoded value of the key, or FALSE if the key doesn't exist + * @link http://redis.io/commands/dump + * @example + *
+     * $redis->set('foo', 'bar');
+     * $val = $redis->dump('foo'); // $val will be the Redis encoded key value
+     * 
+ */ + public function dump( $key ) {} + + /** + * Restore a key from the result of a DUMP operation. + * + * @param string $key The key name + * @param int $ttl How long the key should live (if zero, no expire will be set on the key) + * @param string $value (binary). The Redis encoded key value (from DUMP) + * @return bool + * @link http://redis.io/commands/restore + * @example + *
+     * $redis->set('foo', 'bar');
+     * $val = $redis->dump('foo');
+     * $redis->restore('bar', 0, $val); // The key 'bar', will now be equal to the key 'foo'
+     * 
+ */ + public function restore( $key, $ttl, $value ) {} + + /** + * Migrates a key to a different Redis instance. + * + * @param string $host The destination host + * @param int $port The TCP port to connect to. + * @param string $key The key to migrate. + * @param int $db The target DB. + * @param int $timeout The maximum amount of time given to this transfer. + * @return bool + * @link http://redis.io/commands/migrate + * @example + *
+     * $redis->migrate('backup', 6379, 'foo', 0, 3600);
+     * 
+ */ + public function migrate( $host, $port, $key, $db, $timeout ) {} + + /** + * Return the current Redis server time. + * @return array If successfull, the time will come back as an associative array with element zero being the + * unix timestamp, and element one being microseconds. + * @link http://redis.io/commands/time + * @example + *
+     * var_dump( $redis->time() );
+     * // array(2) {
+     * //   [0] => string(10) "1342364352"
+     * //   [1] => string(6) "253002"
+     * // }
+     * 
+ */ + public function time() {} } class RedisException extends Exception {} From adac3ab82543589d83933daaa188f75345dabf2e Mon Sep 17 00:00:00 2001 From: Max Kamashev Date: Sun, 15 Jul 2012 19:24:20 +0400 Subject: [PATCH 04/97] Add composer package --- composer.json | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 composer.json diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..2461b8a --- /dev/null +++ b/composer.json @@ -0,0 +1,25 @@ +{ + "name": "ukko/phpredis-phpdoc", + "type": "library", + "description": "@phpdoc extension phpredis for IDE autocomplete", + "keywords": ["redis", "phpredis", "helper"], + "homepage": "https://github.com/ukko/phpredis-phpdoc", + "license": "MIT", + "authors":[ + { + "name": "Max Kamashev", + "email": "max.kamashev@gmail.com", + "homepage": "http://uk0.us/", + "role": "Developer" + } + ], + "require":{ + "php":">=5.3.0" + }, + "autoload":{ + "psr-0":{ + "phpredis-phpdoc":"src" + } + }, + "minimum-stability": "dev" +} From 7f0088761b297343675b7dc55a2f1ed50d51c84f Mon Sep 17 00:00:00 2001 From: Max Kamashev Date: Sun, 15 Jul 2012 19:53:08 +0400 Subject: [PATCH 05/97] update composer --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 2461b8a..094a640 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "ukko/phpredis-phpdoc", + "name": "ukko/phpredisphpdoc", "type": "library", "description": "@phpdoc extension phpredis for IDE autocomplete", "keywords": ["redis", "phpredis", "helper"], @@ -18,7 +18,7 @@ }, "autoload":{ "psr-0":{ - "phpredis-phpdoc":"src" + "phpredis-phpdoc":"." } }, "minimum-stability": "dev" From 9f399b4ff6aeebf4da255a1c3bf912be4b3d5f00 Mon Sep 17 00:00:00 2001 From: Max Kamashev Date: Sun, 15 Jul 2012 20:00:16 +0400 Subject: [PATCH 06/97] composer rule update --- composer.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/composer.json b/composer.json index 094a640..3c057f9 100644 --- a/composer.json +++ b/composer.json @@ -16,10 +16,5 @@ "require":{ "php":">=5.3.0" }, - "autoload":{ - "psr-0":{ - "phpredis-phpdoc":"." - } - }, "minimum-stability": "dev" } From 7978e264f0e151190ab6b50c571f1a690036e272 Mon Sep 17 00:00:00 2001 From: Max Kamashev Date: Mon, 16 Jul 2012 00:06:36 +0400 Subject: [PATCH 07/97] Create src dirrectory --- composer.json | 10 ++++++++-- redisphp.php => src/redisphp.php | 0 2 files changed, 8 insertions(+), 2 deletions(-) rename redisphp.php => src/redisphp.php (100%) diff --git a/composer.json b/composer.json index 3c057f9..0578377 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "ukko/phpredisphpdoc", + "name": "ukko/phpredis-phpdoc", "type": "library", "description": "@phpdoc extension phpredis for IDE autocomplete", "keywords": ["redis", "phpredis", "helper"], @@ -16,5 +16,11 @@ "require":{ "php":">=5.3.0" }, - "minimum-stability": "dev" + "version": "2.6.0-dev", + "minimum-stability": "dev", + "autoload": { + "psr-0": { + "phpredis-phpdoc": "src/" + } + } } diff --git a/redisphp.php b/src/redisphp.php similarity index 100% rename from redisphp.php rename to src/redisphp.php From c3ded16a5a4052f2690e7e99ec908a2c9426f206 Mon Sep 17 00:00:00 2001 From: Max Kamashev Date: Tue, 17 Jul 2012 14:47:41 +0400 Subject: [PATCH 08/97] Rename file for PSR-0 --- src/{redisphp.php => Redis.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/{redisphp.php => Redis.php} (100%) diff --git a/src/redisphp.php b/src/Redis.php similarity index 100% rename from src/redisphp.php rename to src/Redis.php From 1fb630442c1b7ef15b44620411440a0369623725 Mon Sep 17 00:00:00 2001 From: Max Kamashev Date: Tue, 17 Jul 2012 15:13:54 +0400 Subject: [PATCH 09/97] Add composer info --- README.markdown | 10 +++++++++- composer.json | 3 +-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/README.markdown b/README.markdown index 4c7ab27..ed4ee80 100644 --- a/README.markdown +++ b/README.markdown @@ -23,7 +23,15 @@ Do not forget to declare a variable type $ redis * Install redis-server * Install [phpredis extension](https://github.com/nicolasff/phpredis) - * Download [phpredis-phpdoc](https://github.com/ukko/phpredis-phpdoc/tarball/master) + * The simpliest way to install and use redisphp-phpdoc is to use Composer, as there is a package on Packagist. Just add this to your project composer.json file : + + { + "require": { + "ukko/redisphp-phpdoc": "*" + }, + } + + * Or download [phpredis-phpdoc](https://github.com/ukko/phpredis-phpdoc/tarball/master) ### Setup in IDE PhpStorm diff --git a/composer.json b/composer.json index 0578377..6a62e60 100644 --- a/composer.json +++ b/composer.json @@ -16,8 +16,7 @@ "require":{ "php":">=5.3.0" }, - "version": "2.6.0-dev", - "minimum-stability": "dev", + "version": "2.6.0", "autoload": { "psr-0": { "phpredis-phpdoc": "src/" From b94c445d459d06ba4dc9973cbe9b24115a39bcb1 Mon Sep 17 00:00:00 2001 From: Max Kamashev Date: Tue, 17 Jul 2012 15:17:08 +0400 Subject: [PATCH 10/97] Add minimum-stability in README --- README.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/README.markdown b/README.markdown index ed4ee80..4f0b769 100644 --- a/README.markdown +++ b/README.markdown @@ -29,6 +29,7 @@ Do not forget to declare a variable type $ redis "require": { "ukko/redisphp-phpdoc": "*" }, + "minimum-stability": "dev" } * Or download [phpredis-phpdoc](https://github.com/ukko/phpredis-phpdoc/tarball/master) From 7f2cf470090c23343d78d4d0d62ac586a17b3784 Mon Sep 17 00:00:00 2001 From: Max Kamashev Date: Tue, 17 Jul 2012 15:23:35 +0400 Subject: [PATCH 11/97] Update code in README --- README.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.markdown b/README.markdown index 4f0b769..ba15b87 100644 --- a/README.markdown +++ b/README.markdown @@ -21,7 +21,7 @@ Do not forget to declare a variable type $ redis ### Install - * Install redis-server + * Install [redis-server](http://redis.io/download) * Install [phpredis extension](https://github.com/nicolasff/phpredis) * The simpliest way to install and use redisphp-phpdoc is to use Composer, as there is a package on Packagist. Just add this to your project composer.json file : @@ -32,7 +32,7 @@ Do not forget to declare a variable type $ redis "minimum-stability": "dev" } - * Or download [phpredis-phpdoc](https://github.com/ukko/phpredis-phpdoc/tarball/master) + * Or direct download [phpredis-phpdoc](https://github.com/ukko/phpredis-phpdoc/tarball/master) ### Setup in IDE PhpStorm From a41e5c9d7291ec90d0d66b3d103cfdfc0d63e402 Mon Sep 17 00:00:00 2001 From: cmyker Date: Tue, 2 Oct 2012 19:04:19 +0300 Subject: [PATCH 12/97] Update README.markdown --- README.markdown | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index ba15b87..b2c4950 100644 --- a/README.markdown +++ b/README.markdown @@ -47,5 +47,10 @@ Do not forget to declare a variable type $ redis * Click "Open" * Click "OK" -### Setup in IDE Eclipse PDT +### Setup in Zend Studio IDE (Eclipse PDT) + + * Open "Window" -> "Preferences" + * In preferences dialog open "PHP" -> "PHP Libriaries" + * Click "New" button, in "User library name" enter "Redis", click "OK" + * Select newly created "Redis", library Click "Add external folder", select path to the folder which contains your checkout of phpredis-phpdoc or you can download single "Redis.php" file https://raw.github.com/ukko/phpredis-phpdoc/master/src/Redis.php From 2ddf5d8eb8e90e7e2d4378e0b5acaaa5879c871f Mon Sep 17 00:00:00 2001 From: cmyker Date: Tue, 2 Oct 2012 19:24:01 +0300 Subject: [PATCH 13/97] Update README.markdown --- README.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/README.markdown b/README.markdown index b2c4950..3db127c 100644 --- a/README.markdown +++ b/README.markdown @@ -53,4 +53,5 @@ Do not forget to declare a variable type $ redis * In preferences dialog open "PHP" -> "PHP Libriaries" * Click "New" button, in "User library name" enter "Redis", click "OK" * Select newly created "Redis", library Click "Add external folder", select path to the folder which contains your checkout of phpredis-phpdoc or you can download single "Redis.php" file https://raw.github.com/ukko/phpredis-phpdoc/master/src/Redis.php + * Include your custom library in your project: open "Project" -> "Properties" -> "PHP Include Path", click add library, select "User library", click "Next", check "Redis", click "Finish" From 042e08372bb8cdfdf1434c281ea2067f1f726aad Mon Sep 17 00:00:00 2001 From: Max Kamashev Date: Fri, 26 Oct 2012 02:00:31 +0400 Subject: [PATCH 14/97] Add new commands: psubscribe(), clearLastError(), small fix documentation --- src/redisphp.php | 52 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 44 insertions(+), 8 deletions(-) diff --git a/src/redisphp.php b/src/redisphp.php index 5c20833..f68d2af 100644 --- a/src/redisphp.php +++ b/src/redisphp.php @@ -344,6 +344,24 @@ public function unwatch( ) {} */ public function subscribe( $channels, $callback ) {} + /** + * Subscribe to channels by pattern + * + * @param array $patterns The number of elements removed from the set. + * @param string|array $callback Either a string or an array with an object and method. + * The callback will get four arguments ($redis, $pattern, $channel, $message) + * @link http://redis.io/commands/psubscribe + * @example + *
+     * function psubscribe($redis, $pattern, $chan, $msg) {
+     *  echo "Pattern: $pattern\n";
+     *  echo "Channel: $chan\n";
+     *  echo "Payload: $msg\n";
+     * }
+     * 
+ */ + public function psubscribe( $patterns, $callback ) {} + /** * Publish messages to channels. Warning: this function will probably change in the future. * @@ -885,13 +903,14 @@ public function lInsert( $key, $position, $pivot, $value ) {} /** - * Adds a values to the set value stored at key. If this value is already in the set, FALSE is returned. + * Adds a values to the set value stored at key. + * If this value is already in the set, FALSE is returned. * * @param string $key Required key * @param string $value1 Required value * @param string $value2 Optional value * @param string $valueN Optional value - * @return int Number of value added + * @return int The number of elements added to the set * @link http://redis.io/commands/sadd * @example *
@@ -909,7 +928,7 @@ public function sAdd( $key, $value1, $value2 = null, $valueN = null ) {}
      * @param   string  $member1
      * @param   string  $member2
      * @param   string  $memberN
-     * @return  int     Number of deleted values
+     * @return  int     The number of elements removed from the set.
      * @link    http://redis.io/commands/srem
      * @example
      * 
@@ -2376,8 +2395,8 @@ public function zIncrBy( $key, $value, $member ) {}
      * $redis->zUnion('ko1', array('k1', 'k2')); // 4, 'ko1' => array('val0', 'val1', 'val2', 'val3')
      *
      * // Weighted zUnion
-     * $redis->zUnion('ko2', array('k1', 'k2'), array(1, 1)); // 4, 'ko1' => array('val0', 'val1', 'val2', 'val3')
-     * $redis->zUnion('ko3', array('k1', 'k2'), array(5, 1)); // 4, 'ko1' => array('val0', 'val2', 'val3', 'val1')
+     * $redis->zUnion('ko2', array('k1', 'k2'), array(1, 1)); // 4, 'ko2' => array('val0', 'val1', 'val2', 'val3')
+     * $redis->zUnion('ko3', array('k1', 'k2'), array(5, 1)); // 4, 'ko3' => array('val0', 'val2', 'val3', 'val1')
      * 
*/ public function zUnion($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM') {} @@ -2774,7 +2793,7 @@ public function evalSha( $scriptSha, $args = array(), $numKeys = 0 ) {} public function script( $command, $script ) {} /** - * The last error message (if any) returned from a SCRIPT call + * The last error message (if any) * @return string A string with the last returned script based error message, or NULL if there is no error * @example *
@@ -2785,13 +2804,30 @@ public function script( $command, $script ) {}
      */
     public function getLastError() {}
 
+    /**
+     * Clear the last error message
+     *
+     * @return bool true
+     * @example
+     * 
+     * $redis->set('x', 'a');
+     * $redis->incr('x');
+     * $err = $redis->getLastError();
+     * // "ERR value is not an integer or out of range"
+     * $redis->clearLastError();
+     * $err = $redis->getLastError();
+     * // NULL
+     * 
+ */ + public function clearLastError() {} + /** * A utility method to prefix the value with the prefix setting for phpredis. * @param $value The value you wish to prefix * @return string If a prefix is set up, the value now prefixed. If there is no prefix, the value will be returned unchanged. * @example *
-     * $redis->setOpt(Redis::OPT_PREFIX, 'my-prefix:');
+     * $redis->setOption(Redis::OPT_PREFIX, 'my-prefix:');
      * $redis->_prefix('my-value'); // Will return 'my-prefix:my-value'
      * 
*/ @@ -2806,7 +2842,7 @@ public function _prefix( $value ) {} * @return mixed * @example *
-     * $redis->setOpt(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP);
+     * $redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP);
      * $redis->_unserialize('a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}'); // Will return Array(1,2,3)
      * 
*/ From 23c3288992f52b6477934f363c73ebbf05c0ebcf Mon Sep 17 00:00:00 2001 From: Colin O'Dell Date: Fri, 4 Jan 2013 18:29:43 -0500 Subject: [PATCH 15/97] Fixed incorrect Packagist project name --- README.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.markdown b/README.markdown index 3db127c..5e788fa 100644 --- a/README.markdown +++ b/README.markdown @@ -23,11 +23,11 @@ Do not forget to declare a variable type $ redis * Install [redis-server](http://redis.io/download) * Install [phpredis extension](https://github.com/nicolasff/phpredis) - * The simpliest way to install and use redisphp-phpdoc is to use Composer, as there is a package on Packagist. Just add this to your project composer.json file : + * The simpliest way to install and use phpredis-phpdoc is to use Composer, as there is a [package on Packagist](https://packagist.org/packages/ukko/phpredis-phpdoc). Just add this to your project composer.json file : { "require": { - "ukko/redisphp-phpdoc": "*" + "ukko/phpredis-phpdoc": "*" }, "minimum-stability": "dev" } From d0fc23b33de6d944ca8ba8919c9e5cd7b19c9847 Mon Sep 17 00:00:00 2001 From: Colin O'Dell Date: Mon, 11 Feb 2013 11:21:00 -0500 Subject: [PATCH 16/97] Added return value to zRevRank Also included the link to the Redis documentation. --- src/Redis.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Redis.php b/src/Redis.php index f68d2af..72b466f 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -2339,8 +2339,10 @@ public function zRank( $key, $member ) {} /** * @see zRank() - * @param string $key - * @param string $member + * @param string $key + * @param string $member + * @return int the item's score + * @link http://redis.io/commands/zrevrank */ public function zRevRank( $key, $member ) {} From 605ea3107f99ccc23bf4ac86f50cf5199d8e5b05 Mon Sep 17 00:00:00 2001 From: Eugene Leonovich Date: Fri, 22 Mar 2013 22:46:19 +0100 Subject: [PATCH 17/97] Add evaluate and evaluateSha aliases See https://github.com/nicolasff/phpredis/issues/316, https://github.com/nicolasff/phpredis/commit/c39ecd52f30a573d476e44baeccebd6ba429cafb --- src/Redis.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Redis.php b/src/Redis.php index 72b466f..cfc07b5 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -2751,6 +2751,14 @@ public function hMGet( $key, $hashKeys ) {} */ public function config( $operation, $key, $value ) {} + /** + * @see eval() + * @param string $script + * @param array $args + * @param int $numKeys + */ + public function evaluate( $script, $args = array(), $numKeys = 0 ) {} + /** * Evaluate a LUA script serverside, from the SHA1 hash of the script instead of the script itself. * In order to run this command Redis will have to have already loaded the script, either by running it or via @@ -2770,6 +2778,14 @@ public function config( $operation, $key, $value ) {} */ public function evalSha( $scriptSha, $args = array(), $numKeys = 0 ) {} + /** + * @see evalSha() + * @param string $scriptSha + * @param array $args + * @param int $numKeys + */ + public function evaluateSha( $scriptSha, $args = array(), $numKeys = 0 ) {} + /** * Execute the Redis SCRIPT command to perform various operations on the scripting subsystem. * @param string $command load | flush | kill | exists From ea29c7348c652ca5d0b7a3b3bfa9f917141396de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20Blu=CC=88m?= Date: Fri, 10 May 2013 09:03:58 +0200 Subject: [PATCH 18/97] Added a few @return annotations --- src/Redis.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Redis.php b/src/Redis.php index cfc07b5..ba63069 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -368,6 +368,7 @@ public function psubscribe( $patterns, $callback ) {} * @param string $channel a channel to publish to * @param string $message string * @link http://redis.io/commands/publish + * @return int Number of clients that received the message * @example $redis->publish('chan-1', 'hello, world!'); // send message. */ public function publish( $channel, $message ) {} @@ -1882,6 +1883,7 @@ public function sort( $key, $option = null ) {} * - vm_enabled * - role * @link http://redis.io/commands/info + * @return string * @example *
      * $redis->info();
@@ -1994,6 +1996,7 @@ public function mget( array $array ) {}
     /**
      * @see mset()
      * @param   array $array
+     * @return  int 1 (if the keys were set) or 0 (no key was set)
      * @link    http://redis.io/commands/msetnx
      */
     public function msetnx( array $array ) {}
@@ -2134,6 +2137,7 @@ public function zRem( $key, $member1, $member2 = null, $memberN = null ) {}
      * @param   string  $member1
      * @param   string  $member2
      * @param   string  $memberN
+     * @return  int     Number of deleted values
      * @link    http://redis.io/commands/zrem
      */
     public function zDelete( $key, $member1, $member2 = null, $memberN = null ) {}

From 9c3f2def6d14b9a45dd23d191db27889f5642faf Mon Sep 17 00:00:00 2001
From: Max Kamashev 
Date: Tue, 21 May 2013 10:22:24 +0400
Subject: [PATCH 19/97] Update composer.json

Edit version number
---
 composer.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/composer.json b/composer.json
index 6a62e60..54b7573 100644
--- a/composer.json
+++ b/composer.json
@@ -16,7 +16,7 @@
     "require":{
         "php":">=5.3.0"
     },
-    "version": "2.6.0",
+    "version": "2.2.2",
     "autoload": {
         "psr-0": {
             "phpredis-phpdoc": "src/"

From 30daf5ffb3cd2cfe76aa5fef2a62e6993e9440d1 Mon Sep 17 00:00:00 2001
From: Max Kamashev 
Date: Tue, 21 May 2013 10:28:10 +0400
Subject: [PATCH 20/97] Update composer.json

---
 composer.json | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/composer.json b/composer.json
index 54b7573..c2faee3 100644
--- a/composer.json
+++ b/composer.json
@@ -21,5 +21,10 @@
         "psr-0": {
             "phpredis-phpdoc": "src/"
         }
+    },
+    "extra": {
+        "branch-alias": {
+            "dev-master": "2.2.x-dev"
+        }
     }
 }

From 0027bed91434f13f6221cc8a17dec34af96c1720 Mon Sep 17 00:00:00 2001
From: "Il'ya V. Yesin" 
Date: Thu, 21 Nov 2013 15:06:48 +0300
Subject: [PATCH 21/97] Fix wrong Redis::set prototype

TTL for set is integer (actually LONG C-type) type.
See
https://github.com/nicolasff/phpredis/blob/master/redis.c#L814
https://github.com/nicolasff/phpredis/blob/master/redis.c#L839
---
 src/Redis.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/Redis.php b/src/Redis.php
index ba63069..ffce021 100644
--- a/src/Redis.php
+++ b/src/Redis.php
@@ -187,12 +187,12 @@ public function get( $key ) {}
      *
      * @param   string  $key
      * @param   string  $value
-     * @param   float   $timeout    Calling setex() is preferred if you want a timeout.
-     * @return  bool:   TRUE if the command is successful.
+     * @param   int     $ttl    Calling setex() is preferred if you want a Time To Live.
+     * @return  bool:   If the command is successful return TRUE or 'Redis Socket Buffer' object
      * @link    http://redis.io/commands/set
      * @example $redis->set('key', 'value');
      */
-    public function set( $key, $value, $timeout = 0.0 ) {}
+    public function set( $key, $value, $ttl = 0 ) {}
 
     /**
      * Set the string value in argument as value of the key, with a time to live.

From 7e0daf04775018ad57b9b1e636d0a5b009cea0b3 Mon Sep 17 00:00:00 2001
From: Eugene Leonovich 
Date: Tue, 28 Jan 2014 23:35:57 +0100
Subject: [PATCH 22/97] Add missed @return to eval doc

---
 src/Redis.php | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/Redis.php b/src/Redis.php
index ffce021..424b3c2 100644
--- a/src/Redis.php
+++ b/src/Redis.php
@@ -11,7 +11,7 @@
  *  @param  string  $script
  *  @param  array   $args
  *  @param  int     $numKeys
- *  @return Mixed.  What is returned depends on what the LUA script itself returns, which could be a scalar value
+ *  @return mixed   What is returned depends on what the LUA script itself returns, which could be a scalar value
  *  (int/string), or an array. Arrays that are returned can also contain other arrays, if that's how it was set up in
  *  your LUA script.  If there is an error executing the LUA script, the getLastError() function can tell you the
  *  message that came back from Redis (e.g. compile error).
@@ -2757,9 +2757,10 @@ public function config( $operation, $key, $value ) {}
 
     /**
      * @see eval()
-     * @param string $script
-     * @param array  $args
-     * @param int    $numKeys
+     * @param   string  $script
+     * @param   array   $args
+     * @param   int     $numKeys
+     * @return  mixed   @see eval()
      */
     public function evaluate( $script, $args = array(), $numKeys = 0 ) {}
 
@@ -2770,7 +2771,7 @@ public function evaluate( $script, $args = array(), $numKeys = 0 ) {}
      * @param   string  $scriptSha
      * @param   array   $args
      * @param   int     $numKeys
-     * @return  mixed. @see eval()
+     * @return  mixed   @see eval()
      * @see     eval()
      * @link    http://redis.io/commands/evalsha
      * @example

From 024686d1d81ecf99489881218dfc31d340538916 Mon Sep 17 00:00:00 2001
From: Alexander Chernov 
Date: Sun, 9 Feb 2014 13:24:04 +0100
Subject: [PATCH 23/97] Update Redis.php

Small fix for phpdoc (missing type for _prefix)
---
 src/Redis.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Redis.php b/src/Redis.php
index 424b3c2..570fd04 100644
--- a/src/Redis.php
+++ b/src/Redis.php
@@ -2846,7 +2846,7 @@ public function clearLastError() {}
 
     /**
      * A utility method to prefix the value with the prefix setting for phpredis.
-     * @param   $value  The value you wish to prefix
+     * @param   mixed   $value  The value you wish to prefix
      * @return  string  If a prefix is set up, the value now prefixed.  If there is no prefix, the value will be returned unchanged.
      * @example
      * 

From 3e5f7c62999cc5734a748d8d2f8153d798fd8da6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= 
Date: Wed, 2 Jul 2014 13:05:01 +0300
Subject: [PATCH 24/97] set params for delete()

---
 src/Redis.php | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/Redis.php b/src/Redis.php
index 570fd04..8c40a70 100644
--- a/src/Redis.php
+++ b/src/Redis.php
@@ -243,9 +243,10 @@ public function del( $key1, $key2 = null, $key3 = null ) {}
 
     /**
      * @see del()
-     * @param $key1
-     * @param null $key2
-     * @param null $key3
+     * @param   int|array   $key1
+     * @param   string      $key2
+     * @param   string      $key3
+     * @return int Number of keys deleted.
      */
     public function delete( $key1, $key2 = null, $key3 = null ) {}
 

From 4f64bd7457d0257bc96d393fbc3d5f8651046355 Mon Sep 17 00:00:00 2001
From: Oleg Popadko 
Date: Thu, 19 Feb 2015 15:52:07 +0200
Subject: [PATCH 25/97] Add second argument $count to sRandMember

---
 src/Redis.php | 30 ++++++++++++++++++++----------
 1 file changed, 20 insertions(+), 10 deletions(-)

diff --git a/src/Redis.php b/src/Redis.php
index 8c40a70..afde25f 100644
--- a/src/Redis.php
+++ b/src/Redis.php
@@ -1044,22 +1044,32 @@ public function sPop( $key ) {}
 
 
     /**
-     * Returns a random element from the set value at Key, without removing it.
+     * Returns a random element(s) from the set value at Key, without removing it.
      *
-     * @param   string  $key
-     * @return  string  value from the set
-     * bool FALSE if set identified by key is empty or doesn't exist.
+     * @param   string        $key
+     * @param   int           $count [optional]
+     * @return  string|array  value(s) from the set
+     * bool FALSE if set identified by key is empty or doesn't exist and count argument isn't passed.
      * @link    http://redis.io/commands/srandmember
      * @example
      * 
-     * $redis->sAdd('key1' , 'set1');
-     * $redis->sAdd('key1' , 'set2');
-     * $redis->sAdd('key1' , 'set3');   // 'key1' => {'set3', 'set1', 'set2'}
-     * $redis->sRandMember('key1');     // 'set1', 'key1' => {'set3', 'set1', 'set2'}
-     * $redis->sRandMember('key1');     // 'set3', 'key1' => {'set3', 'set1', 'set2'}
+     * $redis->sAdd('key1' , 'one');
+     * $redis->sAdd('key1' , 'two');
+     * $redis->sAdd('key1' , 'three');              // 'key1' => {'one', 'two', 'three'}
+     *
+     * var_dump( $redis->sRandMember('key1') );     // 'key1' => {'one', 'two', 'three'}
+     *
+     * // string(5) "three"
+     *
+     * var_dump( $redis->sRandMember('key1', 2) );  // 'key1' => {'one', 'two', 'three'}
+     *
+     * // array(2) {
+     * //   [0]=> string(2) "one"
+     * //   [1]=> string(2) "three"
+     * // }
      * 
*/ - public function sRandMember( $key ) {} + public function sRandMember( $key, $count = null ) {} /** * Returns the members of a set resulting from the intersection of all the sets From 21ab1900df134cb80f7ce5faeea00d0dc1b1b956 Mon Sep 17 00:00:00 2001 From: Patrick Pokatilo Date: Thu, 9 Jul 2015 16:28:37 +0200 Subject: [PATCH 26/97] Add options READ_TIMEOUT, SCAN and SLAVE_FAILOVER --- src/Redis.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Redis.php b/src/Redis.php index afde25f..f514513 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -39,6 +39,22 @@ class Redis */ const OPT_SERIALIZER = 1; const OPT_PREFIX = 2; + const OPT_READ_TIMEOUT = 3; + const OPT_SCAN = 4; + const OPT_SLAVE_FAILOVER = 5; + + /** + * Cluster options + */ + const FAILOVER_NONE = 0; + const FAILOVER_ERROR = 1; + const FAILOVER_DISTRIBUTE = 2; + + /** + * SCAN options + */ + const SCAN_NORETRY = 0; + const SCAN_RETRY = 1; /** * Serializers From 7ad2f27ea9339478ec29d984a60215017c5dc746 Mon Sep 17 00:00:00 2001 From: Patrick Pokatilo Date: Thu, 9 Jul 2015 16:28:49 +0200 Subject: [PATCH 27/97] Add SCAN command --- src/Redis.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/Redis.php b/src/Redis.php index f514513..ba1307a 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -2961,6 +2961,25 @@ public function migrate( $host, $port, $key, $db, $timeout ) {} *
*/ public function time() {} + + /** + * Scan the keyspace for keys. + * @param int $iterator Iterator, initialized to NULL. + * @param string $pattern Pattern to match. + * @param int $count Count of keys per iteration (only a suggestion to Redis). + * @return array This function will return an array of keys or FALSE if there are no more keys. + * @link http://redis.io/commands/scan + * @example + *
+     * $iterator = null;
+     * while($keys = $redis->scan($iterator)) {
+     *     foreach($keys as $key) {
+     *         echo $key . PHP_EOL;
+     *     }
+     * }
+     * 
+ */ + public function scan( &$iterator, $pattern = null, $count = 0 ) {} } class RedisException extends Exception {} From dd63e7cf353d685608e3efe7cad62729267401cd Mon Sep 17 00:00:00 2001 From: Patrick Pokatilo Date: Thu, 9 Jul 2015 16:29:06 +0200 Subject: [PATCH 28/97] Update MIGRATE command --- src/Redis.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Redis.php b/src/Redis.php index ba1307a..ff6139b 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -2937,6 +2937,8 @@ public function restore( $key, $ttl, $value ) {} * @param string $key The key to migrate. * @param int $db The target DB. * @param int $timeout The maximum amount of time given to this transfer. + * @param bool $copy Should we send the COPY flag to redis. + * @param bool $replace Should we send the REPLACE flag to redis. * @return bool * @link http://redis.io/commands/migrate * @example @@ -2944,7 +2946,7 @@ public function restore( $key, $ttl, $value ) {} * $redis->migrate('backup', 6379, 'foo', 0, 3600); *
*/ - public function migrate( $host, $port, $key, $db, $timeout ) {} + public function migrate( $host, $port, $key, $db, $timeout, $copy = false, $replace = false ) {} /** * Return the current Redis server time. From 0620d83e0bf88d33b53ad38d0d9665406879e6c0 Mon Sep 17 00:00:00 2001 From: Patrick Pokatilo Date: Thu, 9 Jul 2015 16:35:56 +0200 Subject: [PATCH 29/97] Add HSCAN command --- src/Redis.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/Redis.php b/src/Redis.php index ff6139b..73d0ac8 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -2765,6 +2765,27 @@ public function hMset( $key, $hashKeys ) {} */ public function hMGet( $key, $hashKeys ) {} + /** + * Scan a HASH value for members, with an optional pattern and count. + * @param string $key + * @param int $iterator + * @param string $pattern Optional pattern to match against. + * @param int $count How many keys to return in a go (only a sugestion to Redis). + * @return array An array of members that match our pattern. + * @link http://redis.io/commands/hscan + * @example + *
+     * // $iterator = null;
+     * // while($elements = $redis->hscan('hash', $iterator)) {
+     * //     foreach($elements as $key => $value) {
+     * //         echo $key . ' => ' . $value . PHP_EOL;
+     * //     }
+     * // }
+     * 
+ */ + public function hScan( $key, &$iterator, $pattern = null, $count = 0 ) {} + + /** * Get or Set the redis config keys. * From 7ba0efd24d2c082e938d458fedf332f52a349ed2 Mon Sep 17 00:00:00 2001 From: Patrick Pokatilo Date: Thu, 9 Jul 2015 16:45:16 +0200 Subject: [PATCH 30/97] Add SSCAN command --- src/Redis.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/Redis.php b/src/Redis.php index 73d0ac8..0f19a28 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -1335,6 +1335,26 @@ public function sMembers( $key ) {} */ public function sGetMembers( $key ) {} + /** + * Scan a set for members. + * @param string $key The set to search. + * @param int $iterator LONG (reference) to the iterator as we go. + * @param null $pattern String, optional pattern to match against. + * @param int $count How many members to return at a time (Redis might return a different amount). + * @return array PHPRedis will return an array of keys or FALSE when we're done iterating. + * @link http://redis.io/commands/sscan + * @example + *
+     * $iterator = null;
+     * while ($members = $redis->sscan('set', $iterator)) {
+     *     foreach ($members as $member) {
+     *         echo $member . PHP_EOL;
+     *     }
+     * }
+     * 
+ */ + public function sScan( $key, &$iterator, $pattern = null, $count = 0 ) {} + /** * Sets a value and returns the previous entry at that key. * From 892ce2646e12cb8942f247a3613201f85c8bbe7d Mon Sep 17 00:00:00 2001 From: Patrick Pokatilo Date: Thu, 9 Jul 2015 17:25:27 +0200 Subject: [PATCH 31/97] Add ZRANGEBYLEX command --- src/Redis.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/Redis.php b/src/Redis.php index 0f19a28..999c59e 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -2256,6 +2256,31 @@ public function zRangeByScore( $key, $start, $end, array $options = array() ) {} */ public function zRevRangeByScore( $key, $start, $end, array $options = array() ) {} + /** + * Returns a lexigraphical range of members in a sorted set, assuming the members have the same score. The + * min and max values are required to start with '(' (exclusive), '[' (inclusive), or be exactly the values + * '-' (negative inf) or '+' (positive inf). The command must be called with either three *or* five + * arguments or will return FALSE. + * @param string $key The ZSET you wish to run against. + * @param int $min The minimum alphanumeric value you wish to get. + * @param int $max The maximum alphanumeric value you wish to get. + * @param int $offset Optional argument if you wish to start somewhere other than the first element. + * @param int $limit Optional argument if you wish to limit the number of elements returned. + * @return array Array containing the values in the specified range. + * @link http://redis.io/commands/zrangebylex + * @example + *
+     * foreach (array('a', 'b', 'c', 'd', 'e', 'f', 'g') as $char) {
+     *     $redis->zAdd('key', $char);
+     * }
+     *
+     * $redis->zRangeByLex('key', '-', '[c'); // array('a', 'b', 'c')
+     * $redis->zRangeByLex('key', '-', '(c'); // array('a', 'b')
+     * $redis->zRangeByLex('key', '-', '[c'); // array('b', 'c')
+     * 
+ */ + public function zRangeByLex( $key, $min, $max, $offset = null, $limit = null ) {} + /** * Returns the number of elements of the sorted set stored at the specified key which have * scores in the range [start,end]. Adding a parenthesis before start or end excludes it From 1d089d0e5c05f51a4acea1022a6232237d0d2bdf Mon Sep 17 00:00:00 2001 From: Patrick Pokatilo Date: Thu, 9 Jul 2015 17:28:26 +0200 Subject: [PATCH 32/97] Add ZREVRANGEBYLEX command --- src/Redis.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Redis.php b/src/Redis.php index 999c59e..c1a6f87 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -2281,6 +2281,18 @@ public function zRevRangeByScore( $key, $start, $end, array $options = array() ) */ public function zRangeByLex( $key, $min, $max, $offset = null, $limit = null ) {} + /** + * @see zRangeByLex() + * @param string $key + * @param int $min + * @param int $max + * @param int $offset + * @param int $limit + * @return array + * @link http://redis.io/commands/zrevrangebylex + */ + public function zRevRangeByLex( $key, $min, $max, $offset = null, $limit = null ) {} + /** * Returns the number of elements of the sorted set stored at the specified key which have * scores in the range [start,end]. Adding a parenthesis before start or end excludes it From b9636c086ce378cbe68c91d61434ee1d10145e60 Mon Sep 17 00:00:00 2001 From: Patrick Pokatilo Date: Thu, 9 Jul 2015 17:33:26 +0200 Subject: [PATCH 33/97] Add ZSCAN command --- src/Redis.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/Redis.php b/src/Redis.php index c1a6f87..c6d262a 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -2534,6 +2534,26 @@ public function zUnion($Output, $ZSetKeys, array $Weights = null, $aggregateFunc */ public function zInter($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM') {} + /** + * Scan a sorted set for members, with optional pattern and count. + * @param string $key String, the set to scan. + * @param int $iterator Long (reference), initialized to NULL. + * @param string $pattern String (optional), the pattern to match. + * @param int $count How many keys to return per iteration (Redis might return a different number). + * @return array PHPRedis will return matching keys from Redis, or FALSE when iteration is complete. + * @link http://redis.io/commands/zscan + * @example + *
+     * $iterator = null;
+     * while ($members = $redis-zscan('zset', $iterator)) {
+     *     foreach ($members as $member => $score) {
+     *         echo $member . ' => ' . $score . PHP_EOL;
+     *     }
+     * }
+     * 
+ */ + public function zScan( $key, &$iterator, $pattern = null, $count = 0 ) {} + /** * Adds a value to the hash stored at key. If this value is already in the hash, FALSE is returned. * From 257711ca5b067e379e7fd17c98ba61dfe2d5e273 Mon Sep 17 00:00:00 2001 From: Patrick Pokatilo Date: Thu, 9 Jul 2015 17:35:47 +0200 Subject: [PATCH 34/97] Update SUBSCRIBE and PSUBSCRIBE commands --- src/Redis.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Redis.php b/src/Redis.php index c6d262a..73512d3 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -337,6 +337,7 @@ public function unwatch( ) {} * @param array $channels an array of channels to subscribe to * @param string | array $callback either a string or an array($instance, 'method_name'). * The callback function receives 3 parameters: the redis instance, the channel name, and the message. + * @return mixed Any non-null return value in the callback will be returned to the caller. * @link http://redis.io/commands/subscribe * @example *
@@ -367,6 +368,7 @@ public function subscribe( $channels, $callback ) {}
      * @param   array           $patterns   The number of elements removed from the set.
      * @param   string|array    $callback   Either a string or an array with an object and method.
      *                          The callback will get four arguments ($redis, $pattern, $channel, $message)
+     * @param   mixed           Any non-null return value in the callback will be returned to the caller.
      * @link    http://redis.io/commands/psubscribe
      * @example
      * 

From d7a99fc075a04fdd15362a35a824593579ddb7b8 Mon Sep 17 00:00:00 2001
From: Patrick Pokatilo 
Date: Thu, 9 Jul 2015 17:43:39 +0200
Subject: [PATCH 35/97] Add PUBSUB command

---
 src/Redis.php | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/src/Redis.php b/src/Redis.php
index 73512d3..7a37367 100644
--- a/src/Redis.php
+++ b/src/Redis.php
@@ -392,6 +392,28 @@ public function psubscribe( $patterns, $callback ) {}
      */
     public function publish( $channel, $message ) {}
 
+    /**
+     * A command allowing you to get information on the Redis pub/sub system.
+     * @param   string          $keyword    String, which can be: "channels", "numsub", or "numpat"
+     * @param   string|array    $argument   Optional, variant.
+     *                                      For the "channels" subcommand, you can pass a string pattern.
+     *                                      For "numsub" an array of channel names
+     * @return  array|int                   Either an integer or an array.
+     *                          - channels  Returns an array where the members are the matching channels.
+     *                          - numsub    Returns a key/value array where the keys are channel names and
+     *                                      values are their counts.
+     *                          - numpat    Integer return containing the number active pattern subscriptions.
+     * @link    http://redis.io/commands/pubsub
+     * @example
+     * 
+     * $redis->pubsub('channels'); // All channels
+     * $redis->pubsub('channels', '*pattern*'); // Just channels matching your pattern
+     * $redis->pubsub('numsub', array('chan1', 'chan2')); // Get subscriber counts for 'chan1' and 'chan2'
+     * $redis->pubsub('numpat'); // Get the number of pattern subscribers
+     * 
+ */ + public function pubsub( $keyword, $argument ) {} + /** * Verify if the specified key exists. * From 08c5ab7dc8d82bb2f49b79ba185d63bd670b71f5 Mon Sep 17 00:00:00 2001 From: Patrick Pokatilo Date: Thu, 9 Jul 2015 17:47:21 +0200 Subject: [PATCH 36/97] Add utility method _serialize() --- src/Redis.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/Redis.php b/src/Redis.php index 7a37367..18e443e 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -3020,6 +3020,26 @@ public function _prefix( $value ) {} */ public function _unserialize( $value ) {} + /** + * A utility method to serialize values manually. This method allows you to serialize a value with whatever + * serializer is configured, manually. This can be useful for serialization/unserialization of data going in + * and out of EVAL commands as phpredis can't automatically do this itself. Note that if no serializer is + * set, phpredis will change Array values to 'Array', and Objects to 'Object'. + * @param mixed $value The value to be serialized. + * @return mixed + * @example + *
+     * $redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_NONE);
+     * $redis->_serialize("foo"); // returns "foo"
+     * $redis->_serialize(Array()); // Returns "Array"
+     * $redis->_serialize(new stdClass()); // Returns "Object"
+     *
+     * $redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP);
+     * $redis->_serialize("foo"); // Returns 's:3:"foo";'
+     * 
+ */ + public function _serialize( $value ) {} + /** * Dump a key out of a redis database, the value of which can later be passed into redis using the RESTORE command. * The data that comes out of DUMP is a binary representation of the key as Redis stores it. From ff87523e61f172e0374ccf8cfe7fd5a865c64d25 Mon Sep 17 00:00:00 2001 From: Patrick Pokatilo Date: Thu, 9 Jul 2015 17:56:34 +0200 Subject: [PATCH 37/97] Add WAIT command --- src/Redis.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Redis.php b/src/Redis.php index 18e443e..a81b41d 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -1687,6 +1687,17 @@ public function bgsave( ) {} */ public function lastSave( ) {} + /** + * Blocks the current client until all the previous write commands are successfully transferred and + * acknowledged by at least the specified number of slaves. + * @param int $numSlaves Number of slaves that need to acknowledge previous write commands. + * @param int $timeout Timeout in milliseconds. + * @return int The command returns the number of slaves reached by all the writes performed in the + * context of the current connection. + * @link http://redis.io/commands/wait + * @example $redis->wait(2, 1000); + */ + public function wait( $numSlaves, $timeout ) {} /** * Returns the type of data pointed by a given key. From 233563241659a8d6f0cedbe6b084c117b6117fef Mon Sep 17 00:00:00 2001 From: Patrick Pokatilo Date: Thu, 9 Jul 2015 18:15:33 +0200 Subject: [PATCH 38/97] Add PFADD command --- src/Redis.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Redis.php b/src/Redis.php index a81b41d..3eae479 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -3135,6 +3135,16 @@ public function time() {} *
*/ public function scan( &$iterator, $pattern = null, $count = 0 ) {} + + /** + * Adds all the element arguments to the HyperLogLog data structure stored at the key. + * @param string $key + * @param array $elements + * @return bool + * @link http://redis.io/commands/pfadd + * @example $redis->pfAdd('key', array('elem1', 'elem2')) + */ + public function pfAdd( $key, array $elements ) {} } class RedisException extends Exception {} From c85336562c2a878e3c59f0182608ab45523abfc7 Mon Sep 17 00:00:00 2001 From: Patrick Pokatilo Date: Thu, 9 Jul 2015 18:15:50 +0200 Subject: [PATCH 39/97] Add PFCOUNT command --- src/Redis.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Redis.php b/src/Redis.php index 3eae479..87e1750 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -3145,6 +3145,21 @@ public function scan( &$iterator, $pattern = null, $count = 0 ) {} * @example $redis->pfAdd('key', array('elem1', 'elem2')) */ public function pfAdd( $key, array $elements ) {} + + /** + * When called with a single key, returns the approximated cardinality computed by the HyperLogLog data + * structure stored at the specified variable, which is 0 if the variable does not exist. + * @param string|array $key + * @return int + * @link http://redis.io/commands/pfcount + * @example + *
+     * $redis->pfAdd('key1', array('elem1', 'elem2'));
+     * $redis->pfAdd('key2', array('elem3', 'elem2'));
+     * $redis->pfCount('key1'); // int(2)
+     * $redis->pfCount(array('key1', 'key2')); // int(3)
+     */
+    public function pfCount( $key ) {}
 }
 
 class RedisException extends Exception {}

From ff55c8b0efb2ea48b8410dba63ca14af88d5bd22 Mon Sep 17 00:00:00 2001
From: Patrick Pokatilo 
Date: Thu, 9 Jul 2015 18:16:00 +0200
Subject: [PATCH 40/97] Add PFMERGE command

---
 src/Redis.php | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/Redis.php b/src/Redis.php
index 87e1750..4d2ad4b 100644
--- a/src/Redis.php
+++ b/src/Redis.php
@@ -3160,6 +3160,22 @@ public function pfAdd( $key, array $elements ) {}
      * $redis->pfCount(array('key1', 'key2')); // int(3)
      */
     public function pfCount( $key ) {}
+
+    /**
+     * Merge multiple HyperLogLog values into an unique value that will approximate the cardinality
+     * of the union of the observed Sets of the source HyperLogLog structures.
+     * @param   string  $destkey
+     * @param   array   $sourcekeys
+     * @return  bool
+     * @link    http://redis.io/commands/pfmerge
+     * @example
+     * 
+     * $redis->pfAdd('key1', array('elem1', 'elem2'));
+     * $redis->pfAdd('key2', array('elem3', 'elem2'));
+     * $redis->pfMerge('key3', array('key1', 'key2'));
+     * $redis->pfCount('key3'); // int(3)
+     */
+    public function pfMerge( $destkey, array $sourcekeys ) {}
 }
 
 class RedisException extends Exception {}

From 6bfe57113ca0cb33ee85e62d42c5a1a43bb7ddcf Mon Sep 17 00:00:00 2001
From: Patrick Pokatilo 
Date: Thu, 9 Jul 2015 18:25:50 +0200
Subject: [PATCH 41/97] Add rawCommand

---
 src/Redis.php | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/Redis.php b/src/Redis.php
index 4d2ad4b..b829611 100644
--- a/src/Redis.php
+++ b/src/Redis.php
@@ -3176,6 +3176,19 @@ public function pfCount( $key ) {}
      * $redis->pfCount('key3'); // int(3)
      */
     public function pfMerge( $destkey, array $sourcekeys ) {}
+
+    /**
+     * Send arbitrary things to the redis server.
+     * @param   string      $command    Required command to send to the server.
+     * @param   mixed,...   $arguments  Optional variable amount of arguments to send to the server.
+     * @return  mixed
+     * @example
+     * 
+     * $redis->rawCommand('SET', 'key', 'value'); // bool(true)
+     * $redis->rawCommand('GET", 'key'); // string(5) "value"
+     * 
+ */ + public function rawCommand( $command, $arguments ) {} } class RedisException extends Exception {} From db594da4a17e284fd0c816c882d898382a16975b Mon Sep 17 00:00:00 2001 From: Patrick Pokatilo Date: Thu, 9 Jul 2015 18:29:00 +0200 Subject: [PATCH 42/97] Update constants AFTER and BEFORE --- src/Redis.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Redis.php b/src/Redis.php index b829611..9496280 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -31,8 +31,8 @@ */ class Redis { - const AFTER = ''; - const BEFORE = ''; + const AFTER = 'after'; + const BEFORE = 'before'; /** * Options From 79b5b6980d31aa9e984375102dbd469be5dfc79e Mon Sep 17 00:00:00 2001 From: Patrick Pokatilo Date: Thu, 9 Jul 2015 18:29:16 +0200 Subject: [PATCH 43/97] Update constants ATOMIC, MULTI and PIPELINE --- src/Redis.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Redis.php b/src/Redis.php index 9496280..dba0720 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -66,8 +66,9 @@ class Redis /** * Multi */ - const MULTI = ''; - const PIPELINE = ''; + const ATOMIC = 0; + const MULTI = 1; + const PIPELINE = 2; /** * Type From 681c50a870ecf77745b9261ada005f96e69c4a74 Mon Sep 17 00:00:00 2001 From: Ricky Wiens Date: Thu, 9 Jul 2015 12:03:51 -0500 Subject: [PATCH 44/97] Fixing multi declaration. various fixes to documentation. --- src/Redis.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Redis.php b/src/Redis.php index afde25f..bb290d1 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -50,8 +50,8 @@ class Redis /** * Multi */ - const MULTI = ''; - const PIPELINE = ''; + const MULTI = 0; + const PIPELINE = 1; /** * Type @@ -253,7 +253,7 @@ public function delete( $key1, $key2 = null, $key3 = null ) {} /** * Enter and exit transactional mode. * - * @internal param Redis::MULTI|Redis::PIPELINE + * @param int Redis::MULTI|Redis::PIPELINE * Defaults to Redis::MULTI. * A Redis::MULTI block of commands runs as a single transaction; * a Redis::PIPELINE block is simply transmitted faster to the server, but without any guarantee of atomicity. @@ -277,7 +277,7 @@ public function delete( $key1, $key2 = null, $key3 = null ) {} * // 3 => 'val2'); *
*/ - public function multi( ) {} + public function multi( $mode = Redis::MULTI ) {} /** * @see multi() @@ -719,7 +719,6 @@ public function lLen( $key ) {} /** * @see lLen() * @param string $key - * @param int $index * @link http://redis.io/commands/llen */ public function lSize( $key ) {} @@ -1450,7 +1449,7 @@ public function expire( $key, $ttl ) {} * Sets an expiration date (a timeout in milliseconds) on an item. * * @param string $key The key that will disappear. - * @param int $pttl The key's remaining Time To Live, in milliseconds. + * @param int $ttl The key's remaining Time To Live, in milliseconds. * @return bool: TRUE in case of success, FALSE in case of failure. * @link http://redis.io/commands/pexpire * @example @@ -1781,6 +1780,7 @@ public function bitCount( $key ) {} * @param string $retKey return key * @param string $key1 * @param string $key2 + * @param string $key3 * @return int The size of the string stored in the destination key. * @link http://redis.io/commands/bitop * @example @@ -2971,7 +2971,7 @@ public function _hosts() {} public function _function() {} /** - * @param string key The key for which you want to lookup the host + * @param string $key The key for which you want to lookup the host * @return string the host to be used for a certain key */ public function _target($key) {} From 0d9f56c0a99fdbe31a235353af90920e7517eabf Mon Sep 17 00:00:00 2001 From: Patrick Pokatilo Date: Thu, 9 Jul 2015 19:23:02 +0200 Subject: [PATCH 45/97] Add BITPOS command --- src/Redis.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/Redis.php b/src/Redis.php index dba0720..9672e39 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -1795,6 +1795,38 @@ public function setRange( $key, $offset, $value ) {} */ public function strlen( $key ) {} + /** + * Return the position of the first bit set to 1 or 0 in a string. The position is returned, thinking of the + * string as an array of bits from left to right, where the first byte's most significant bit is at position 0, + * the second byte's most significant bit is at position 8, and so forth. + * @param string $key + * @param int $bit + * @param int $start + * @param int $end + * @return int The command returns the position of the first bit set to 1 or 0 according to the request. + * If we look for set bits (the bit argument is 1) and the string is empty or composed of just + * zero bytes, -1 is returned. If we look for clear bits (the bit argument is 0) and the string + * only contains bit set to 1, the function returns the first bit not part of the string on the + * right. So if the string is three bytes set to the value 0xff the command BITPOS key 0 will + * return 24, since up to bit 23 all the bits are 1. Basically, the function considers the right + * of the string as padded with zeros if you look for clear bits and specify no range or the + * start argument only. However, this behavior changes if you are looking for clear bits and + * specify a range with both start and end. If no clear bit is found in the specified range, the + * function returns -1 as the user specified a clear range and there are no 0 bits in that range. + * @link http://redis.io/commands/bitpos + * @example + *
+     * $redis->set('key', '\xff\xff');
+     * $redis->bitpos('key', 1); // int(0)
+     * $redis->bitpos('key', 1, 1); // int(8)
+     * $redis->bitpos('key', 1, 3); // int(-1)
+     * $redis->bitpos('key', 0); // int(16)
+     * $redis->bitpos('key', 0, 1); // int(16)
+     * $redis->bitpos('key', 0, 1, 5); // int(-1)
+     * 
+ */ + public function bitpos( $key, $bit, $start = 0, $end = null) {} + /** * Return a single bit out of a larger string * From fcaf713b84f1f51a82b1e231b5fc99d0db94fece Mon Sep 17 00:00:00 2001 From: Patrick Pokatilo Date: Thu, 9 Jul 2015 19:27:32 +0200 Subject: [PATCH 46/97] Add getMode --- src/Redis.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Redis.php b/src/Redis.php index 9672e39..21b0ff6 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -3222,6 +3222,13 @@ public function pfMerge( $destkey, array $sourcekeys ) {} *
*/ public function rawCommand( $command, $arguments ) {} + + /** + * Detect whether we're in ATOMIC/MULTI/PIPELINE mode. + * @return int Either Redis::ATOMIC, Redis::MULTI or Redis::PIPELINE + * @example $redis->getMode(); + */ + public function getMode() {} } class RedisException extends Exception {} From fd8a47fabb6462a6dd52713e504792f31d2b234c Mon Sep 17 00:00:00 2001 From: Patrick Pokatilo Date: Mon, 20 Jul 2015 00:28:30 +0200 Subject: [PATCH 47/97] Change case of method name in example --- src/Redis.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Redis.php b/src/Redis.php index 21b0ff6..f224ed1 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -1371,7 +1371,7 @@ public function sGetMembers( $key ) {} * @example *
      * $iterator = null;
-     * while ($members = $redis->sscan('set', $iterator)) {
+     * while ($members = $redis->sScan('set', $iterator)) {
      *     foreach ($members as $member) {
      *         echo $member . PHP_EOL;
      *     }

From 1cbdbcaf7ce2a4dfbc2949b0bd69d04d7c6a34d0 Mon Sep 17 00:00:00 2001
From: Vekseid 
Date: Sun, 17 Jan 2016 14:45:35 -0800
Subject: [PATCH 48/97] Added missing parameters to connect/pconnect

$persistent_id/$reserved and $retry_interval were missing.
---
 src/Redis.php | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/Redis.php b/src/Redis.php
index 65b4d54..d93c71e 100644
--- a/src/Redis.php
+++ b/src/Redis.php
@@ -94,6 +94,8 @@ public function __construct( ) {}
      * @param string    $host       can be a host, or the path to a unix domain socket
      * @param int       $port       optional
      * @param float     $timeout    value in seconds (optional, default is 0.0 meaning unlimited)
+     * @param null      $reserved   should be null if $retry_interval is specified
+     * @param int       $retry_interval  retry interval in milliseconds.
      * @return bool                 TRUE on success, FALSE on error.
      * @example
      * 
@@ -103,15 +105,17 @@ public function __construct( ) {}
      * $redis->connect('/tmp/redis.sock');      // unix domain socket.
      * 
*/ - public function connect( $host, $port = 6379, $timeout = 0.0 ) {} + public function connect( $host, $port = 6379, $timeout = 0.0, $reserved = null, $retry_interval = 0 ) {} /** * @see connect() * @param string $host * @param int $port * @param float $timeout + * @param null $reserved + * @param int $retry_interval */ - public function open( $host, $port = 6379, $timeout = 0.0 ) {} + public function open( $host, $port = 6379, $timeout = 0.0, $reserved = null, $retry_interval = 0 ) {} /** * Connects to a Redis instance or reuse a connection already established with pconnect/popen. @@ -129,6 +133,8 @@ public function open( $host, $port = 6379, $timeout = 0.0 ) {} * @param string $host can be a host, or the path to a unix domain socket * @param int $port optional * @param float $timeout value in seconds (optional, default is 0 meaning unlimited) + * @param string $persistent_id unique identifier string for the connection + * @param int $retry_interval retry time in milliseconds * @return bool TRUE on success, FALSE on error. * @example *
@@ -138,15 +144,17 @@ public function open( $host, $port = 6379, $timeout = 0.0 ) {}
      * $redis->connect('/tmp/redis.sock');      // unix domain socket.
      * 
*/ - public function pconnect( $host, $port = 6379, $timeout = 0.0 ) {} + public function pconnect( $host, $port = 6379, $timeout = 0.0, $persistent_id = '', $retry_interval = 0 ) {} /** * @see pconnect() * @param string $host * @param int $port * @param float $timeout + * @param string $persistent_id + * @param int $retry_interval */ - public function popen( $host, $port = 6379, $timeout = 0.0 ) {} + public function popen( $host, $port = 6379, $timeout = 0.0, $persistent_id = '', $retry_interval = 0 ) {} /** * Disconnects from the Redis instance, except when pconnect is used. From f6d6dd45cfb693ae6b3cb68a3be6e9308aab6c3c Mon Sep 17 00:00:00 2001 From: Nikita Date: Fri, 5 Feb 2016 19:02:17 +0500 Subject: [PATCH 49/97] fix return value of sGetMembers --- src/Redis.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Redis.php b/src/Redis.php index d93c71e..3dcfb1a 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -1362,6 +1362,7 @@ public function sMembers( $key ) {} /** * @see sMembers() + * @return array An array of elements, the contents of the set. * @param string $key * @link http://redis.io/commands/smembers */ From 65b75c954337e80d9b0462e9e5a8b499291ef43d Mon Sep 17 00:00:00 2001 From: Vitaly Chirkov Date: Thu, 3 Mar 2016 14:03:49 +0300 Subject: [PATCH 50/97] Add return type for exec() to get rid of warning --- src/Redis.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Redis.php b/src/Redis.php index 3dcfb1a..88008a7 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -306,6 +306,7 @@ public function multi( $mode = Redis::MULTI ) {} /** * @see multi() + * @return void|array * @link http://redis.io/commands/exec */ public function exec( ) {} From 875e7307e18c816c8a561f716d2adecf412c982a Mon Sep 17 00:00:00 2001 From: Max Kamashev Date: Mon, 29 Aug 2016 23:08:15 +0300 Subject: [PATCH 51/97] fixed #27 - add missed argument in blPop, brPop --- src/Redis.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Redis.php b/src/Redis.php index 88008a7..dcd0d23 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -670,8 +670,10 @@ public function rPop( $key ) {} * Il all the list identified by the keys passed in arguments are empty, blPop will block * during the specified timeout until an element is pushed to one of those lists. This element will be popped. * - * @param array $keys Array containing the keys of the lists INTEGER Timeout - * Or STRING Key1 STRING Key2 STRING Key3 ... STRING Keyn INTEGER Timeout + * @param array $keys Array containing the keys of the lists + * Or STRING Key1 STRING Key2 STRING Key3 ... STRING Keyn + * @param int $timeout Timeout + * * @return array array('listName', 'element') * @link http://redis.io/commands/blpop * @example @@ -702,7 +704,7 @@ public function rPop( $key ) {} * // array('key1', 'A') is returned *
*/ - public function blPop( array $keys ) {} + public function blPop( array $keys, $timeout) {} /** * Is a blocking rPop primitive. If at least one of the lists contains at least one element, @@ -711,8 +713,9 @@ public function blPop( array $keys ) {} * block during the specified timeout until an element is pushed to one of those lists. T * his element will be popped. * - * @param array $keys Array containing the keys of the lists INTEGER Timeout - * Or STRING Key1 STRING Key2 STRING Key3 ... STRING Keyn INTEGER Timeout + * @param array $keys Array containing the keys of the lists + * Or STRING Key1 STRING Key2 STRING Key3 ... STRING Keyn + * @param int $timeout Timeout * @return array array('listName', 'element') * @link http://redis.io/commands/brpop * @example @@ -743,7 +746,7 @@ public function blPop( array $keys ) {} * // array('key1', 'A') is returned *
*/ - public function brPop( array $keys ) {} + public function brPop( array $keys, $timeout ) {} /** From bcd3f762ba5d40ae26f565ac580293c912bb4d7b Mon Sep 17 00:00:00 2001 From: Max Kamashev Date: Mon, 29 Aug 2016 23:36:57 +0300 Subject: [PATCH 52/97] fixed #25 - add options in set() signature --- src/Redis.php | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/src/Redis.php b/src/Redis.php index dcd0d23..1925d3d 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -210,14 +210,31 @@ public function get( $key ) {} /** * Set the string value in argument as value of the key. * - * @param string $key - * @param string $value - * @param int $ttl Calling setex() is preferred if you want a Time To Live. - * @return bool: If the command is successful return TRUE or 'Redis Socket Buffer' object - * @link http://redis.io/commands/set - * @example $redis->set('key', 'value'); + * @since If you're using Redis >= 2.6.12, you can pass extended options as explained in example + * + * @param string $key + * @param string $value + * @param int|array $timeout If you pass an integer, phpredis will redirect to SETEX, and will try to use Redis >= 2.6.12 extended options if you pass an array with valid values + * + *
+     * // Simple key -> value set
+     * $redis->set('key', 'value');
+     *
+     * // Will redirect, and actually make an SETEX call
+     * $redis->set('key','value', 10);
+     *
+     * // Will set the key, if it doesn't exist, with a ttl of 10 seconds
+     * $redis->set('key', 'value', Array('nx', 'ex'=>10));
+     *
+     * // Will set a key, if it does exist, with a ttl of 1000 miliseconds
+     * $redis->set('key', 'value', Array('xx', 'px'=>1000));
+     * 
+ * + * @return bool TRUE if the command is successful. + * + * @link http://redis.io/commands/set */ - public function set( $key, $value, $ttl = 0 ) {} + public function set( $key, $value, $timeout = 0 ) {} /** * Set the string value in argument as value of the key, with a time to live. From acee5c7d049ecc04d8dc42694bcc8fb9723cbee7 Mon Sep 17 00:00:00 2001 From: Maksim Kamashev Date: Fri, 9 Sep 2016 16:34:06 +0300 Subject: [PATCH 53/97] fix #28 - add method isConnected() --- src/Redis.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Redis.php b/src/Redis.php index 1925d3d..cf5770b 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -107,6 +107,12 @@ public function __construct( ) {} */ public function connect( $host, $port = 6379, $timeout = 0.0, $reserved = null, $retry_interval = 0 ) {} + /** + * A method to determine if a phpredis object thinks it's connected to a server + * @return bool Returns TRUE if phpredis thinks it's connected and FALSE if not + */ + public function isConnected() {} + /** * @see connect() * @param string $host From 2c3daf77a25c4e5add30e83ae4e520fbe3088603 Mon Sep 17 00:00:00 2001 From: huyaolong Date: Wed, 2 Nov 2016 19:55:10 +0800 Subject: [PATCH 54/97] modify function set $timeout default value. --- src/Redis.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Redis.php b/src/Redis.php index cf5770b..146ea50 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -240,7 +240,7 @@ public function get( $key ) {} * * @link http://redis.io/commands/set */ - public function set( $key, $value, $timeout = 0 ) {} + public function set( $key, $value, $timeout = null ) {} /** * Set the string value in argument as value of the key, with a time to live. From c3e3fcf3930b89e573b4d086a967c278d594b6c2 Mon Sep 17 00:00:00 2001 From: Petro Shpyhotskyi Date: Fri, 16 Feb 2018 10:13:47 +0200 Subject: [PATCH 55/97] Update README.markdown change "setup in IDE NetBeans" --- README.markdown | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/README.markdown b/README.markdown index 5e788fa..6a2d6b9 100644 --- a/README.markdown +++ b/README.markdown @@ -40,12 +40,8 @@ Do not forget to declare a variable type $ redis ### Setup in IDE NetBeans - * Right click your project -> "Properties" - * Select the "PHP Include Path" category - * Click "Add Folder..." - * Select your checkout of phpredis-phpdoc - * Click "Open" - * Click "OK" + * Save the file to netbeans stubs folder. For example: + `~/netbeans-8.2/php/phpstubs/phpruntime/redis.php` ### Setup in Zend Studio IDE (Eclipse PDT) From bab11f2b4ed0357c0b54d1623cb995965acb21ab Mon Sep 17 00:00:00 2001 From: mingrammer Date: Tue, 27 Feb 2018 18:31:58 +0900 Subject: [PATCH 56/97] Fix case typo (hMset => hMSet) --- src/Redis.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Redis.php b/src/Redis.php index 146ea50..4f08f31 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -2922,11 +2922,11 @@ public function hIncrByFloat( $key, $field, $increment ) {} * @example *
      * $redis->delete('user:1');
-     * $redis->hMset('user:1', array('name' => 'Joe', 'salary' => 2000));
+     * $redis->hMSet('user:1', array('name' => 'Joe', 'salary' => 2000));
      * $redis->hIncrBy('user:1', 'salary', 100); // Joe earns 100 more now.
      * 
*/ - public function hMset( $key, $hashKeys ) {} + public function hMSet( $key, $hashKeys ) {} /** * Retirieve the values associated to the specified fields in the hash. From 9ad5f58f250cc8589611cac8e402bfec59df1a71 Mon Sep 17 00:00:00 2001 From: Mafia Reloaded Date: Tue, 27 Feb 2018 18:48:32 +0000 Subject: [PATCH 57/97] First parameter to delete should be "string|array", not "int|array". --- src/Redis.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Redis.php b/src/Redis.php index 4f08f31..e5c1047 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -272,7 +272,7 @@ public function setnx( $key, $value ) {} /** * Remove specified keys. * - * @param int|array $key1 An array of keys, or an undefined number of parameters, each a key: key1 key2 key3 ... keyN + * @param string|array $key1 An array of keys, or an undefined number of parameters, each a key: key1 key2 key3 ... keyN * @param string $key2 ... * @param string $key3 ... * @return int Number of keys deleted. @@ -291,7 +291,7 @@ public function del( $key1, $key2 = null, $key3 = null ) {} /** * @see del() - * @param int|array $key1 + * @param string|array $key1 * @param string $key2 * @param string $key3 * @return int Number of keys deleted. From f30ddfdd36dce9ed61a14596f914a9ffeae25c50 Mon Sep 17 00:00:00 2001 From: doodoori2 Date: Wed, 5 Sep 2018 01:24:11 +0900 Subject: [PATCH 58/97] add method psetex, unlink, unsubscribe, punsubscribe --- src/Redis.php | 55 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/src/Redis.php b/src/Redis.php index e5c1047..ecb1905 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -254,6 +254,19 @@ public function set( $key, $value, $timeout = null ) {} */ public function setex( $key, $ttl, $value ) {} + /** + * Set the value and expiration in milliseconds of a key. + * + * @see setex() + * @param string $key + * @param int $ttl, in milliseconds. + * @param string $value + * @return bool: TRUE if the command is successful. + * @link http://redis.io/commands/psetex + * @example $redis->psetex('key', 1000, 'value'); // sets key → value, with 1sec TTL. + */ + public function psetex( $key, $ttl, $value ) {} + /** * Set the string value in argument as value of the key if the key doesn't already exist in the database. * @@ -298,6 +311,28 @@ public function del( $key1, $key2 = null, $key3 = null ) {} */ public function delete( $key1, $key2 = null, $key3 = null ) {} + /** + * Delete a key asynchronously in another thread. Otherwise it is just as DEL, but non blocking. + * + * @see del() + * @param string|array $key1 + * @param string $key2 + * @param string $key3 + * @return int Number of keys unlinked. + * + * @link https://redis.io/commands/unlink + * @example + *
+     * $redis->set('key1', 'val1');
+     * $redis->set('key2', 'val2');
+     * $redis->set('key3', 'val3');
+     * $redis->set('key4', 'val4');
+     * $redis->unlink('key1', 'key2');          // return 2
+     * $redis->unlink(array('key3', 'key4'));   // return 2
+     * 
+ */ + public function unlink( $key1, $key2 = null, $key3 = null ) {} + /** * Enter and exit transactional mode. * @@ -367,7 +402,7 @@ public function unwatch( ) {} /** * Subscribe to channels. Warning: this function will probably change in the future. * - * @param array $channels an array of channels to subscribe to + * @param array $channels an array of channels to subscribe * @param string | array $callback either a string or an array($instance, 'method_name'). * The callback function receives 3 parameters: the redis instance, the channel name, and the message. * @return mixed Any non-null return value in the callback will be returned to the caller. @@ -398,7 +433,7 @@ public function subscribe( $channels, $callback ) {} /** * Subscribe to channels by pattern * - * @param array $patterns The number of elements removed from the set. + * @param array $patterns an array of glob-style patterns to subscribe * @param string|array $callback Either a string or an array with an object and method. * The callback will get four arguments ($redis, $pattern, $channel, $message) * @param mixed Any non-null return value in the callback will be returned to the caller. @@ -447,6 +482,22 @@ public function publish( $channel, $message ) {} */ public function pubsub( $keyword, $argument ) {} + /** + * Stop listening for messages posted to the given channels. + * + * @param array $channels an array of channels to usubscribe + * @link http://redis.io/commands/unsubscribe + */ + public function unsubscribe( $channels = null ) {} + + /** + * Stop listening for messages posted to the given channels. + * + * @param array $patterns an array of glob-style patterns to unsubscribe + * @link http://redis.io/commands/punsubscribe + */ + public function punsubscribe( $patterns = null ) {} + /** * Verify if the specified key exists. * From 34bf742de912975af0cadbe40e2d7e2039d03f00 Mon Sep 17 00:00:00 2001 From: doodoori2 Date: Wed, 5 Sep 2018 00:54:41 +0900 Subject: [PATCH 59/97] implement echo as a method --- src/Redis.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Redis.php b/src/Redis.php index e5c1047..07214dc 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -4,8 +4,6 @@ * @author Max Kamashev * @link https://github.com/ukko/phpredis-phpdoc * - * @method echo string $string Sends a string to Redis, which replies with the same string - * * @method eval( $script, $args = array(), $numKeys = 0 ) * Evaluate a LUA script serverside * @param string $script @@ -202,6 +200,15 @@ public function getOption( $name ) {} */ public function ping( ) {} + /** + * Echo the given string + * + * @param string $message + * @return string: Returns message. + * @link http://redis.io/commands/echo + */ + public function echo( $message ) {} + /** * Get the value related to the specified key * From 8cae84803cdfbc6902f61a54725c3b7e07a586ee Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Mon, 19 Nov 2018 16:11:33 +0100 Subject: [PATCH 60/97] added redis stream functions --- src/Redis.php | 200 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 200 insertions(+) diff --git a/src/Redis.php b/src/Redis.php index d9b495a..ca4861f 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -3323,6 +3323,206 @@ public function rawCommand( $command, $arguments ) {} * @example $redis->getMode(); */ public function getMode() {} + + /** + * Acknowledge one or more messages on behalf of a consumer group. + * @param string $stream + * @param string $group + * @param array $arr_messages + * @return int The number of messages Redis reports as acknowledged. + * @example + *
+     * $obj_redis->xAck('stream', 'group1', ['1530063064286-0', '1530063064286-1']);
+     * 
+ */ + public function xAck($stream, $group, $arr_messages) {} + + /** + * Add a message to a stream. + * @param string $str_key + * @param string $str_id + * @param $arr_message + * @return string The added message ID. + * @example + *
+     * $obj_redis->xAdd('mystream', "\*", ['field' => 'value']);
+     * 
+ */ + public function xAdd($str_key, $str_id, $arr_message) {} + + /** + * Claim ownership of one or more pending messages. + * @param string $str_key + * @param string $str_group + * @param string $str_consumer + * @param array $ids + * @param array $arr_options ['IDLE' => $value, 'TIME' => $value, 'RETRYCOUNT' => $value, 'FORCE', 'JUSTID'] + * @return array Either an array of message IDs along with corresponding data, or just an array of IDs (if the 'JUSTID' option was passed). + * @example + *
+     * $ids = ['1530113681011-0', '1530113681011-1', '1530113681011-2'];
+     *
+     * // Without any options
+     * $obj_redis->xClaim('mystream', 'group1', 'myconsumer1', $ids);
+     *
+     * // With options
+     * $obj_redis->xClaim(
+     *     'mystream', 'group1', 'myconsumer2', $ids,
+     *     [
+     *         'IDLE' => time() * 1000,
+     *         'RETRYCOUNT' => 5,
+     *         'FORCE',
+     *         'JUSTID'
+     *     ]
+     * );
+     * 
+ */ + public function xClaim($str_key, $str_group, $str_consumer, $ids, $arr_options = []) {} + + /** + * Delete one or more messages from a stream. + * @param string $str_key + * @param array $arr_ids + * @return int The number of messages removed. + * @example + *
+     * $obj_redis->xDel('mystream', ['1530115304877-0', '1530115305731-0']);
+     * 
+ */ + public function xDel($str_key, $arr_ids) {} + + /** + * @param string $operation e.g.: 'HELP', 'SETID', 'DELGROUP', 'CREATE', 'DELCONSUMER' + * @param string $str_key + * @param string $str_group + * @param string $str_msg_id + * @return mixed This command returns different types depending on the specific XGROUP command executed. + * @example + *
+     * $obj_redis->xGroup('CREATE', 'mystream', 'mygroup');
+     * $obj_redis->xGroup('DELGROUP', 'mystream', 'mygroup');
+     * 
+ */ + public function xGroup($operation, $str_key, $str_group, $str_msg_id) {} + + /** + * Get information about a stream or consumer groups. + * @param string $operation e.g.: 'CONSUMERS', 'GROUPS', 'STREAM', 'HELP' + * @param string $str_stream + * @param string $str_group + * @return mixed This command returns different types depending on which subcommand is used. + * @example + *
+     * $obj_redis->xInfo('STREAM', 'mystream');
+     * 
+ */ + public function xInfo($operation, $str_stream, $str_group) {} + + /** + * Get the length of a given stream. + * @param string $str_stream + * @return int The number of messages in the stream. + * @example + *
+     * $obj_redis->xLen('mystream');
+     * 
+ */ + public function xLen($str_stream) {} + + /** + * Get information about pending messages in a given stream. + * @param string $str_stream + * @param string $str_group + * @param int|string $i_start + * @param int|string $i_end + * @param int|string $i_count + * @param string $str_consumer + * @return array Information about the pending messages, in various forms depending on the specific invocation of XPENDING. + * @example + *
+     * $obj_redis->xPending('mystream', 'mygroup');
+     * $obj_redis->xPending('mystream', 'mygroup', 0, '+', 1, 'consumer-1');
+     * 
+ */ + public function xPending($str_stream, $str_group, $i_start = null, $i_end = null, $i_count = null, $str_consumer = null) {} + + /** + * Get a range of messages from a given stream. + * @param string $str_stream + * @param int $i_start + * @param int $i_end + * @param int $i_count + * @return array The messages in the stream within the requested range. + * @example + *
+     * // Get everything in this stream
+     * $obj_redis->xRange('mystream', '-', '+');
+     * // Only the first two messages
+     * $obj_redis->xRange('mystream', '-', '+', 2);
+     * 
+ */ + public function xRange($str_stream, $i_start, $i_end, $i_count = null) {} + + /** + * Read data from one or more streams and only return IDs greater than sent in the command. + * @param $arr_streams + * @param int|string $i_count + * @param int|string $i_block + * @return array The messages in the stream newer than the IDs passed to Redis (if any). + * @example + *
+     * $obj_redis->xRead(['stream1' => '1535222584555-0', 'stream2' => '1535222584555-0']);
+     * 
+ */ + public function xRead($arr_streams, $i_count = null, $i_block = null) {} + + /** + * This method is similar to xRead except that it supports reading messages for a specific consumer group. + * @param string $str_group + * @param string $str_consumer + * @param array $arr_streams + * @param int|string $i_count + * @param int|string $i_block + * @return array The messages delivered to this consumer group (if any). + * @example + *
+     * // Consume messages for 'mygroup', 'consumer1'
+     * $obj_redis->xReadGroup('mygroup', 'consumer1', ['s1' => 0, 's2' => 0]);
+     * // Read a single message as 'consumer2' for up to a second until a message arrives.
+     * $obj_redis->xReadGroup('mygroup', 'consumer2', ['s1' => 0, 's2' => 0], 1, 1000);
+     * 
+ */ + public function xReadGroup($str_group, $str_consumer, $arr_streams, $i_count, $i_block = null) {} + + /** + * This is identical to xRange except the results come back in reverse order. Also note that Redis reverses the order of "start" and "end". + * @param string $str_stream + * @param int|string $i_end + * @param int|string $i_start + * @param int|string $i_count + * @return array The messages in the range specified. + * @example + *
+     * $obj_redis->xRevRange('mystream', '+', '-');
+     * 
+ */ + public function xRevRange($str_stream, $i_end, $i_start, $i_count = null) {} + + /** + * Trim the stream length to a given maximum. If the "approximate" flag is pasesed, Redis will use your size as a hint but only trim trees in whole nodes (this is more efficient).. + * @param string $str_stream + * @param int $i_max_len + * @param bool $boo_approximate + * @return int The number of messages trimed from the stream. + * @example + *
+     * // Trim to exactly 100 messages
+     * $obj_redis->xTrim('mystream', 100);
+     * // Let Redis approximate the trimming
+     * $obj_redis->xTrim('mystream', 100, true);
+     * 
+ */ + public function xTrim($str_stream, $i_max_len, $boo_approximate) {} } class RedisException extends Exception {} From f66569faf58c7d7e2e25ea8b3b8c70f5f69a2bd9 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Mon, 19 Nov 2018 17:08:31 +0100 Subject: [PATCH 61/97] fixed example wildcard --- src/Redis.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Redis.php b/src/Redis.php index ca4861f..f8b5ee7 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -3345,7 +3345,7 @@ public function xAck($stream, $group, $arr_messages) {} * @return string The added message ID. * @example *
-     * $obj_redis->xAdd('mystream', "\*", ['field' => 'value']);
+     * $obj_redis->xAdd('mystream', "*", ['field' => 'value']);
      * 
*/ public function xAdd($str_key, $str_id, $arr_message) {} From 4bc25cfbaa3cef0df367b5cacc3eb6c2b5543ed3 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Mon, 19 Nov 2018 20:45:37 +0100 Subject: [PATCH 62/97] fixed xclaim redis phpdocs --- src/Redis.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Redis.php b/src/Redis.php index f8b5ee7..8e5c086 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -3355,7 +3355,8 @@ public function xAdd($str_key, $str_id, $arr_message) {} * @param string $str_key * @param string $str_group * @param string $str_consumer - * @param array $ids + * @param int $min_idle_time + * @param array $arr_ids * @param array $arr_options ['IDLE' => $value, 'TIME' => $value, 'RETRYCOUNT' => $value, 'FORCE', 'JUSTID'] * @return array Either an array of message IDs along with corresponding data, or just an array of IDs (if the 'JUSTID' option was passed). * @example @@ -3363,11 +3364,11 @@ public function xAdd($str_key, $str_id, $arr_message) {} * $ids = ['1530113681011-0', '1530113681011-1', '1530113681011-2']; * * // Without any options - * $obj_redis->xClaim('mystream', 'group1', 'myconsumer1', $ids); + * $obj_redis->xClaim('mystream', 'group1', 'myconsumer1', 0, $ids); * * // With options * $obj_redis->xClaim( - * 'mystream', 'group1', 'myconsumer2', $ids, + * 'mystream', 'group1', 'myconsumer2', 0, $ids, * [ * 'IDLE' => time() * 1000, * 'RETRYCOUNT' => 5, @@ -3377,7 +3378,7 @@ public function xAdd($str_key, $str_id, $arr_message) {} * ); *
*/ - public function xClaim($str_key, $str_group, $str_consumer, $ids, $arr_options = []) {} + public function xClaim($str_key, $str_group, $str_consumer, $min_idle_time, $arr_ids, $arr_options = []) {} /** * Delete one or more messages from a stream. From 5b62347357f0b9c3240e1c806895b010ed36f4f9 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Tue, 20 Nov 2018 09:25:53 +0100 Subject: [PATCH 63/97] update stream methods --- src/Redis.php | 133 +++++++++++++++++++++++++++----------------------- 1 file changed, 73 insertions(+), 60 deletions(-) diff --git a/src/Redis.php b/src/Redis.php index 8e5c086..e2f98d0 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -3326,10 +3326,11 @@ public function getMode() {} /** * Acknowledge one or more messages on behalf of a consumer group. - * @param string $stream - * @param string $group - * @param array $arr_messages - * @return int The number of messages Redis reports as acknowledged. + * @param string $stream + * @param string $group + * @param array $arr_messages + * @return int The number of messages Redis reports as acknowledged. + * @link https://redis.io/commands/xack * @example *
      * $obj_redis->xAck('stream', 'group1', ['1530063064286-0', '1530063064286-1']);
@@ -3339,10 +3340,11 @@ public function xAck($stream, $group, $arr_messages) {}
 
     /**
      * Add a message to a stream.
-     * @param string $str_key
-     * @param string $str_id
-     * @param $arr_message
-     * @return string The added message ID.
+     * @param   string  $str_key
+     * @param   string  $str_id
+     * @param   array   $arr_message
+     * @return  string  The added message ID.
+     * @link    https://redis.io/commands/xadd
      * @example
      * 
      * $obj_redis->xAdd('mystream', "*", ['field' => 'value']);
@@ -3352,13 +3354,14 @@ public function xAdd($str_key, $str_id, $arr_message) {}
 
     /**
      * Claim ownership of one or more pending messages.
-     * @param string $str_key
-     * @param string $str_group
-     * @param string $str_consumer
-     * @param int $min_idle_time
-     * @param array $arr_ids
-     * @param array $arr_options ['IDLE' => $value, 'TIME' => $value, 'RETRYCOUNT' => $value, 'FORCE', 'JUSTID']
-     * @return array Either an array of message IDs along with corresponding data, or just an array of IDs (if the 'JUSTID' option was passed).
+     * @param   string  $str_key
+     * @param   string  $str_group
+     * @param   string  $str_consumer
+     * @param   int     $min_idle_time
+     * @param   array   $arr_ids
+     * @param   array   $arr_options ['IDLE' => $value, 'TIME' => $value, 'RETRYCOUNT' => $value, 'FORCE', 'JUSTID']
+     * @return  array   Either an array of message IDs along with corresponding data, or just an array of IDs (if the 'JUSTID' option was passed).
+     * @link    https://redis.io/commands/xclaim
      * @example
      * 
      * $ids = ['1530113681011-0', '1530113681011-1', '1530113681011-2'];
@@ -3382,9 +3385,10 @@ public function xClaim($str_key, $str_group, $str_consumer, $min_idle_time, $arr
 
     /**
      * Delete one or more messages from a stream.
-     * @param string $str_key
-     * @param array $arr_ids
-     * @return int The number of messages removed.
+     * @param   string  $str_key
+     * @param   array   $arr_ids
+     * @return  int     The number of messages removed.
+     * @link    https://redis.io/commands/xdel
      * @example
      * 
      * $obj_redis->xDel('mystream', ['1530115304877-0', '1530115305731-0']);
@@ -3393,11 +3397,12 @@ public function xClaim($str_key, $str_group, $str_consumer, $min_idle_time, $arr
     public function xDel($str_key, $arr_ids) {}
 
     /**
-     * @param string $operation e.g.: 'HELP', 'SETID', 'DELGROUP', 'CREATE', 'DELCONSUMER'
-     * @param string $str_key
-     * @param string $str_group
-     * @param string $str_msg_id
-     * @return mixed This command returns different types depending on the specific XGROUP command executed.
+     * @param   string  $operation  e.g.: 'HELP', 'SETID', 'DELGROUP', 'CREATE', 'DELCONSUMER'
+     * @param   string  $str_key
+     * @param   string  $str_group
+     * @param   string  $str_msg_id
+     * @return  mixed   This command returns different types depending on the specific XGROUP command executed.
+     * @link    https://redis.io/commands/xgroup
      * @example
      * 
      * $obj_redis->xGroup('CREATE', 'mystream', 'mygroup');
@@ -3408,10 +3413,11 @@ public function xGroup($operation, $str_key, $str_group, $str_msg_id) {}
 
     /**
      * Get information about a stream or consumer groups.
-     * @param string $operation e.g.: 'CONSUMERS', 'GROUPS', 'STREAM', 'HELP'
-     * @param string $str_stream
-     * @param string $str_group
-     * @return mixed This command returns different types depending on which subcommand is used.
+     * @param   string  $operation  e.g.: 'CONSUMERS', 'GROUPS', 'STREAM', 'HELP'
+     * @param   string  $str_stream
+     * @param   string  $str_group
+     * @return  mixed   This command returns different types depending on which subcommand is used.
+     * @link    https://redis.io/commands/xinfo
      * @example
      * 
      * $obj_redis->xInfo('STREAM', 'mystream');
@@ -3421,8 +3427,9 @@ public function xInfo($operation, $str_stream, $str_group) {}
 
     /**
      * Get the length of a given stream.
-     * @param string $str_stream
-     * @return int The number of messages in the stream.
+     * @param   string  $str_stream
+     * @return  int     The number of messages in the stream.
+     * @link    https://redis.io/commands/xlen
      * @example
      * 
      * $obj_redis->xLen('mystream');
@@ -3432,13 +3439,14 @@ public function xLen($str_stream) {}
 
     /**
      * Get information about pending messages in a given stream.
-     * @param string $str_stream
-     * @param string $str_group
-     * @param int|string $i_start
-     * @param int|string $i_end
-     * @param int|string $i_count
-     * @param string $str_consumer
-     * @return array Information about the pending messages, in various forms depending on the specific invocation of XPENDING.
+     * @param   string      $str_stream
+     * @param   string      $str_group
+     * @param   int|string  $i_start
+     * @param   int|string  $i_end
+     * @param   int|string  $i_count
+     * @param   string      $str_consumer
+     * @return  array       Information about the pending messages, in various forms depending on the specific invocation of XPENDING.
+     * @link    https://redis.io/commands/xpending
      * @example
      * 
      * $obj_redis->xPending('mystream', 'mygroup');
@@ -3449,11 +3457,12 @@ public function xPending($str_stream, $str_group, $i_start = null, $i_end = null
 
     /**
      * Get a range of messages from a given stream.
-     * @param string $str_stream
-     * @param int $i_start
-     * @param int $i_end
-     * @param int $i_count
-     * @return array The messages in the stream within the requested range.
+     * @param   string  $str_stream
+     * @param   int     $i_start
+     * @param   int     $i_end
+     * @param   int     $i_count
+     * @return  array   The messages in the stream within the requested range.
+     * @link    https://redis.io/commands/xrange
      * @example
      * 
      * // Get everything in this stream
@@ -3466,10 +3475,11 @@ public function xRange($str_stream, $i_start, $i_end, $i_count = null) {}
 
     /**
      * Read data from one or more streams and only return IDs greater than sent in the command.
-     * @param $arr_streams
-     * @param int|string $i_count
-     * @param int|string $i_block
-     * @return array The messages in the stream newer than the IDs passed to Redis (if any).
+     * @param   array       $arr_streams
+     * @param   int|string  $i_count
+     * @param   int|string  $i_block
+     * @return  array       The messages in the stream newer than the IDs passed to Redis (if any).
+     * @link    https://redis.io/commands/xread
      * @example
      * 
      * $obj_redis->xRead(['stream1' => '1535222584555-0', 'stream2' => '1535222584555-0']);
@@ -3479,12 +3489,13 @@ public function xRead($arr_streams, $i_count = null, $i_block = null) {}
 
     /**
      * This method is similar to xRead except that it supports reading messages for a specific consumer group.
-     * @param string $str_group
-     * @param string $str_consumer
-     * @param array $arr_streams
-     * @param int|string $i_count
-     * @param int|string $i_block
-     * @return array The messages delivered to this consumer group (if any).
+     * @param   string      $str_group
+     * @param   string      $str_consumer
+     * @param   array       $arr_streams
+     * @param   int|string  $i_count
+     * @param   int|string  $i_block
+     * @return  array       The messages delivered to this consumer group (if any).
+     * @link    https://redis.io/commands/xreadgroup
      * @example
      * 
      * // Consume messages for 'mygroup', 'consumer1'
@@ -3497,11 +3508,12 @@ public function xReadGroup($str_group, $str_consumer, $arr_streams, $i_count, $i
 
     /**
      * This is identical to xRange except the results come back in reverse order. Also note that Redis reverses the order of "start" and "end".
-     * @param string $str_stream
-     * @param int|string $i_end
-     * @param int|string $i_start
-     * @param int|string $i_count
-     * @return array The messages in the range specified.
+     * @param   string      $str_stream
+     * @param   int|string  $i_end
+     * @param   int|string  $i_start
+     * @param   int|string  $i_count
+     * @return  array       The messages in the range specified.
+     * @link    https://redis.io/commands/xrevrange
      * @example
      * 
      * $obj_redis->xRevRange('mystream', '+', '-');
@@ -3511,10 +3523,11 @@ public function xRevRange($str_stream, $i_end, $i_start, $i_count = null) {}
 
     /**
      * Trim the stream length to a given maximum. If the "approximate" flag is pasesed, Redis will use your size as a hint but only trim trees in whole nodes (this is more efficient)..
-     * @param string $str_stream
-     * @param int $i_max_len
-     * @param bool $boo_approximate
-     * @return int The number of messages trimed from the stream.
+     * @param   string  $str_stream
+     * @param   int     $i_max_len
+     * @param   bool    $boo_approximate
+     * @return  int     The number of messages trimed from the stream.
+     * @link    https://redis.io/commands/xtrim
      * @example
      * 
      * // Trim to exactly 100 messages

From fd1572ded20a531c45141e7472ea45535f9ae3eb Mon Sep 17 00:00:00 2001
From: Alexander Schranz 
Date: Tue, 20 Nov 2018 23:54:23 +0100
Subject: [PATCH 64/97] added missing arguments for connect, pconnect and popen

---
 src/Redis.php | 46 +++++++++++++++++++++++++---------------------
 1 file changed, 25 insertions(+), 21 deletions(-)

diff --git a/src/Redis.php b/src/Redis.php
index e2f98d0..be1d736 100644
--- a/src/Redis.php
+++ b/src/Redis.php
@@ -89,12 +89,13 @@ public function __construct( ) {}
     /**
      * Connects to a Redis instance.
      *
-     * @param string    $host       can be a host, or the path to a unix domain socket
-     * @param int       $port       optional
-     * @param float     $timeout    value in seconds (optional, default is 0.0 meaning unlimited)
-     * @param null      $reserved   should be null if $retry_interval is specified
-     * @param int       $retry_interval  retry interval in milliseconds.
-     * @return bool                 TRUE on success, FALSE on error.
+     * @param string    $host           can be a host, or the path to a unix domain socket
+     * @param int       $port           optional
+     * @param float     $timeout        value in seconds (optional, default is 0.0 meaning unlimited)
+     * @param null      $reserved       should be null if $retry_interval is specified
+     * @param int       $retry_interval retry interval in milliseconds.
+     * @param float     $read_timeout   value in seconds (optional, default is 0 meaning unlimited)
+     * @return bool                     TRUE on success, FALSE on error.
      * @example
      * 
      * $redis->connect('127.0.0.1', 6379);
@@ -103,7 +104,7 @@ public function __construct( ) {}
      * $redis->connect('/tmp/redis.sock');      // unix domain socket.
      * 
*/ - public function connect( $host, $port = 6379, $timeout = 0.0, $reserved = null, $retry_interval = 0 ) {} + public function connect( $host, $port = 6379, $timeout = 0.0, $reserved = null, $retry_interval = 0, $read_timeout = 0.0 ) {} /** * A method to determine if a phpredis object thinks it's connected to a server @@ -129,26 +130,27 @@ public function open( $host, $port = 6379, $timeout = 0.0, $reserved = null, $re * many servers connecting to one redis server. * * Also more than one persistent connection can be made identified by either host + port + timeout - * or unix socket + timeout. + * or host + persistent_id or unix socket + timeout. * * This feature is not available in threaded versions. pconnect and popen then working like their non persistent * equivalents. * - * @param string $host can be a host, or the path to a unix domain socket - * @param int $port optional - * @param float $timeout value in seconds (optional, default is 0 meaning unlimited) - * @param string $persistent_id unique identifier string for the connection - * @param int $retry_interval retry time in milliseconds - * @return bool TRUE on success, FALSE on error. - * @example + * @param string $host can be a host, or the path to a unix domain socket + * @param int $port optional + * @param float $timeout value in seconds (optional, default is 0 meaning unlimited) + * @param string $persistent_id identity for the requested persistent connection + * @param int $retry_interval retry interval in milliseconds. + * @param float $read_timeout value in seconds (optional, default is 0 meaning unlimited) + * @return bool TRUE on success, FALSE on ertcnror. *
-     * $redis->connect('127.0.0.1', 6379);
-     * $redis->connect('127.0.0.1');            // port 6379 by default
-     * $redis->connect('127.0.0.1', 6379, 2.5); // 2.5 sec timeout.
-     * $redis->connect('/tmp/redis.sock');      // unix domain socket.
+     * $redis->pconnect('127.0.0.1', 6379);
+     * $redis->pconnect('127.0.0.1');                 // port 6379 by default - same connection like before.
+     * $redis->pconnect('127.0.0.1', 6379, 2.5);      // 2.5 sec timeout and would be another connection than the two before.
+     * $redis->pconnect('127.0.0.1', 6379, 2.5, 'x'); // x is sent as persistent_id and would be another connection than the three before.
+     * $redis->pconnect('/tmp/redis.sock');           // unix domain socket - would be another connection than the four before.
      * 
*/ - public function pconnect( $host, $port = 6379, $timeout = 0.0, $persistent_id = '', $retry_interval = 0 ) {} + public function pconnect( $host, $port = 6379, $timeout = 0.0, $persistent_id = null, $retry_interval = 0, $read_timeout = 0.0 ) {} /** * @see pconnect() @@ -157,8 +159,10 @@ public function pconnect( $host, $port = 6379, $timeout = 0.0, $persistent_id = * @param float $timeout * @param string $persistent_id * @param int $retry_interval + * @param float $read_timeout + * @return bool */ - public function popen( $host, $port = 6379, $timeout = 0.0, $persistent_id = '', $retry_interval = 0 ) {} + public function popen( $host, $port = 6379, $timeout = 0.0, $persistent_id = '', $retry_interval = 0, $read_timeout = 0.0 ) {} /** * Disconnects from the Redis instance, except when pconnect is used. From 280ba133c440eaf9934414df10e202faa21fca0d Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Tue, 20 Nov 2018 23:56:26 +0100 Subject: [PATCH 65/97] fixed open function phpdoc --- src/Redis.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Redis.php b/src/Redis.php index be1d736..ae6bc9a 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -119,8 +119,10 @@ public function isConnected() {} * @param float $timeout * @param null $reserved * @param int $retry_interval + * @param float $read_timeout + * @return bool */ - public function open( $host, $port = 6379, $timeout = 0.0, $reserved = null, $retry_interval = 0 ) {} + public function open( $host, $port = 6379, $timeout = 0.0, $reserved = null, $retry_interval = 0, $read_timeout = 0.0 ) {} /** * Connects to a Redis instance or reuse a connection already established with pconnect/popen. From 35d008c225b30111932a3a68cc9c63044d6aa591 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Mon, 26 Nov 2018 18:26:23 +0100 Subject: [PATCH 66/97] fixed xpending, xrange, xrevrange functions --- src/Redis.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Redis.php b/src/Redis.php index ae6bc9a..46f5661 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -3447,25 +3447,25 @@ public function xLen($str_stream) {} * Get information about pending messages in a given stream. * @param string $str_stream * @param string $str_group - * @param int|string $i_start - * @param int|string $i_end - * @param int|string $i_count + * @param string $str_start + * @param string $str_end + * @param int $i_count * @param string $str_consumer * @return array Information about the pending messages, in various forms depending on the specific invocation of XPENDING. * @link https://redis.io/commands/xpending * @example *
      * $obj_redis->xPending('mystream', 'mygroup');
-     * $obj_redis->xPending('mystream', 'mygroup', 0, '+', 1, 'consumer-1');
+     * $obj_redis->xPending('mystream', 'mygroup', '-', '+', 1, 'consumer-1');
      * 
*/ - public function xPending($str_stream, $str_group, $i_start = null, $i_end = null, $i_count = null, $str_consumer = null) {} + public function xPending($str_stream, $str_group, $str_start = null, $str_end = null, $i_count = null, $str_consumer = null) {} /** * Get a range of messages from a given stream. * @param string $str_stream - * @param int $i_start - * @param int $i_end + * @param string $str_start + * @param string $str_end * @param int $i_count * @return array The messages in the stream within the requested range. * @link https://redis.io/commands/xrange @@ -3477,7 +3477,7 @@ public function xPending($str_stream, $str_group, $i_start = null, $i_end = null * $obj_redis->xRange('mystream', '-', '+', 2); *
*/ - public function xRange($str_stream, $i_start, $i_end, $i_count = null) {} + public function xRange($str_stream, $str_start, $str_end, $i_count = null) {} /** * Read data from one or more streams and only return IDs greater than sent in the command. @@ -3515,9 +3515,9 @@ public function xReadGroup($str_group, $str_consumer, $arr_streams, $i_count, $i /** * This is identical to xRange except the results come back in reverse order. Also note that Redis reverses the order of "start" and "end". * @param string $str_stream - * @param int|string $i_end - * @param int|string $i_start - * @param int|string $i_count + * @param string $str_end + * @param string $str_start + * @param int $i_count * @return array The messages in the range specified. * @link https://redis.io/commands/xrevrange * @example @@ -3525,7 +3525,7 @@ public function xReadGroup($str_group, $str_consumer, $arr_streams, $i_count, $i * $obj_redis->xRevRange('mystream', '+', '-'); *
*/ - public function xRevRange($str_stream, $i_end, $i_start, $i_count = null) {} + public function xRevRange($str_stream, $str_end, $str_start, $i_count = null) {} /** * Trim the stream length to a given maximum. If the "approximate" flag is pasesed, Redis will use your size as a hint but only trim trees in whole nodes (this is more efficient).. From 9b8058f8bdf467979e74bd553918720c3cf974bf Mon Sep 17 00:00:00 2001 From: Avtandil Kikabidze Date: Tue, 12 Feb 2019 14:22:06 +0400 Subject: [PATCH 67/97] Fix arguments count in RedisArray constructor According to https://github.com/phpredis/phpredis/blob/master/arrays.markdown#declaring-a-new-array-with-a-list-of-nodes --- src/Redis.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Redis.php b/src/Redis.php index 46f5661..808071d 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -3551,12 +3551,11 @@ class RedisArray { /** * Constructor * - * @param string $name Name of the redis array to create (required if using redis.ini to define array) - * @param array $hosts Array of hosts to construct the array with - * @param array $opts Array of options + * @param string|array $hosts Name of the redis array from redis.ini or array of hosts to construct the array with + * @param array $opts Array of options * @link https://github.com/nicolasff/phpredis/blob/master/arrays.markdown */ - function __construct($name = '', array $hosts = NULL, array $opts = NULL) {} + function __construct($hosts, array $opts = NULL) {} /** * @return array list of hosts for the selected array From 46aca489cdee2d49e4d7e1e05e39581b1c1875cb Mon Sep 17 00:00:00 2001 From: doodoori2 Date: Fri, 15 Feb 2019 12:41:27 +0900 Subject: [PATCH 68/97] Replace http with https in doc links --- src/Redis.php | 320 +++++++++++++++++++++++++------------------------- 1 file changed, 160 insertions(+), 160 deletions(-) diff --git a/src/Redis.php b/src/Redis.php index 808071d..4dad4b0 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -13,7 +13,7 @@ * (int/string), or an array. Arrays that are returned can also contain other arrays, if that's how it was set up in * your LUA script. If there is an error executing the LUA script, the getLastError() function can tell you the * message that came back from Redis (e.g. compile error). - * @link http://redis.io/commands/eval + * @link https://redis.io/commands/eval * @example *
  *  $redis->eval("return 1"); // Returns an integer: 1
@@ -202,7 +202,7 @@ public function getOption( $name ) {}
      * Check the current connection status
      *
      * @return  string STRING: +PONG on success. Throws a RedisException object on connectivity error, as described above.
-     * @link    http://redis.io/commands/ping
+     * @link    https://redis.io/commands/ping
      */
     public function ping( ) {}
 
@@ -211,7 +211,7 @@ public function ping( ) {}
      *
      * @param   string  $message
      * @return  string: Returns message.
-     * @link    http://redis.io/commands/echo
+     * @link    https://redis.io/commands/echo
      */
     public function echo( $message ) {}
 
@@ -220,7 +220,7 @@ public function echo( $message ) {}
      *
      * @param   string  $key
      * @return  string|bool: If key didn't exist, FALSE is returned. Otherwise, the value related to this key is returned.
-     * @link    http://redis.io/commands/get
+     * @link    https://redis.io/commands/get
      * @example $redis->get('key');
      */
     public function get( $key ) {}
@@ -251,7 +251,7 @@ public function get( $key ) {}
      *
      * @return  bool TRUE if the command is successful.
      *
-     * @link     http://redis.io/commands/set
+     * @link     https://redis.io/commands/set
      */
     public function set( $key, $value, $timeout = null ) {}
 
@@ -262,7 +262,7 @@ public function set( $key, $value, $timeout = null ) {}
      * @param   int     $ttl
      * @param   string  $value
      * @return  bool:   TRUE if the command is successful.
-     * @link    http://redis.io/commands/setex
+     * @link    https://redis.io/commands/setex
      * @example $redis->setex('key', 3600, 'value'); // sets key → value, with 1h TTL.
      */
     public function setex( $key, $ttl, $value ) {}
@@ -275,7 +275,7 @@ public function setex( $key, $ttl, $value ) {}
      * @param   int     $ttl, in milliseconds.
      * @param   string  $value
      * @return  bool:   TRUE if the command is successful.
-     * @link    http://redis.io/commands/psetex
+     * @link    https://redis.io/commands/psetex
      * @example $redis->psetex('key', 1000, 'value'); // sets key → value, with 1sec TTL.
      */
     public function psetex( $key, $ttl, $value ) {}
@@ -286,7 +286,7 @@ public function psetex( $key, $ttl, $value ) {}
      * @param   string  $key
      * @param   string  $value
      * @return  bool:   TRUE in case of success, FALSE in case of failure.
-     * @link    http://redis.io/commands/setnx
+     * @link    https://redis.io/commands/setnx
      * @example
      * 
      * $redis->setnx('key', 'value');   // return TRUE
@@ -302,7 +302,7 @@ public function setnx( $key, $value ) {}
      * @param   string      $key2 ...
      * @param   string      $key3 ...
      * @return int Number of keys deleted.
-     * @link    http://redis.io/commands/del
+     * @link    https://redis.io/commands/del
      * @example
      * 
      * $redis->set('key1', 'val1');
@@ -356,7 +356,7 @@ public function unlink( $key1, $key2 = null, $key3 = null ) {}
      * discard cancels a transaction.
      * @return Redis returns the Redis instance and enters multi-mode.
      * Once in multi-mode, all subsequent method calls return the same object until exec() is called.
-     * @link    http://redis.io/commands/multi
+     * @link    https://redis.io/commands/multi
      * @example
      * 
      * $ret = $redis->multi()
@@ -378,13 +378,13 @@ public function multi( $mode = Redis::MULTI ) {}
     /**
      * @see multi()
      * @return void|array
-     * @link    http://redis.io/commands/exec
+     * @link    https://redis.io/commands/exec
      */
     public function exec( ) {}
 
     /**
      * @see multi()
-     * @link    http://redis.io/commands/discard
+     * @link    https://redis.io/commands/discard
      */
     public function discard( ) {}
 
@@ -393,7 +393,7 @@ public function discard( ) {}
      * the MULTI/EXEC transaction will fail (return FALSE). unwatch cancels all the watching of all keys by this client.
      * @param string | array $key: a list of keys
      * @return void
-     * @link    http://redis.io/commands/watch
+     * @link    https://redis.io/commands/watch
      * @example
      * 
      * $redis->watch('x');
@@ -408,7 +408,7 @@ public function watch( $key ) {}
 
     /**
      * @see watch()
-     * @link    http://redis.io/commands/unwatch
+     * @link    https://redis.io/commands/unwatch
      */
     public function unwatch( ) {}
 
@@ -419,7 +419,7 @@ public function unwatch( ) {}
      * @param string | array    $callback either a string or an array($instance, 'method_name').
      * The callback function receives 3 parameters: the redis instance, the channel name, and the message.
      * @return mixed            Any non-null return value in the callback will be returned to the caller.
-     * @link    http://redis.io/commands/subscribe
+     * @link    https://redis.io/commands/subscribe
      * @example
      * 
      * function f($redis, $chan, $msg) {
@@ -450,7 +450,7 @@ public function subscribe( $channels, $callback ) {}
      * @param   string|array    $callback   Either a string or an array with an object and method.
      *                          The callback will get four arguments ($redis, $pattern, $channel, $message)
      * @param   mixed           Any non-null return value in the callback will be returned to the caller.
-     * @link    http://redis.io/commands/psubscribe
+     * @link    https://redis.io/commands/psubscribe
      * @example
      * 
      * function psubscribe($redis, $pattern, $chan, $msg) {
@@ -467,7 +467,7 @@ public function psubscribe( $patterns, $callback ) {}
      *
      * @param   string $channel a channel to publish to
      * @param   string $message string
-     * @link    http://redis.io/commands/publish
+     * @link    https://redis.io/commands/publish
      * @return  int Number of clients that received the message
      * @example $redis->publish('chan-1', 'hello, world!'); // send message.
      */
@@ -484,7 +484,7 @@ public function publish( $channel, $message ) {}
      *                          - numsub    Returns a key/value array where the keys are channel names and
      *                                      values are their counts.
      *                          - numpat    Integer return containing the number active pattern subscriptions.
-     * @link    http://redis.io/commands/pubsub
+     * @link    https://redis.io/commands/pubsub
      * @example
      * 
      * $redis->pubsub('channels'); // All channels
@@ -499,7 +499,7 @@ public function pubsub( $keyword, $argument ) {}
      * Stop listening for messages posted to the given channels.
      *
      * @param   array             $channels an array of channels to usubscribe
-     * @link    http://redis.io/commands/unsubscribe
+     * @link    https://redis.io/commands/unsubscribe
      */
     public function unsubscribe( $channels = null ) {}
 
@@ -507,7 +507,7 @@ public function unsubscribe( $channels = null ) {}
      * Stop listening for messages posted to the given channels.
      *
      * @param   array           $patterns   an array of glob-style patterns to unsubscribe
-     * @link    http://redis.io/commands/punsubscribe
+     * @link    https://redis.io/commands/punsubscribe
      */
     public function punsubscribe( $patterns = null ) {}
 
@@ -516,7 +516,7 @@ public function punsubscribe( $patterns = null ) {}
      *
      * @param   string $key
      * @return  bool: If the key exists, return TRUE, otherwise return FALSE.
-     * @link    http://redis.io/commands/exists
+     * @link    https://redis.io/commands/exists
      * @example
      * 
      * $redis->set('key', 'value');
@@ -531,7 +531,7 @@ public function exists( $key ) {}
      *
      * @param   string $key
      * @return  int    the new value
-     * @link    http://redis.io/commands/incr
+     * @link    https://redis.io/commands/incr
      * @example
      * 
      * $redis->incr('key1'); // key1 didn't exists, set to 0 before the increment and now has the value 1
@@ -548,7 +548,7 @@ public function incr( $key ) {}
      * @param   string  $key
      * @param   float   $increment
      * @return  float
-     * @link    http://redis.io/commands/incrbyfloat
+     * @link    https://redis.io/commands/incrbyfloat
      * @example
      * 
      * $redis = new Redis();
@@ -569,7 +569,7 @@ public function incrByFloat( $key, $increment ) {}
      * @param   string    $key    key
      * @param   int       $value  value that will be added to key (only for incrBy)
      * @return  int         the new value
-     * @link    http://redis.io/commands/incrby
+     * @link    https://redis.io/commands/incrby
      * @example
      * 
      * $redis->incr('key1');        // key1 didn't exists, set to 0 before the increment and now has the value 1
@@ -586,7 +586,7 @@ public function incrBy( $key, $value ) {}
      *
      * @param   string $key
      * @return  int    the new value
-     * @link    http://redis.io/commands/decr
+     * @link    https://redis.io/commands/decr
      * @example
      * 
      * $redis->decr('key1'); // key1 didn't exists, set to 0 before the increment and now has the value -1
@@ -603,7 +603,7 @@ public function decr( $key ) {}
      * @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
+     * @link    https://redis.io/commands/decrby
      * @example
      * 
      * $redis->decr('key1');        // key1 didn't exists, set to 0 before the increment and now has the value -1
@@ -640,7 +640,7 @@ public function getMultiple( array $keys ) {}
      * @param   string $value2  Optional
      * @param   string $valueN  Optional
      * @return  int    The new length of the list in case of success, FALSE in case of Failure.
-     * @link    http://redis.io/commands/lpush
+     * @link    https://redis.io/commands/lpush
      * @example
      * 
      * $redis->lPush('l', 'v1', 'v2', 'v3', 'v4')   // int(4)
@@ -665,7 +665,7 @@ public function lPush( $key, $value1, $value2 = null, $valueN = null ) {}
      * @param   string  $value2 Optional
      * @param   string  $valueN Optional
      * @return  int     The new length of the list in case of success, FALSE in case of Failure.
-     * @link    http://redis.io/commands/rpush
+     * @link    https://redis.io/commands/rpush
      * @example
      * 
      * $redis->rPush('l', 'v1', 'v2', 'v3', 'v4');    // int(4)
@@ -687,7 +687,7 @@ public function rPush( $key, $value1, $value2 = null, $valueN = null ) {}
      * @param   string  $key
      * @param   string  $value String, value to push in key
      * @return  int     The new length of the list in case of success, FALSE in case of Failure.
-     * @link    http://redis.io/commands/lpushx
+     * @link    https://redis.io/commands/lpushx
      * @example
      * 
      * $redis->delete('key1');
@@ -706,7 +706,7 @@ public function lPushx( $key, $value ) {}
      * @param   string  $key
      * @param   string  $value String, value to push in key
      * @return  int     The new length of the list in case of success, FALSE in case of Failure.
-     * @link    http://redis.io/commands/rpushx
+     * @link    https://redis.io/commands/rpushx
      * @example
      * 
      * $redis->delete('key1');
@@ -724,7 +724,7 @@ public function rPushx( $key, $value ) {}
      *
      * @param   string $key
      * @return  string if command executed successfully BOOL FALSE in case of failure (empty list)
-     * @link    http://redis.io/commands/lpop
+     * @link    https://redis.io/commands/lpop
      * @example
      * 
      * $redis->rPush('key1', 'A');
@@ -740,7 +740,7 @@ public function lPop( $key ) {}
      *
      * @param   string $key
      * @return  string if command executed successfully BOOL FALSE in case of failure (empty list)
-     * @link    http://redis.io/commands/rpop
+     * @link    https://redis.io/commands/rpop
      * @example
      * 
      * $redis->rPush('key1', 'A');
@@ -762,7 +762,7 @@ public function rPop( $key ) {}
      * @param int   $timeout Timeout
      *
      * @return  array array('listName', 'element')
-     * @link    http://redis.io/commands/blpop
+     * @link    https://redis.io/commands/blpop
      * @example
      * 
      * // Non blocking feature
@@ -804,7 +804,7 @@ public function blPop( array $keys, $timeout) {}
      * Or STRING Key1 STRING Key2 STRING Key3 ... STRING Keyn
      * @param int   $timeout Timeout
      * @return  array array('listName', 'element')
-     * @link    http://redis.io/commands/brpop
+     * @link    https://redis.io/commands/brpop
      * @example
      * 
      * // Non blocking feature
@@ -843,7 +843,7 @@ public function brPop( array $keys, $timeout ) {}
      * @param   string  $key
      * @return  int     The size of the list identified by Key exists.
      * bool FALSE if the data type identified by Key is not list
-     * @link    http://redis.io/commands/llen
+     * @link    https://redis.io/commands/llen
      * @example
      * 
      * $redis->rPush('key1', 'A');
@@ -859,7 +859,7 @@ public function lLen( $key ) {}
     /**
      * @see     lLen()
      * @param   string    $key
-     * @link    http://redis.io/commands/llen
+     * @link    https://redis.io/commands/llen
      */
     public function lSize( $key ) {}
 
@@ -872,7 +872,7 @@ public function lSize( $key ) {}
      * @param int       $index
      * @return String the element at this index
      * Bool FALSE if the key identifies a non-string data type, or no value corresponds to this index in the list Key.
-     * @link    http://redis.io/commands/lindex
+     * @link    https://redis.io/commands/lindex
      * @example
      * 
      * $redis->rPush('key1', 'A');
@@ -889,7 +889,7 @@ public function lIndex( $key, $index ) {}
      * @see lIndex()
      * @param   string    $key
      * @param   int       $index
-     * @link    http://redis.io/commands/lindex
+     * @link    https://redis.io/commands/lindex
      */
     public function lGet( $key, $index ) {}
 
@@ -902,7 +902,7 @@ public function lGet( $key, $index ) {}
      * @param string    $value
      * @return BOOL TRUE if the new value is setted. FALSE if the index is out of range, or data type identified by key
      * is not a list.
-     * @link    http://redis.io/commands/lset
+     * @link    https://redis.io/commands/lset
      * @example
      * 
      * $redis->rPush('key1', 'A');
@@ -924,7 +924,7 @@ public function lSet( $key, $index, $value ) {}
      * @param   int     $start
      * @param   int     $end
      * @return  array containing the values in specified range.
-     * @link    http://redis.io/commands/lrange
+     * @link    https://redis.io/commands/lrange
      * @example
      * 
      * $redis->rPush('key1', 'A');
@@ -937,7 +937,7 @@ public function lRange( $key, $start, $end ) {}
 
     /**
      * @see lRange()
-     * @link http://redis.io/commands/lrange
+     * @link https://redis.io/commands/lrange
      * @param string    $key
      * @param int       $start
      * @param int       $end
@@ -952,7 +952,7 @@ public function lGetRange( $key, $start, $end ) {}
      * @param int       $start
      * @param int       $stop
      * @return array    Bool return FALSE if the key identify a non-list value.
-     * @link        http://redis.io/commands/ltrim
+     * @link        https://redis.io/commands/ltrim
      * @example
      * 
      * $redis->rPush('key1', 'A');
@@ -967,7 +967,7 @@ public function lTrim( $key, $start, $stop ) {}
 
     /**
      * @see lTrim()
-     * @link  http://redis.io/commands/ltrim
+     * @link  https://redis.io/commands/ltrim
      * @param string    $key
      * @param int       $start
      * @param int       $stop
@@ -985,7 +985,7 @@ public function listTrim( $key, $start, $stop ) {}
      * @param   int     $count
      * @return  int     the number of elements to remove
      * bool FALSE if the value identified by key is not a list.
-     * @link    http://redis.io/commands/lrem
+     * @link    https://redis.io/commands/lrem
      * @example
      * 
      * $redis->lPush('key1', 'A');
@@ -1003,7 +1003,7 @@ public function lRem( $key, $value, $count ) {}
 
     /**
      * @see lRem
-     * @link    http://redis.io/commands/lremove
+     * @link    https://redis.io/commands/lremove
      * @param string    $key
      * @param string    $value
      * @param int       $count
@@ -1021,7 +1021,7 @@ public function lRemove( $key, $value, $count ) {}
      * @param   string  $pivot
      * @param   string  $value
      * @return  int     The number of the elements in the list, -1 if the pivot didn't exists.
-     * @link    http://redis.io/commands/linsert
+     * @link    https://redis.io/commands/linsert
      * @example
      * 
      * $redis->delete('key1');
@@ -1052,7 +1052,7 @@ public function lInsert( $key, $position, $pivot, $value ) {}
      * @param   string  $value2     Optional value
      * @param   string  $valueN     Optional value
      * @return  int     The number of elements added to the set
-     * @link    http://redis.io/commands/sadd
+     * @link    https://redis.io/commands/sadd
      * @example
      * 
      * $redis->sAdd('k', 'v1');                // int(1)
@@ -1070,7 +1070,7 @@ public function sAdd( $key, $value1, $value2 = null, $valueN = null ) {}
      * @param   string  $member2
      * @param   string  $memberN
      * @return  int     The number of elements removed from the set.
-     * @link    http://redis.io/commands/srem
+     * @link    https://redis.io/commands/srem
      * @example
      * 
      * var_dump( $redis->sAdd('k', 'v1', 'v2', 'v3') );    // int(3)
@@ -1086,7 +1086,7 @@ public function sRem( $key, $member1, $member2 = null, $memberN = null ) {}
 
     /**
      * @see sRem()
-     * @link    http://redis.io/commands/srem
+     * @link    https://redis.io/commands/srem
      * @param   string  $key
      * @param   string  $member1
      * @param   string  $member2
@@ -1103,7 +1103,7 @@ public function sRemove( $key, $member1, $member2 = null, $memberN = null ) {}
      * @param   string  $member
      * @return  bool    If the operation is successful, return TRUE.
      * If the srcKey and/or dstKey didn't exist, and/or the member didn't exist in srcKey, FALSE is returned.
-     * @link    http://redis.io/commands/smove
+     * @link    https://redis.io/commands/smove
      * @example
      * 
      * $redis->sAdd('key1' , 'set11');
@@ -1124,7 +1124,7 @@ public function sMove( $srcKey, $dstKey, $member ) {}
      * @param   string  $key
      * @param   string  $value
      * @return  bool    TRUE if value is a member of the set at key key, FALSE otherwise.
-     * @link    http://redis.io/commands/sismember
+     * @link    https://redis.io/commands/sismember
      * @example
      * 
      * $redis->sAdd('key1' , 'set1');
@@ -1139,7 +1139,7 @@ public function sIsMember( $key, $value ) {}
 
     /**
      * @see sIsMember()
-     * @link    http://redis.io/commands/sismember
+     * @link    https://redis.io/commands/sismember
      * @param   string  $key
      * @param   string  $value
      */
@@ -1150,7 +1150,7 @@ public function sContains( $key, $value ) {}
      *
      * @param   string  $key
      * @return  int     the cardinality of the set identified by key, 0 if the set doesn't exist.
-     * @link    http://redis.io/commands/scard
+     * @link    https://redis.io/commands/scard
      * @example
      * 
      * $redis->sAdd('key1' , 'set1');
@@ -1169,7 +1169,7 @@ public function sCard( $key ) {}
      * @param   string  $key
      * @return  string  "popped" value
      * bool FALSE if set identified by key is empty or doesn't exist.
-     * @link    http://redis.io/commands/spop
+     * @link    https://redis.io/commands/spop
      * @example
      * 
      * $redis->sAdd('key1' , 'set1');
@@ -1189,7 +1189,7 @@ public function sPop( $key ) {}
      * @param   int           $count [optional]
      * @return  string|array  value(s) from the set
      * bool FALSE if set identified by key is empty or doesn't exist and count argument isn't passed.
-     * @link    http://redis.io/commands/srandmember
+     * @link    https://redis.io/commands/srandmember
      * @example
      * 
      * $redis->sAdd('key1' , 'one');
@@ -1220,7 +1220,7 @@ public function sRandMember( $key, $count = null ) {}
      * @param   string  $keyN  ...
      * @return  array, contain the result of the intersection between those keys.
      * If the intersection between the different sets is empty, the return value will be empty array.
-     * @link    http://redis.io/commands/sinterstore
+     * @link    https://redis.io/commands/sinterstore
      * @example
      * 
      * $redis->sAdd('key1', 'val1');
@@ -1254,7 +1254,7 @@ public function sInter( $key1, $key2, $keyN = null ) {}
      * @param   string  $key2 ...
      * @param   string  $keyN ...
      * @return  int:    The cardinality of the resulting set, or FALSE in case of a missing key.
-     * @link    http://redis.io/commands/sinterstore
+     * @link    https://redis.io/commands/sinterstore
      * @example
      * 
      * $redis->sAdd('key1', 'val1');
@@ -1290,7 +1290,7 @@ public function sInterStore( $dstKey, $key1, $key2, $keyN = null ) {}
      * @param   string  $key2 ...
      * @param   string  $keyN ...
      * @return  array   of strings: The union of all these sets.
-     * @link    http://redis.io/commands/sunionstore
+     * @link    https://redis.io/commands/sunionstore
      * @example
      * 
      * $redis->delete('s0', 's1', 's2');
@@ -1326,7 +1326,7 @@ public function sUnion( $key1, $key2, $keyN = null ) {}
      * @param   string  $key2    ...
      * @param   string  $keyN    ...
      * @return  int     Any number of keys corresponding to sets in redis.
-     * @link    http://redis.io/commands/sunionstore
+     * @link    https://redis.io/commands/sunionstore
      * @example
      * 
      * $redis->delete('s0', 's1', 's2');
@@ -1363,7 +1363,7 @@ public function sUnionStore( $dstKey, $key1, $key2, $keyN = null ) {}
      * @param   string  $key2 ...
      * @param   string  $keyN ...
      * @return  array   of strings: The difference of the first set will all the others.
-     * @link    http://redis.io/commands/sdiff
+     * @link    https://redis.io/commands/sdiff
      * @example
      * 
      * $redis->delete('s0', 's1', 's2');
@@ -1396,7 +1396,7 @@ public function sDiff( $key1, $key2, $keyN = null ) {}
      * @param   string  $key2      ...
      * @param   string  $keyN      ...
      * @return  int:    The cardinality of the resulting set, or FALSE in case of a missing key.
-     * @link    http://redis.io/commands/sdiffstore
+     * @link    https://redis.io/commands/sdiffstore
      * @example
      * 
      * $redis->delete('s0', 's1', 's2');
@@ -1428,7 +1428,7 @@ public function sDiffStore( $dstKey, $key1, $key2, $keyN = null ) {}
      *
      * @param   string  $key
      * @return  array   An array of elements, the contents of the set.
-     * @link    http://redis.io/commands/smembers
+     * @link    https://redis.io/commands/smembers
      * @example
      * 
      * $redis->delete('s');
@@ -1455,7 +1455,7 @@ public function sMembers( $key ) {}
      * @see sMembers()
      * @return  array   An array of elements, the contents of the set.
      * @param   string  $key
-     * @link    http://redis.io/commands/smembers
+     * @link    https://redis.io/commands/smembers
      */
     public function sGetMembers( $key ) {}
 
@@ -1466,7 +1466,7 @@ public function sGetMembers( $key ) {}
      * @param   null    $pattern    String, optional pattern to match against.
      * @param   int     $count      How many members to return at a time (Redis might return a different amount).
      * @return  array   PHPRedis will return an array of keys or FALSE when we're done iterating.
-     * @link    http://redis.io/commands/sscan
+     * @link    https://redis.io/commands/sscan
      * @example
      * 
      * $iterator = null;
@@ -1485,7 +1485,7 @@ public function sScan( $key, &$iterator, $pattern = null, $count = 0 ) {}
      * @param   string  $key
      * @param   string  $value
      * @return  string  A string, the previous value located at this key.
-     * @link    http://redis.io/commands/getset
+     * @link    https://redis.io/commands/getset
      * @example
      * 
      * $redis->set('x', '42');
@@ -1499,7 +1499,7 @@ public function getSet( $key, $value ) {}
      * Returns a random key.
      *
      * @return string: an existing key in redis.
-     * @link    http://redis.io/commands/randomkey
+     * @link    https://redis.io/commands/randomkey
      * @example
      * 
      * $key = $redis->randomKey();
@@ -1514,7 +1514,7 @@ public function randomKey( ) {}
      *
      * @param   int     $dbindex
      * @return  bool    TRUE in case of success, FALSE in case of failure.
-     * @link    http://redis.io/commands/select
+     * @link    https://redis.io/commands/select
      * @example
      * 
      * $redis->select(0);       // switch to DB 0
@@ -1532,7 +1532,7 @@ public function select( $dbindex ) {}
      * @param   string  $key
      * @param   int     $dbindex
      * @return  bool:   TRUE in case of success, FALSE in case of failure.
-     * @link    http://redis.io/commands/move
+     * @link    https://redis.io/commands/move
      * @example
      * 
      * $redis->select(0);       // switch to DB 0
@@ -1550,7 +1550,7 @@ public function move( $key, $dbindex ) {}
      * @param   string  $srcKey
      * @param   string  $dstKey
      * @return  bool:   TRUE in case of success, FALSE in case of failure.
-     * @link    http://redis.io/commands/rename
+     * @link    https://redis.io/commands/rename
      * @example
      * 
      * $redis->set('x', '42');
@@ -1563,7 +1563,7 @@ public function rename( $srcKey, $dstKey ) {}
 
     /**
      * @see rename()
-     * @link    http://redis.io/commands/rename
+     * @link    https://redis.io/commands/rename
      * @param   string  $srcKey
      * @param   string  $dstKey
      */
@@ -1578,7 +1578,7 @@ public function renameKey( $srcKey, $dstKey ) {}
      * @param   string  $srcKey
      * @param   string  $dstKey
      * @return  bool:   TRUE in case of success, FALSE in case of failure.
-     * @link    http://redis.io/commands/renamenx
+     * @link    https://redis.io/commands/renamenx
      * @example
      * 
      * $redis->set('x', '42');
@@ -1595,7 +1595,7 @@ public function renameNx( $srcKey, $dstKey ) {}
      * @param   string  $key    The key that will disappear.
      * @param   int     $ttl    The key's remaining Time To Live, in seconds.
      * @return  bool:   TRUE in case of success, FALSE in case of failure.
-     * @link    http://redis.io/commands/expire
+     * @link    https://redis.io/commands/expire
      * @example
      * 
      * $redis->set('x', '42');
@@ -1612,7 +1612,7 @@ public function expire( $key, $ttl ) {}
      * @param   string  $key    The key that will disappear.
      * @param   int     $ttl   The key's remaining Time To Live, in milliseconds.
      * @return  bool:   TRUE in case of success, FALSE in case of failure.
-     * @link    http://redis.io/commands/pexpire
+     * @link    https://redis.io/commands/pexpire
      * @example
      * 
      * $redis->set('x', '42');
@@ -1627,7 +1627,7 @@ public function pExpire( $key, $ttl ) {}
      * @see expire()
      * @param   string  $key
      * @param   int     $ttl
-     * @link    http://redis.io/commands/expire
+     * @link    https://redis.io/commands/expire
      */
     public function setTimeout( $key, $ttl ) {}
 
@@ -1637,7 +1637,7 @@ public function setTimeout( $key, $ttl ) {}
      * @param   string  $key        The key that will disappear.
      * @param   int     $timestamp  Unix timestamp. The key's date of death, in seconds from Epoch time.
      * @return  bool:   TRUE in case of success, FALSE in case of failure.
-     * @link    http://redis.io/commands/expireat
+     * @link    https://redis.io/commands/expireat
      * @example
      * 
      * $redis->set('x', '42');
@@ -1655,7 +1655,7 @@ public function expireAt( $key, $timestamp ) {}
      * @param   string  $key        The key that will disappear.
      * @param   int     $timestamp  Unix timestamp. The key's date of death, in seconds from Epoch time.
      * @return  bool:   TRUE in case of success, FALSE in case of failure.
-     * @link    http://redis.io/commands/pexpireat
+     * @link    https://redis.io/commands/pexpireat
      * @example
      * 
      * $redis->set('x', '42');
@@ -1671,7 +1671,7 @@ public function pExpireAt( $key, $timestamp ) {}
      *
      * @param   string  $pattern pattern, using '*' as a wildcard.
      * @return  array   of STRING: The keys that match a certain pattern.
-     * @link    http://redis.io/commands/keys
+     * @link    https://redis.io/commands/keys
      * @example
      * 
      * $allKeys = $redis->keys('*');   // all keys will match this.
@@ -1683,7 +1683,7 @@ public function keys( $pattern ) {}
     /**
      * @see keys()
      * @param   string  $pattern
-     * @link    http://redis.io/commands/keys
+     * @link    https://redis.io/commands/keys
      */
     public function getKeys( $pattern ) {}
 
@@ -1691,7 +1691,7 @@ public function getKeys( $pattern ) {}
      * Returns the current database's size.
      *
      * @return int:     DB size, in number of keys.
-     * @link    http://redis.io/commands/dbsize
+     * @link    https://redis.io/commands/dbsize
      * @example
      * 
      * $count = $redis->dbSize();
@@ -1706,7 +1706,7 @@ public function dbSize( ) {}
      *
      * @param   string  $password
      * @return  bool:   TRUE if the connection is authenticated, FALSE otherwise.
-     * @link    http://redis.io/commands/auth
+     * @link    https://redis.io/commands/auth
      * @example $redis->auth('foobared');
      */
     public function auth( $password ) {}
@@ -1715,7 +1715,7 @@ public function auth( $password ) {}
      * Starts the background rewrite of AOF (Append-Only File)
      *
      * @return  bool:   TRUE in case of success, FALSE in case of failure.
-     * @link    http://redis.io/commands/bgrewriteaof
+     * @link    https://redis.io/commands/bgrewriteaof
      * @example $redis->bgrewriteaof();
      */
     public function bgrewriteaof( ) {}
@@ -1727,7 +1727,7 @@ public function bgrewriteaof( ) {}
      * @param   string  $host [optional]
      * @param   int $port [optional]
      * @return  bool:   TRUE in case of success, FALSE in case of failure.
-     * @link    http://redis.io/commands/slaveof
+     * @link    https://redis.io/commands/slaveof
      * @example
      * 
      * $redis->slaveof('10.0.1.7', 6379);
@@ -1748,7 +1748,7 @@ public function slaveof( $host = '127.0.0.1', $port = 6379 ) {}
      * @param   string  $string
      * @param   string  $key
      * @return  string  for "encoding", int for "refcount" and "idletime", FALSE if the key doesn't exist.
-     * @link    http://redis.io/commands/object
+     * @link    https://redis.io/commands/object
      * @example
      * 
      * $redis->object("encoding", "l"); // → ziplist
@@ -1763,7 +1763,7 @@ public function object( $string = '', $key = '' ) {}
      *
      * @return  bool:   TRUE in case of success, FALSE in case of failure.
      * If a save is already running, this command will fail and return FALSE.
-     * @link    http://redis.io/commands/save
+     * @link    https://redis.io/commands/save
      * @example $redis->save();
      */
     public function save( ) {}
@@ -1773,7 +1773,7 @@ public function save( ) {}
      *
      * @return  bool:    TRUE in case of success, FALSE in case of failure.
      * If a save is already running, this command will fail and return FALSE.
-     * @link    http://redis.io/commands/bgsave
+     * @link    https://redis.io/commands/bgsave
      * @example $redis->bgSave();
      */
     public function bgsave( ) {}
@@ -1782,7 +1782,7 @@ public function bgsave( ) {}
      * Returns the timestamp of the last disk save.
      *
      * @return  int:    timestamp.
-     * @link    http://redis.io/commands/lastsave
+     * @link    https://redis.io/commands/lastsave
      * @example $redis->lastSave();
      */
     public function lastSave( ) {}
@@ -1794,7 +1794,7 @@ public function lastSave( ) {}
      * @param   int $timeout    Timeout in milliseconds.
      * @return  int The command returns the number of slaves reached by all the writes performed in the
      *              context of the current connection.
-     * @link    http://redis.io/commands/wait
+     * @link    https://redis.io/commands/wait
      * @example $redis->wait(2, 1000);
      */
     public function wait( $numSlaves, $timeout ) {}
@@ -1813,7 +1813,7 @@ public function wait( $numSlaves, $timeout ) {}
      * - zset:  Redis::REDIS_ZSET
      * - hash:  Redis::REDIS_HASH
      * - other: Redis::REDIS_NOT_FOUND
-     * @link    http://redis.io/commands/type
+     * @link    https://redis.io/commands/type
      * @example $redis->type('key');
      */
     public function type( $key ) {}
@@ -1824,7 +1824,7 @@ public function type( $key ) {}
      * @param   string  $key
      * @param   string  $value
      * @return  int:    Size of the value after the append
-     * @link    http://redis.io/commands/append
+     * @link    https://redis.io/commands/append
      * @example
      * 
      * $redis->set('key', 'value1');
@@ -1842,7 +1842,7 @@ public function append( $key, $value ) {}
      * @param   int     $start
      * @param   int     $end
      * @return  string: the substring
-     * @link    http://redis.io/commands/getrange
+     * @link    https://redis.io/commands/getrange
      * @example
      * 
      * $redis->set('key', 'string value');
@@ -1870,7 +1870,7 @@ public function substr( $key, $start, $end ) {}
      * @param   int     $offset
      * @param   string  $value
      * @return  string: the length of the string after it was modified.
-     * @link    http://redis.io/commands/setrange
+     * @link    https://redis.io/commands/setrange
      * @example
      * 
      * $redis->set('key', 'Hello world');
@@ -1885,7 +1885,7 @@ public function setRange( $key, $offset, $value ) {}
      *
      * @param   string  $key
      * @return  int
-     * @link    http://redis.io/commands/strlen
+     * @link    https://redis.io/commands/strlen
      * @example
      * 
      * $redis->set('key', 'value');
@@ -1912,7 +1912,7 @@ public function strlen( $key ) {}
      *                  start argument only. However, this behavior changes if you are looking for clear bits and
      *                  specify a range with both start and end. If no clear bit is found in the specified range, the
      *                  function returns -1 as the user specified a clear range and there are no 0 bits in that range.
-     * @link    http://redis.io/commands/bitpos
+     * @link    https://redis.io/commands/bitpos
      * @example
      * 
      * $redis->set('key', '\xff\xff');
@@ -1932,7 +1932,7 @@ public function bitpos( $key, $bit, $start = 0, $end = null) {}
      * @param   string  $key
      * @param   int     $offset
      * @return  int:    the bit value (0 or 1)
-     * @link    http://redis.io/commands/getbit
+     * @link    https://redis.io/commands/getbit
      * @example
      * 
      * $redis->set('key', "\x7f");  // this is 0111 1111
@@ -1949,7 +1949,7 @@ public function getBit( $key, $offset ) {}
      * @param   int     $offset
      * @param   bool|int $value bool or int (1 or 0)
      * @return  int:    0 or 1, the value of the bit before it was set.
-     * @link    http://redis.io/commands/setbit
+     * @link    https://redis.io/commands/setbit
      * @example
      * 
      * $redis->set('key', "*");     // ord("*") = 42 = 0x2f = "0010 1010"
@@ -1965,7 +1965,7 @@ public function setBit( $key, $offset, $value ) {}
      *
      * @param   string  $key
      * @return  int     The number of bits set to 1 in the value behind the input key.
-     * @link    http://redis.io/commands/bitcount
+     * @link    https://redis.io/commands/bitcount
      * @example
      * 
      * $redis->set('bit', '345'); // // 11 0011  0011 0100  0011 0101
@@ -1986,7 +1986,7 @@ public function bitCount( $key ) {}
      * @param   string  $key2
      * @param   string  $key3
      * @return  int     The size of the string stored in the destination key.
-     * @link    http://redis.io/commands/bitop
+     * @link    https://redis.io/commands/bitop
      * @example
      * 
      * $redis->set('bit1', '1'); // 11 0001
@@ -2004,7 +2004,7 @@ public function bitOp( $operation, $retKey, $key1, $key2, $key3 = null ) {}
      * Removes all entries from the current database.
      *
      * @return  bool: Always TRUE.
-     * @link    http://redis.io/commands/flushdb
+     * @link    https://redis.io/commands/flushdb
      * @example $redis->flushDB();
      */
     public function flushDB( ) {}
@@ -2013,7 +2013,7 @@ public function flushDB( ) {}
      * Removes all entries from all databases.
      *
      * @return  bool: Always TRUE.
-     * @link    http://redis.io/commands/flushall
+     * @link    https://redis.io/commands/flushall
      * @example $redis->flushAll();
      */
     public function flushAll( ) {}
@@ -2031,7 +2031,7 @@ public function flushAll( ) {}
      * - 'store' => 'external-key'
      * @return  array
      * An array of values, or a number corresponding to the number of elements stored if that was used.
-     * @link    http://redis.io/commands/sort
+     * @link    https://redis.io/commands/sort
      * @example
      * 
      * $redis->delete('s');
@@ -2097,7 +2097,7 @@ public function sort( $key, $option = null ) {}
      * - latest_fork_usec
      * - vm_enabled
      * - role
-     * @link    http://redis.io/commands/info
+     * @link    https://redis.io/commands/info
      * @return string
      * @example
      * 
@@ -2122,7 +2122,7 @@ public function info( $option = null ) {}
      *
      * @return bool: `TRUE` in case of success, `FALSE` in case of failure.
      * @example $redis->resetStat();
-     * @link http://redis.io/commands/config-resetstat
+     * @link https://redis.io/commands/config-resetstat
      */
     public function resetStat( ) {}
 
@@ -2131,7 +2131,7 @@ public function resetStat( ) {}
      *
      * @param   string  $key
      * @return  int,    the time left to live in seconds.
-     * @link    http://redis.io/commands/ttl
+     * @link    https://redis.io/commands/ttl
      * @example $redis->ttl('key');
      */
     public function ttl( $key ) {}
@@ -2143,7 +2143,7 @@ public function ttl( $key ) {}
      *
      * @param   string  $key
      * @return  int     the time left to live in milliseconds.
-     * @link    http://redis.io/commands/pttl
+     * @link    https://redis.io/commands/pttl
      * @example $redis->pttl('key');
      */
     public function pttl( $key ) {}
@@ -2153,7 +2153,7 @@ public function pttl( $key ) {}
      *
      * @param   string  $key
      * @return  bool:   TRUE if a timeout was removed, FALSE if the key didn’t exist or didn’t have an expiration timer.
-     * @link    http://redis.io/commands/persist
+     * @link    https://redis.io/commands/persist
      * @example $redis->persist('key');
      */
     public function persist( $key ) {}
@@ -2164,7 +2164,7 @@ public function persist( $key ) {}
      *
      * @param   array(key => value) $array Pairs: array(key => value, ...)
      * @return  bool    TRUE in case of success, FALSE in case of failure.
-     * @link    http://redis.io/commands/mset
+     * @link    https://redis.io/commands/mset
      * @example
      * 
      * $redis->mset(array('key0' => 'value0', 'key1' => 'value1'));
@@ -2186,7 +2186,7 @@ public function mset( array $array ) {}
      *
      * @param array $array
      * @return array
-     * @link http://redis.io/commands/mget
+     * @link https://redis.io/commands/mget
      * @example
      * 
      * $redis->delete('x', 'y', 'z', 'h');	// remove x y z
@@ -2212,7 +2212,7 @@ public function mget( array $array ) {}
      * @see mset()
      * @param   array $array
      * @return  int 1 (if the keys were set) or 0 (no key was set)
-     * @link    http://redis.io/commands/msetnx
+     * @link    https://redis.io/commands/msetnx
      */
     public function msetnx( array $array ) {}
 
@@ -2224,7 +2224,7 @@ public function msetnx( array $array ) {}
      * @param   string  $srcKey
      * @param   string  $dstKey
      * @return  string  The element that was moved in case of success, FALSE in case of failure.
-     * @link    http://redis.io/commands/rpoplpush
+     * @link    https://redis.io/commands/rpoplpush
      * @example
      * 
      * $redis->delete('x', 'y');
@@ -2265,7 +2265,7 @@ public function rpoplpush( $srcKey, $dstKey ) {}
      * @param   string  $dstKey
      * @param   int     $timeout
      * @return  string  The element that was moved in case of success, FALSE in case of timeout.
-     * @link    http://redis.io/commands/brpoplpush
+     * @link    https://redis.io/commands/brpoplpush
      */
     public function brpoplpush( $srcKey, $dstKey, $timeout ) {}
 
@@ -2280,7 +2280,7 @@ public function brpoplpush( $srcKey, $dstKey, $timeout ) {}
      * @param   float   $scoreN Optional score
      * @param   string  $valueN Optional value
      * @return  int     Number of values added
-     * @link    http://redis.io/commands/zadd
+     * @link    https://redis.io/commands/zadd
      * @example
      * 
      * 
@@ -2310,7 +2310,7 @@ public function zAdd( $key, $score1, $value1, $score2 = null, $value2 = null, $s
      * @param   int     $end
      * @param   bool    $withscores
      * @return  array   Array containing the values in specified range.
-     * @link    http://redis.io/commands/zrange
+     * @link    https://redis.io/commands/zrange
      * @example
      * 
      * $redis->zAdd('key1', 0, 'val0');
@@ -2331,7 +2331,7 @@ public function zRange( $key, $start, $end, $withscores = null ) {}
      * @param   string  $member2
      * @param   string  $memberN
      * @return  int     Number of deleted values
-     * @link    http://redis.io/commands/zrem
+     * @link    https://redis.io/commands/zrem
      * @example
      * 
      * $redis->zAdd('z', 1, 'v2', 2, 'v2', 3, 'v3', 4, 'v4' );  // int(2)
@@ -2353,7 +2353,7 @@ public function zRem( $key, $member1, $member2 = null, $memberN = null ) {}
      * @param   string  $member2
      * @param   string  $memberN
      * @return  int     Number of deleted values
-     * @link    http://redis.io/commands/zrem
+     * @link    https://redis.io/commands/zrem
      */
     public function zDelete( $key, $member1, $member2 = null, $memberN = null ) {}
 
@@ -2370,7 +2370,7 @@ public function zDelete( $key, $member1, $member2 = null, $memberN = null ) {}
      * @param   int     $end
      * @param   bool    $withscore
      * @return  array   Array containing the values in specified range.
-     * @link    http://redis.io/commands/zrevrange
+     * @link    https://redis.io/commands/zrevrange
      * @example
      * 
      * $redis->zAdd('key', 0, 'val0');
@@ -2398,7 +2398,7 @@ public function zRevRange( $key, $start, $end, $withscore = null ) {}
      *                      - withscores => TRUE,
      *                      - and limit => array($offset, $count)
      * @return  array   Array containing the values in specified range.
-     * @link    http://redis.io/commands/zrangebyscore
+     * @link    https://redis.io/commands/zrangebyscore
      * @example
      * 
      * $redis->zAdd('key', 0, 'val0');
@@ -2435,7 +2435,7 @@ public function zRevRangeByScore( $key, $start, $end, array $options = array() )
      * @param   int     $offset Optional argument if you wish to start somewhere other than the first element.
      * @param   int     $limit  Optional argument if you wish to limit the number of elements returned.
      * @return  array   Array containing the values in the specified range.
-     * @link    http://redis.io/commands/zrangebylex
+     * @link    https://redis.io/commands/zrangebylex
      * @example
      * 
      * foreach (array('a', 'b', 'c', 'd', 'e', 'f', 'g') as $char) {
@@ -2457,7 +2457,7 @@ public function zRangeByLex( $key, $min, $max, $offset = null, $limit = null ) {
      * @param   int     $offset
      * @param   int     $limit
      * @return  array
-     * @link    http://redis.io/commands/zrevrangebylex
+     * @link    https://redis.io/commands/zrevrangebylex
      */
     public function zRevRangeByLex( $key, $min, $max, $offset = null, $limit = null ) {}
 
@@ -2470,7 +2470,7 @@ public function zRevRangeByLex( $key, $min, $max, $offset = null, $limit = null
      * @param   string  $start
      * @param   string  $end
      * @return  int     the size of a corresponding zRangeByScore.
-     * @link    http://redis.io/commands/zcount
+     * @link    https://redis.io/commands/zcount
      * @example
      * 
      * $redis->zAdd('key', 0, 'val0');
@@ -2488,7 +2488,7 @@ public function zCount( $key, $start, $end ) {}
      * @param   float|string    $start double or "+inf" or "-inf" string
      * @param   float|string    $end double or "+inf" or "-inf" string
      * @return  int             The number of values deleted from the sorted set
-     * @link    http://redis.io/commands/zremrangebyscore
+     * @link    https://redis.io/commands/zremrangebyscore
      * @example
      * 
      * $redis->zAdd('key', 0, 'val0');
@@ -2514,7 +2514,7 @@ public function zDeleteRangeByScore( $key, $start, $end ) {}
      * @param   int     $start
      * @param   int     $end
      * @return  int     The number of values deleted from the sorted set
-     * @link    http://redis.io/commands/zremrangebyrank
+     * @link    https://redis.io/commands/zremrangebyrank
      * @example
      * 
      * $redis->zAdd('key', 1, 'one');
@@ -2531,7 +2531,7 @@ public function zRemRangeByRank( $key, $start, $end ) {}
      * @param   string  $key
      * @param   int     $start
      * @param   int     $end
-     * @link    http://redis.io/commands/zremrangebyscore
+     * @link    https://redis.io/commands/zremrangebyscore
      */
     public function zDeleteRangeByRank( $key, $start, $end ) {}
 
@@ -2540,7 +2540,7 @@ public function zDeleteRangeByRank( $key, $start, $end ) {}
      *
      * @param   string  $key
      * @return  int     the set's cardinality
-     * @link    http://redis.io/commands/zsize
+     * @link    https://redis.io/commands/zsize
      * @example
      * 
      * $redis->zAdd('key', 0, 'val0');
@@ -2563,7 +2563,7 @@ public function zSize( $key ) {}
      * @param   string  $key
      * @param   string  $member
      * @return  float
-     * @link    http://redis.io/commands/zscore
+     * @link    https://redis.io/commands/zscore
      * @example
      * 
      * $redis->zAdd('key', 2.5, 'val2');
@@ -2579,7 +2579,7 @@ public function zScore( $key, $member ) {}
      * @param   string  $key
      * @param   string  $member
      * @return  int     the item's score.
-     * @link    http://redis.io/commands/zrank
+     * @link    https://redis.io/commands/zrank
      * @example
      * 
      * $redis->delete('z');
@@ -2598,7 +2598,7 @@ public function zRank( $key, $member ) {}
      * @param  string $key
      * @param  string $member
      * @return int    the item's score
-     * @link   http://redis.io/commands/zrevrank
+     * @link   https://redis.io/commands/zrevrank
      */
     public function zRevRank( $key, $member ) {}
 
@@ -2609,7 +2609,7 @@ public function zRevRank( $key, $member ) {}
      * @param   float   $value (double) value that will be added to the member's score
      * @param   string  $member
      * @return  float   the new value
-     * @link    http://redis.io/commands/zincrby
+     * @link    https://redis.io/commands/zincrby
      * @example
      * 
      * $redis->delete('key');
@@ -2634,7 +2634,7 @@ public function zIncrBy( $key, $value, $member ) {}
      * @param string    $aggregateFunction  Either "SUM", "MIN", or "MAX": defines the behaviour to use on
      * duplicate entries during the zUnion.
      * @return int The number of values in the new sorted set.
-     * @link    http://redis.io/commands/zunionstore
+     * @link    https://redis.io/commands/zunionstore
      * @example
      * 
      * $redis->delete('k1');
@@ -2673,7 +2673,7 @@ public function zUnion($Output, $ZSetKeys, array $Weights = null, $aggregateFunc
      * @param   string  $aggregateFunction Either "SUM", "MIN", or "MAX":
      * defines the behaviour to use on duplicate entries during the zInter.
      * @return  int     The number of values in the new sorted set.
-     * @link    http://redis.io/commands/zinterstore
+     * @link    https://redis.io/commands/zinterstore
      * @example
      * 
      * $redis->delete('k1');
@@ -2709,7 +2709,7 @@ public function zInter($Output, $ZSetKeys, array $Weights = null, $aggregateFunc
      * @param   string  $pattern    String (optional), the pattern to match.
      * @param   int     $count      How many keys to return per iteration (Redis might return a different number).
      * @return  array   PHPRedis will return matching keys from Redis, or FALSE when iteration is complete.
-     * @link    http://redis.io/commands/zscan
+     * @link    https://redis.io/commands/zscan
      * @example
      * 
      * $iterator = null;
@@ -2731,7 +2731,7 @@ public function zScan( $key, &$iterator, $pattern = null, $count = 0 ) {}
      * @return int
      * 1 if value didn't exist and was added successfully,
      * 0 if the value was already present and was replaced, FALSE if there was an error.
-     * @link    http://redis.io/commands/hset
+     * @link    https://redis.io/commands/hset
      * @example
      * 
      * $redis->delete('h')
@@ -2751,7 +2751,7 @@ public function hSet( $key, $hashKey, $value ) {}
      * @param   string  $hashKey
      * @param   string  $value
      * @return  bool    TRUE if the field was set, FALSE if it was already present.
-     * @link    http://redis.io/commands/hsetnx
+     * @link    https://redis.io/commands/hsetnx
      * @example
      * 
      * $redis->delete('h')
@@ -2769,7 +2769,7 @@ public function hSetNx( $key, $hashKey, $value ) {}
      * @param   string  $key
      * @param   string  $hashKey
      * @return  string  The value, if the command executed successfully BOOL FALSE in case of failure
-     * @link    http://redis.io/commands/hget
+     * @link    https://redis.io/commands/hget
      */
     public function hGet($key, $hashKey) {}
 
@@ -2778,7 +2778,7 @@ public function hGet($key, $hashKey) {}
      *
      * @param   string  $key
      * @return  int     the number of items in a hash, FALSE if the key doesn't exist or isn't a hash.
-     * @link    http://redis.io/commands/hlen
+     * @link    https://redis.io/commands/hlen
      * @example
      * 
      * $redis->delete('h')
@@ -2798,7 +2798,7 @@ public function hLen( $key ) {}
      * @param   string  $hashKey2
      * @param   string  $hashKeyN
      * @return  int     Number of deleted fields
-     * @link    http://redis.io/commands/hdel
+     * @link    https://redis.io/commands/hdel
      * @example
      * 
      * $redis->hMSet('h',
@@ -2826,7 +2826,7 @@ public function hDel( $key, $hashKey1, $hashKey2 = null, $hashKeyN = null ) {}
      *
      * @param   string  $key
      * @return  array   An array of elements, the keys of the hash. This works like PHP's array_keys().
-     * @link    http://redis.io/commands/hkeys
+     * @link    https://redis.io/commands/hkeys
      * @example
      * 
      * $redis->delete('h');
@@ -2857,7 +2857,7 @@ public function hKeys( $key ) {}
      *
      * @param   string  $key
      * @return  array   An array of elements, the values of the hash. This works like PHP's array_values().
-     * @link    http://redis.io/commands/hvals
+     * @link    https://redis.io/commands/hvals
      * @example
      * 
      * $redis->delete('h');
@@ -2888,7 +2888,7 @@ public function hVals( $key ) {}
      *
      * @param   string  $key
      * @return  array   An array of elements, the contents of the hash.
-     * @link    http://redis.io/commands/hgetall
+     * @link    https://redis.io/commands/hgetall
      * @example
      * 
      * $redis->delete('h');
@@ -2920,7 +2920,7 @@ public function hGetAll( $key ) {}
      * @param   string  $key
      * @param   string  $hashKey
      * @return  bool:   If the member exists in the hash table, return TRUE, otherwise return FALSE.
-     * @link    http://redis.io/commands/hexists
+     * @link    https://redis.io/commands/hexists
      * @example
      * 
      * $redis->hSet('h', 'a', 'x');
@@ -2937,7 +2937,7 @@ public function hExists( $key, $hashKey ) {}
      * @param   string  $hashKey
      * @param   int     $value (integer) value that will be added to the member's value
      * @return  int     the new value
-     * @link    http://redis.io/commands/hincrby
+     * @link    https://redis.io/commands/hincrby
      * @example
      * 
      * $redis->delete('h');
@@ -2953,7 +2953,7 @@ public function hIncrBy( $key, $hashKey, $value ) {}
      * @param   string  $field
      * @param   float   $increment
      * @return  float
-     * @link    http://redis.io/commands/hincrbyfloat
+     * @link    https://redis.io/commands/hincrbyfloat
      * @example
      * 
      * $redis = new Redis();
@@ -2982,7 +2982,7 @@ public function hIncrByFloat( $key, $field, $increment ) {}
      * @param   string  $key
      * @param   array   $hashKeys key → value array
      * @return  bool
-     * @link    http://redis.io/commands/hmset
+     * @link    https://redis.io/commands/hmset
      * @example
      * 
      * $redis->delete('user:1');
@@ -2999,7 +2999,7 @@ public function hMSet( $key, $hashKeys ) {}
      * @param   array   $hashKeys
      * @return  array   Array An array of elements, the values of the specified fields in the hash,
      * with the hash keys as array keys.
-     * @link    http://redis.io/commands/hmget
+     * @link    https://redis.io/commands/hmget
      * @example
      * 
      * $redis->delete('h');
@@ -3017,7 +3017,7 @@ public function hMGet( $key, $hashKeys ) {}
      * @param   string    $pattern    Optional pattern to match against.
      * @param   int       $count      How many keys to return in a go (only a sugestion to Redis).
      * @return  array     An array of members that match our pattern.
-     * @link    http://redis.io/commands/hscan
+     * @link    https://redis.io/commands/hscan
      * @example
      * 
      * // $iterator = null;
@@ -3035,11 +3035,11 @@ public function hScan( $key, &$iterator, $pattern = null, $count = 0 ) {}
      * Get or Set the redis config keys.
      *
      * @param   string  $operation  either `GET` or `SET`
-     * @param   string  $key        for `SET`, glob-pattern for `GET`. See http://redis.io/commands/config-get for examples.
+     * @param   string  $key        for `SET`, glob-pattern for `GET`. See https://redis.io/commands/config-get for examples.
      * @param   string  $value      optional string (only for `SET`)
      * @return  array   Associative array for `GET`, key -> value
-     * @link    http://redis.io/commands/config-get
-     * @link    http://redis.io/commands/config-set
+     * @link    https://redis.io/commands/config-get
+     * @link    https://redis.io/commands/config-set
      * @example
      * 
      * $redis->config("GET", "*max-*-entries*");
@@ -3066,7 +3066,7 @@ public function evaluate( $script, $args = array(), $numKeys = 0 ) {}
      * @param   int     $numKeys
      * @return  mixed   @see eval()
      * @see     eval()
-     * @link    http://redis.io/commands/evalsha
+     * @link    https://redis.io/commands/evalsha
      * @example
      * 
      * $script = 'return 1';
@@ -3089,10 +3089,10 @@ public function evaluateSha( $scriptSha, $args = array(), $numKeys = 0 ) {}
      * @param   string  $command load | flush | kill | exists
      * @param   string  $script
      * @return  mixed
-     * @link    http://redis.io/commands/script-load
-     * @link    http://redis.io/commands/script-kill
-     * @link    http://redis.io/commands/script-flush
-     * @link    http://redis.io/commands/script-exists
+     * @link    https://redis.io/commands/script-load
+     * @link    https://redis.io/commands/script-kill
+     * @link    https://redis.io/commands/script-flush
+     * @link    https://redis.io/commands/script-exists
      * @example
      * 
      * $redis->script('load', $script);
@@ -3189,7 +3189,7 @@ public function _serialize( $value ) {}
      * The data that comes out of DUMP is a binary representation of the key as Redis stores it.
      * @param   string  $key
      * @return  string  The Redis encoded value of the key, or FALSE if the key doesn't exist
-     * @link    http://redis.io/commands/dump
+     * @link    https://redis.io/commands/dump
      * @example
      * 
      * $redis->set('foo', 'bar');
@@ -3205,7 +3205,7 @@ public function dump( $key ) {}
      * @param   int     $ttl    How long the key should live (if zero, no expire will be set on the key)
      * @param   string  $value  (binary).  The Redis encoded key value (from DUMP)
      * @return  bool
-     * @link    http://redis.io/commands/restore
+     * @link    https://redis.io/commands/restore
      * @example
      * 
      * $redis->set('foo', 'bar');
@@ -3226,7 +3226,7 @@ public function restore( $key, $ttl, $value ) {}
      * @param   bool    $copy       Should we send the COPY flag to redis.
      * @param   bool    $replace    Should we send the REPLACE flag to redis.
      * @return  bool
-     * @link    http://redis.io/commands/migrate
+     * @link    https://redis.io/commands/migrate
      * @example
      * 
      * $redis->migrate('backup', 6379, 'foo', 0, 3600);
@@ -3238,7 +3238,7 @@ public function migrate( $host, $port, $key, $db, $timeout, $copy = false, $repl
      * Return the current Redis server time.
      * @return  array If successfull, the time will come back as an associative array with element zero being the
      * unix timestamp, and element one being microseconds.
-     * @link    http://redis.io/commands/time
+     * @link    https://redis.io/commands/time
      * @example
      * 
      * var_dump( $redis->time() );
@@ -3256,7 +3256,7 @@ public function time() {}
      * @param  string $pattern  Pattern to match.
      * @param  int    $count    Count of keys per iteration (only a suggestion to Redis).
      * @return array            This function will return an array of keys or FALSE if there are no more keys.
-     * @link   http://redis.io/commands/scan
+     * @link   https://redis.io/commands/scan
      * @example
      * 
      * $iterator = null;
@@ -3274,7 +3274,7 @@ public function scan( &$iterator, $pattern = null, $count = 0 ) {}
      * @param   string  $key
      * @param   array   $elements
      * @return  bool
-     * @link    http://redis.io/commands/pfadd
+     * @link    https://redis.io/commands/pfadd
      * @example $redis->pfAdd('key', array('elem1', 'elem2'))
      */
     public function pfAdd( $key, array $elements ) {}
@@ -3284,7 +3284,7 @@ public function pfAdd( $key, array $elements ) {}
      * structure stored at the specified variable, which is 0 if the variable does not exist.
      * @param   string|array    $key
      * @return  int
-     * @link    http://redis.io/commands/pfcount
+     * @link    https://redis.io/commands/pfcount
      * @example
      * 
      * $redis->pfAdd('key1', array('elem1', 'elem2'));
@@ -3300,7 +3300,7 @@ public function pfCount( $key ) {}
      * @param   string  $destkey
      * @param   array   $sourcekeys
      * @return  bool
-     * @link    http://redis.io/commands/pfmerge
+     * @link    https://redis.io/commands/pfmerge
      * @example
      * 
      * $redis->pfAdd('key1', array('elem1', 'elem2'));

From baadc5cd641c5720d6c8c16962dc806f0b888ec0 Mon Sep 17 00:00:00 2001
From: CodeLingoBot 
Date: Fri, 5 Apr 2019 20:10:09 +1300
Subject: [PATCH 69/97] Change PHP keywords to comply with PSR2

Signed-off-by: CodeLingoBot 
---
 src/Redis.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Redis.php b/src/Redis.php
index 4dad4b0..e4bf604 100644
--- a/src/Redis.php
+++ b/src/Redis.php
@@ -3555,7 +3555,7 @@ class RedisArray {
      * @param   array          $opts   Array of options
      * @link    https://github.com/nicolasff/phpredis/blob/master/arrays.markdown
      */
-    function __construct($hosts, array $opts = NULL) {}
+    function __construct($hosts, array $opts = null) {}
 
     /**
      * @return  array   list of hosts for the selected array

From 977573c442fa60812ac76e04a3a3708cc05e25be Mon Sep 17 00:00:00 2001
From: Alexander Schranz 
Date: Mon, 15 Apr 2019 11:13:35 +0200
Subject: [PATCH 70/97] Add missing mkstream to xgroup function

---
 src/Redis.php | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/Redis.php b/src/Redis.php
index e4bf604..0dfb51f 100644
--- a/src/Redis.php
+++ b/src/Redis.php
@@ -3407,15 +3407,17 @@ public function xDel($str_key, $arr_ids) {}
      * @param   string  $str_key
      * @param   string  $str_group
      * @param   string  $str_msg_id
+     * @param   bool    $boo_mkstream
      * @return  mixed   This command returns different types depending on the specific XGROUP command executed.
      * @link    https://redis.io/commands/xgroup
      * @example
      * 
-     * $obj_redis->xGroup('CREATE', 'mystream', 'mygroup');
-     * $obj_redis->xGroup('DELGROUP', 'mystream', 'mygroup');
+     * $obj_redis->xGroup('CREATE', 'mystream', 'mygroup', 0);
+     * $obj_redis->xGroup('CREATE', 'mystream', 'mygroup', 0, true); // create stream
+     * $obj_redis->xGroup('DESTROY', 'mystream', 'mygroup');
      * 
*/ - public function xGroup($operation, $str_key, $str_group, $str_msg_id) {} + public function xGroup($operation, $str_key, $str_group, $str_msg_id = '', $boo_mkstream = false) {} /** * Get information about a stream or consumer groups. From f9187991892c7fc3d176421a1899ebd707669ac9 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Mon, 15 Apr 2019 11:14:44 +0200 Subject: [PATCH 71/97] ix xReadGroup phpdocs for count and block --- src/Redis.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Redis.php b/src/Redis.php index e4bf604..9528f83 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -3498,8 +3498,8 @@ public function xRead($arr_streams, $i_count = null, $i_block = null) {} * @param string $str_group * @param string $str_consumer * @param array $arr_streams - * @param int|string $i_count - * @param int|string $i_block + * @param int|null $i_count + * @param int|null $i_block * @return array The messages delivered to this consumer group (if any). * @link https://redis.io/commands/xreadgroup * @example @@ -3510,7 +3510,7 @@ public function xRead($arr_streams, $i_count = null, $i_block = null) {} * $obj_redis->xReadGroup('mygroup', 'consumer2', ['s1' => 0, 's2' => 0], 1, 1000); *
*/ - public function xReadGroup($str_group, $str_consumer, $arr_streams, $i_count, $i_block = null) {} + public function xReadGroup($str_group, $str_consumer, $arr_streams, $i_count = null, $i_block = null) {} /** * This is identical to xRange except the results come back in reverse order. Also note that Redis reverses the order of "start" and "end". From bfe3edf6ca6f19abfff6f4d1cd7a0ad72bd47494 Mon Sep 17 00:00:00 2001 From: man_solver Date: Thu, 30 May 2019 17:44:44 +0800 Subject: [PATCH 72/97] zAdd demo error output has value of "v1", but not add this value --- src/Redis.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Redis.php b/src/Redis.php index b07b719..47972c5 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -2284,7 +2284,7 @@ public function brpoplpush( $srcKey, $dstKey, $timeout ) {} * @example *
      * 
-     * $redis->zAdd('z', 1, 'v2', 2, 'v2', 3, 'v3', 4, 'v4' );  // int(2)
+     * $redis->zAdd('z', 1, 'v1', 2, 'v2', 3, 'v3', 4, 'v4' );  // int(2)
      * $redis->zRem('z', 'v2', 'v3');                           // int(2)
      * var_dump( $redis->zRange('z', 0, -1) );
      * //// Output:
@@ -2334,7 +2334,7 @@ public function zRange( $key, $start, $end, $withscores = null ) {}
      * @link    https://redis.io/commands/zrem
      * @example
      * 
-     * $redis->zAdd('z', 1, 'v2', 2, 'v2', 3, 'v3', 4, 'v4' );  // int(2)
+     * $redis->zAdd('z', 1, 'v1', 2, 'v2', 3, 'v3', 4, 'v4' );  // int(2)
      * $redis->zRem('z', 'v2', 'v3');                           // int(2)
      * var_dump( $redis->zRange('z', 0, -1) );
      * //// Output:

From 875a35b6a5550044a9de87ad4772ff66b86c25f5 Mon Sep 17 00:00:00 2001
From: Alexander Schranz 
Date: Thu, 6 Jun 2019 17:54:17 +0200
Subject: [PATCH 73/97] Add maxlength and approximate argument to xadd

---
 src/Redis.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/Redis.php b/src/Redis.php
index 47972c5..7db031f 100644
--- a/src/Redis.php
+++ b/src/Redis.php
@@ -3349,14 +3349,18 @@ public function xAck($stream, $group, $arr_messages) {}
      * @param   string  $str_key
      * @param   string  $str_id
      * @param   array   $arr_message
+     * @param   int     $i_maxlen
+     * @param   bool    $boo_approximate
      * @return  string  The added message ID.
      * @link    https://redis.io/commands/xadd
      * @example
      * 
      * $obj_redis->xAdd('mystream', "*", ['field' => 'value']);
+     * $obj_redis->xAdd('mystream', "*", ['field' => 'value'], 10);
+     * $obj_redis->xAdd('mystream', "*", ['field' => 'value'], 10, true);
      * 
*/ - public function xAdd($str_key, $str_id, $arr_message) {} + public function xAdd($str_key, $str_id, $arr_message, $i_maxlen = 0, $boo_approximate = false) {} /** * Claim ownership of one or more pending messages. From a0a91a38fc533d7a1270c7306409aa40ba135be2 Mon Sep 17 00:00:00 2001 From: Maksim Kamashev Date: Sun, 28 Jul 2019 16:01:05 +0300 Subject: [PATCH 74/97] Reformate code to PSR12 --- src/Redis.php | 833 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 605 insertions(+), 228 deletions(-) diff --git a/src/Redis.php b/src/Redis.php index 7db031f..da84d57 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -1,8 +1,9 @@ - * @link https://github.com/ukko/phpredis-phpdoc + * @link https://github.com/ukko/phpredis-phpdoc * * @method eval( $script, $args = array(), $numKeys = 0 ) * Evaluate a LUA script serverside @@ -78,13 +79,14 @@ class Redis const REDIS_ZSET = 4; const REDIS_HASH = 5; - /** * Creates a Redis client * * @example $redis = new Redis(); */ - public function __construct( ) {} + public function __construct() + { + } /** * Connects to a Redis instance. @@ -104,13 +106,17 @@ public function __construct( ) {} * $redis->connect('/tmp/redis.sock'); // unix domain socket. *
*/ - public function connect( $host, $port = 6379, $timeout = 0.0, $reserved = null, $retry_interval = 0, $read_timeout = 0.0 ) {} + public function connect($host, $port = 6379, $timeout = 0.0, $reserved = null, $retry_interval = 0, $read_timeout = 0.0) + { + } /** * A method to determine if a phpredis object thinks it's connected to a server * @return bool Returns TRUE if phpredis thinks it's connected and FALSE if not */ - public function isConnected() {} + public function isConnected() + { + } /** * @see connect() @@ -122,7 +128,9 @@ public function isConnected() {} * @param float $read_timeout * @return bool */ - public function open( $host, $port = 6379, $timeout = 0.0, $reserved = null, $retry_interval = 0, $read_timeout = 0.0 ) {} + public function open($host, $port = 6379, $timeout = 0.0, $reserved = null, $retry_interval = 0, $read_timeout = 0.0) + { + } /** * Connects to a Redis instance or reuse a connection already established with pconnect/popen. @@ -152,7 +160,9 @@ public function open( $host, $port = 6379, $timeout = 0.0, $reserved = null, $re * $redis->pconnect('/tmp/redis.sock'); // unix domain socket - would be another connection than the four before. *
*/ - public function pconnect( $host, $port = 6379, $timeout = 0.0, $persistent_id = null, $retry_interval = 0, $read_timeout = 0.0 ) {} + public function pconnect($host, $port = 6379, $timeout = 0.0, $persistent_id = null, $retry_interval = 0, $read_timeout = 0.0) + { + } /** * @see pconnect() @@ -164,12 +174,16 @@ public function pconnect( $host, $port = 6379, $timeout = 0.0, $persistent_id = * @param float $read_timeout * @return bool */ - public function popen( $host, $port = 6379, $timeout = 0.0, $persistent_id = '', $retry_interval = 0, $read_timeout = 0.0 ) {} + public function popen($host, $port = 6379, $timeout = 0.0, $persistent_id = '', $retry_interval = 0, $read_timeout = 0.0) + { + } /** * Disconnects from the Redis instance, except when pconnect is used. */ - public function close( ) {} + public function close() + { + } /** * Set client option. @@ -185,7 +199,9 @@ public function close( ) {} * $redis->setOption(Redis::OPT_PREFIX, 'myAppName:'); // use custom prefix on all keys *
*/ - public function setOption( $name, $value ) {} + public function setOption($name, $value) + { + } /** * Get client option @@ -196,7 +212,9 @@ public function setOption( $name, $value ) {} * // return Redis::SERIALIZER_NONE, Redis::SERIALIZER_PHP, or Redis::SERIALIZER_IGBINARY. * $redis->getOption(Redis::OPT_SERIALIZER); */ - public function getOption( $name ) {} + public function getOption($name) + { + } /** * Check the current connection status @@ -204,7 +222,9 @@ public function getOption( $name ) {} * @return string STRING: +PONG on success. Throws a RedisException object on connectivity error, as described above. * @link https://redis.io/commands/ping */ - public function ping( ) {} + public function ping() + { + } /** * Echo the given string @@ -213,7 +233,9 @@ public function ping( ) {} * @return string: Returns message. * @link https://redis.io/commands/echo */ - public function echo( $message ) {} + public function echo($message) + { + } /** * Get the value related to the specified key @@ -223,8 +245,9 @@ public function echo( $message ) {} * @link https://redis.io/commands/get * @example $redis->get('key'); */ - public function get( $key ) {} - + public function get($key) + { + } /** * Set the string value in argument as value of the key. @@ -253,7 +276,9 @@ public function get( $key ) {} * * @link https://redis.io/commands/set */ - public function set( $key, $value, $timeout = null ) {} + public function set($key, $value, $timeout = null) + { + } /** * Set the string value in argument as value of the key, with a time to live. @@ -265,7 +290,9 @@ public function set( $key, $value, $timeout = null ) {} * @link https://redis.io/commands/setex * @example $redis->setex('key', 3600, 'value'); // sets key → value, with 1h TTL. */ - public function setex( $key, $ttl, $value ) {} + public function setex($key, $ttl, $value) + { + } /** * Set the value and expiration in milliseconds of a key. @@ -278,7 +305,9 @@ public function setex( $key, $ttl, $value ) {} * @link https://redis.io/commands/psetex * @example $redis->psetex('key', 1000, 'value'); // sets key → value, with 1sec TTL. */ - public function psetex( $key, $ttl, $value ) {} + public function psetex($key, $ttl, $value) + { + } /** * Set the string value in argument as value of the key if the key doesn't already exist in the database. @@ -293,7 +322,9 @@ public function psetex( $key, $ttl, $value ) {} * $redis->setnx('key', 'value'); // return FALSE *
*/ - public function setnx( $key, $value ) {} + public function setnx($key, $value) + { + } /** * Remove specified keys. @@ -313,7 +344,9 @@ public function setnx( $key, $value ) {} * $redis->delete(array('key3', 'key4')); // return 2 *
*/ - public function del( $key1, $key2 = null, $key3 = null ) {} + public function del($key1, $key2 = null, $key3 = null) + { + } /** * @see del() @@ -322,7 +355,9 @@ public function del( $key1, $key2 = null, $key3 = null ) {} * @param string $key3 * @return int Number of keys deleted. */ - public function delete( $key1, $key2 = null, $key3 = null ) {} + public function delete($key1, $key2 = null, $key3 = null) + { + } /** * Delete a key asynchronously in another thread. Otherwise it is just as DEL, but non blocking. @@ -344,7 +379,9 @@ public function delete( $key1, $key2 = null, $key3 = null ) {} * $redis->unlink(array('key3', 'key4')); // return 2 *
*/ - public function unlink( $key1, $key2 = null, $key3 = null ) {} + public function unlink($key1, $key2 = null, $key3 = null) + { + } /** * Enter and exit transactional mode. @@ -373,20 +410,26 @@ public function unlink( $key1, $key2 = null, $key3 = null ) {} * // 3 => 'val2'); *
*/ - public function multi( $mode = Redis::MULTI ) {} + public function multi($mode = Redis::MULTI) + { + } /** * @see multi() * @return void|array * @link https://redis.io/commands/exec */ - public function exec( ) {} + public function exec() + { + } /** * @see multi() * @link https://redis.io/commands/discard */ - public function discard( ) {} + public function discard() + { + } /** * Watches a key for modifications by another client. If the key is modified between WATCH and EXEC, @@ -404,13 +447,17 @@ public function discard( ) {} * // $ret = FALSE if x has been modified between the call to WATCH and the call to EXEC. *
*/ - public function watch( $key ) {} + public function watch($key) + { + } /** * @see watch() * @link https://redis.io/commands/unwatch */ - public function unwatch( ) {} + public function unwatch() + { + } /** * Subscribe to channels. Warning: this function will probably change in the future. @@ -441,7 +488,9 @@ public function unwatch( ) {} * $redis->subscribe(array('chan-1', 'chan-2', 'chan-3'), 'f'); // subscribe to 3 chans *
*/ - public function subscribe( $channels, $callback ) {} + public function subscribe($channels, $callback) + { + } /** * Subscribe to channels by pattern @@ -460,7 +509,9 @@ public function subscribe( $channels, $callback ) {} * } *
*/ - public function psubscribe( $patterns, $callback ) {} + public function psubscribe($patterns, $callback) + { + } /** * Publish messages to channels. Warning: this function will probably change in the future. @@ -471,7 +522,9 @@ public function psubscribe( $patterns, $callback ) {} * @return int Number of clients that received the message * @example $redis->publish('chan-1', 'hello, world!'); // send message. */ - public function publish( $channel, $message ) {} + public function publish($channel, $message) + { + } /** * A command allowing you to get information on the Redis pub/sub system. @@ -493,7 +546,9 @@ public function publish( $channel, $message ) {} * $redis->pubsub('numpat'); // Get the number of pattern subscribers *
*/ - public function pubsub( $keyword, $argument ) {} + public function pubsub($keyword, $argument) + { + } /** * Stop listening for messages posted to the given channels. @@ -501,7 +556,9 @@ public function pubsub( $keyword, $argument ) {} * @param array $channels an array of channels to usubscribe * @link https://redis.io/commands/unsubscribe */ - public function unsubscribe( $channels = null ) {} + public function unsubscribe($channels = null) + { + } /** * Stop listening for messages posted to the given channels. @@ -509,7 +566,9 @@ public function unsubscribe( $channels = null ) {} * @param array $patterns an array of glob-style patterns to unsubscribe * @link https://redis.io/commands/punsubscribe */ - public function punsubscribe( $patterns = null ) {} + public function punsubscribe($patterns = null) + { + } /** * Verify if the specified key exists. @@ -524,7 +583,9 @@ public function punsubscribe( $patterns = null ) {} * $redis->exists('NonExistingKey'); // FALSE *
*/ - public function exists( $key ) {} + public function exists($key) + { + } /** * Increment the number stored at key by one. @@ -540,7 +601,9 @@ public function exists( $key ) {} * $redis->incr('key1'); // 4 *
*/ - public function incr( $key ) {} + public function incr($key) + { + } /** * Increment the float value of a key by the given amount @@ -560,7 +623,9 @@ public function incr( $key ) {} * var_dump( $redis->get('x') ); // string(3) "4.5" *
*/ - public function incrByFloat( $key, $increment ) {} + public function incrByFloat($key, $increment) + { + } /** * Increment the number stored at key by one. If the second argument is filled, it will be used as the integer @@ -579,7 +644,9 @@ public function incrByFloat( $key, $increment ) {} * $redis->incrBy('key1', 10); // 14 *
*/ - public function incrBy( $key, $value ) {} + public function incrBy($key, $value) + { + } /** * Decrement the number stored at key by one. @@ -594,7 +661,9 @@ public function incrBy( $key, $value ) {} * $redis->decr('key1'); // -3 *
*/ - public function decr( $key ) {} + public function decr($key) + { + } /** * Decrement the number stored at key by one. If the second argument is filled, it will be used as the integer @@ -612,7 +681,9 @@ public function decr( $key ) {} * $redis->decrBy('key1', 10); // -13 *
*/ - public function decrBy( $key, $value ) {} + public function decrBy($key, $value) + { + } /** * Get the values of all the specified keys. If one or more keys dont exist, the array will contain FALSE at the @@ -629,7 +700,9 @@ public function decrBy( $key, $value ) {} * $redis->getMultiple(array('key0', 'key1', 'key5')); // array(`FALSE`, 'value2', `FALSE`); *
*/ - public function getMultiple( array $keys ) {} + public function getMultiple(array $keys) + { + } /** * Adds the string values to the head (left) of the list. Creates the list if the key didn't exist. @@ -654,7 +727,9 @@ public function getMultiple( array $keys ) {} * // } *
*/ - public function lPush( $key, $value1, $value2 = null, $valueN = null ) {} + public function lPush($key, $value1, $value2 = null, $valueN = null) + { + } /** * Adds the string values to the tail (right) of the list. Creates the list if the key didn't exist. @@ -679,7 +754,9 @@ public function lPush( $key, $value1, $value2 = null, $valueN = null ) {} * // } *
*/ - public function rPush( $key, $value1, $value2 = null, $valueN = null ) {} + public function rPush($key, $value1, $value2 = null, $valueN = null) + { + } /** * Adds the string value to the head (left) of the list if the list exists. @@ -698,7 +775,9 @@ public function rPush( $key, $value1, $value2 = null, $valueN = null ) {} * // key1 now points to the following list: [ 'A', 'B', 'C' ] *
*/ - public function lPushx( $key, $value ) {} + public function lPushx($key, $value) + { + } /** * Adds the string value to the tail (right) of the list if the ist exists. FALSE in case of Failure. @@ -717,7 +796,9 @@ public function lPushx( $key, $value ) {} * // key1 now points to the following list: [ 'A', 'B', 'C' ] *
*/ - public function rPushx( $key, $value ) {} + public function rPushx($key, $value) + { + } /** * Returns and removes the first element of the list. @@ -733,7 +814,9 @@ public function rPushx( $key, $value ) {} * $redis->lPop('key1'); // key1 => [ 'B', 'C' ] *
*/ - public function lPop( $key ) {} + public function lPop($key) + { + } /** * Returns and removes the last element of the list. @@ -749,7 +832,9 @@ public function lPop( $key ) {} * $redis->rPop('key1'); // key1 => [ 'A', 'B' ] *
*/ - public function rPop( $key ) {} + public function rPop($key) + { + } /** * Is a blocking lPop primitive. If at least one of the lists contains at least one element, @@ -791,7 +876,9 @@ public function rPop( $key ) {} * // array('key1', 'A') is returned *
*/ - public function blPop( array $keys, $timeout) {} + public function blPop(array $keys, $timeout) + { + } /** * Is a blocking rPop primitive. If at least one of the lists contains at least one element, @@ -833,8 +920,9 @@ public function blPop( array $keys, $timeout) {} * // array('key1', 'A') is returned *
*/ - public function brPop( array $keys, $timeout ) {} - + public function brPop(array $keys, $timeout) + { + } /** * Returns the size of a list identified by Key. If the list didn't exist or is empty, @@ -854,15 +942,18 @@ public function brPop( array $keys, $timeout ) {} * $redis->lLen('key1'); // 2 *
*/ - public function lLen( $key ) {} + public function lLen($key) + { + } /** * @see lLen() * @param string $key * @link https://redis.io/commands/llen */ - public function lSize( $key ) {} - + public function lSize($key) + { + } /** * Return the specified element of the list stored at the specified key. @@ -883,7 +974,9 @@ public function lSize( $key ) {} * $redis->lGet('key1', 10); // `FALSE` *
*/ - public function lIndex( $key, $index ) {} + public function lIndex($key, $index) + { + } /** * @see lIndex() @@ -891,8 +984,9 @@ public function lIndex( $key, $index ) {} * @param int $index * @link https://redis.io/commands/lindex */ - public function lGet( $key, $index ) {} - + public function lGet($key, $index) + { + } /** * Set the list at index with the new value. @@ -913,8 +1007,9 @@ public function lGet( $key, $index ) {} * $redis->lGet('key1', 0); // 'X' *
*/ - public function lSet( $key, $index, $value ) {} - + public function lSet($key, $index, $value) + { + } /** * Returns the specified elements of the list stored at the specified key in @@ -933,7 +1028,9 @@ public function lSet( $key, $index, $value ) {} * $redis->lRange('key1', 0, -1); // array('A', 'B', 'C') *
*/ - public function lRange( $key, $start, $end ) {} + public function lRange($key, $start, $end) + { + } /** * @see lRange() @@ -942,8 +1039,9 @@ public function lRange( $key, $start, $end ) {} * @param int $start * @param int $end */ - public function lGetRange( $key, $start, $end ) {} - + public function lGetRange($key, $start, $end) + { + } /** * Trims an existing list so that it will contain only a specified range of elements. @@ -963,7 +1061,9 @@ public function lGetRange( $key, $start, $end ) {} * $redis->lRange('key1', 0, -1); // array('A', 'B') *
*/ - public function lTrim( $key, $start, $stop ) {} + public function lTrim($key, $start, $stop) + { + } /** * @see lTrim() @@ -972,8 +1072,9 @@ public function lTrim( $key, $start, $stop ) {} * @param int $start * @param int $stop */ - public function listTrim( $key, $start, $stop ) {} - + public function listTrim($key, $start, $stop) + { + } /** * Removes the first count occurences of the value element from the list. @@ -999,7 +1100,9 @@ public function listTrim( $key, $start, $stop ) {} * $redis->lRange('key1', 0, -1); // array('C', 'B', 'A') *
*/ - public function lRem( $key, $value, $count ) {} + public function lRem($key, $value, $count) + { + } /** * @see lRem @@ -1008,8 +1111,9 @@ public function lRem( $key, $value, $count ) {} * @param string $value * @param int $count */ - public function lRemove( $key, $value, $count ) {} - + public function lRemove($key, $value, $count) + { + } /** * Insert value in the list before or after the pivot value. the parameter options @@ -1040,8 +1144,9 @@ public function lRemove( $key, $value, $count ) {} * $redis->lInsert('key1', Redis::AFTER, 'W', 'value'); // -1 *
*/ - public function lInsert( $key, $position, $pivot, $value ) {} - + public function lInsert($key, $position, $pivot, $value) + { + } /** * Adds a values to the set value stored at key. @@ -1059,8 +1164,9 @@ public function lInsert( $key, $position, $pivot, $value ) {} * $redis->sAdd('k', 'v1', 'v2', 'v3'); // int(2) *
*/ - public function sAdd( $key, $value1, $value2 = null, $valueN = null ) {} - + public function sAdd($key, $value1, $value2 = null, $valueN = null) + { + } /** * Removes the specified members from the set value stored at key. @@ -1082,7 +1188,9 @@ public function sAdd( $key, $value1, $value2 = null, $valueN = null ) {} * // } *
*/ - public function sRem( $key, $member1, $member2 = null, $memberN = null ) {} + public function sRem($key, $member1, $member2 = null, $memberN = null) + { + } /** * @see sRem() @@ -1092,8 +1200,9 @@ public function sRem( $key, $member1, $member2 = null, $memberN = null ) {} * @param string $member2 * @param string $memberN */ - public function sRemove( $key, $member1, $member2 = null, $memberN = null ) {} - + public function sRemove($key, $member1, $member2 = null, $memberN = null) + { + } /** * Moves the specified member from the set at srcKey to the set at dstKey. @@ -1115,8 +1224,9 @@ public function sRemove( $key, $member1, $member2 = null, $memberN = null ) {} * // 'key2' => {'set21', 'set22', 'set13'} *
*/ - public function sMove( $srcKey, $dstKey, $member ) {} - + public function sMove($srcKey, $dstKey, $member) + { + } /** * Checks if value is a member of the set stored at the key key. @@ -1135,7 +1245,9 @@ public function sMove( $srcKey, $dstKey, $member ) {} * $redis->sIsMember('key1', 'setX'); // FALSE *
*/ - public function sIsMember( $key, $value ) {} + public function sIsMember($key, $value) + { + } /** * @see sIsMember() @@ -1143,7 +1255,9 @@ public function sIsMember( $key, $value ) {} * @param string $key * @param string $value */ - public function sContains( $key, $value ) {} + public function sContains($key, $value) + { + } /** * Returns the cardinality of the set identified by key. @@ -1160,8 +1274,9 @@ public function sContains( $key, $value ) {} * $redis->sCard('keyX'); // 0 *
*/ - public function sCard( $key ) {} - + public function sCard($key) + { + } /** * Removes and returns a random element from the set value at Key. @@ -1179,8 +1294,9 @@ public function sCard( $key ) {} * $redis->sPop('key1'); // 'set3', 'key1' => {'set2'} *
*/ - public function sPop( $key ) {} - + public function sPop($key) + { + } /** * Returns a random element(s) from the set value at Key, without removing it. @@ -1208,7 +1324,9 @@ public function sPop( $key ) {} * // } *
*/ - public function sRandMember( $key, $count = null ) {} + public function sRandMember($key, $count = null) + { + } /** * Returns the members of a set resulting from the intersection of all the sets @@ -1244,7 +1362,9 @@ public function sRandMember( $key, $count = null ) {} * //} *
*/ - public function sInter( $key1, $key2, $keyN = null ) {} + public function sInter($key1, $key2, $keyN = null) + { + } /** * Performs a sInter command and stores the result in a new set. @@ -1281,7 +1401,9 @@ public function sInter( $key1, $key2, $keyN = null ) {} * //} *
*/ - public function sInterStore( $dstKey, $key1, $key2, $keyN = null ) {} + public function sInterStore($dstKey, $key1, $key2, $keyN = null) + { + } /** * Performs the union between N sets and returns it. @@ -1316,7 +1438,9 @@ public function sInterStore( $dstKey, $key1, $key2, $keyN = null ) {} * //} *
*/ - public function sUnion( $key1, $key2, $keyN = null ) {} + public function sUnion($key1, $key2, $keyN = null) + { + } /** * Performs the same action as sUnion, but stores the result in the first key @@ -1354,7 +1478,9 @@ public function sUnion( $key1, $key2, $keyN = null ) {} * //} *
*/ - public function sUnionStore( $dstKey, $key1, $key2, $keyN = null ) {} + public function sUnionStore($dstKey, $key1, $key2, $keyN = null) + { + } /** * Performs the difference between N sets and returns it. @@ -1386,7 +1512,9 @@ public function sUnionStore( $dstKey, $key1, $key2, $keyN = null ) {} * //} *
*/ - public function sDiff( $key1, $key2, $keyN = null ) {} + public function sDiff($key1, $key2, $keyN = null) + { + } /** * Performs the same action as sDiff, but stores the result in the first key @@ -1421,7 +1549,9 @@ public function sDiff( $key1, $key2, $keyN = null ) {} * //} *
*/ - public function sDiffStore( $dstKey, $key1, $key2, $keyN = null ) {} + public function sDiffStore($dstKey, $key1, $key2, $keyN = null) + { + } /** * Returns the contents of a set. @@ -1449,7 +1579,9 @@ public function sDiffStore( $dstKey, $key1, $key2, $keyN = null ) {} * // The order is random and corresponds to redis' own internal representation of the set structure. *
*/ - public function sMembers( $key ) {} + public function sMembers($key) + { + } /** * @see sMembers() @@ -1457,7 +1589,9 @@ public function sMembers( $key ) {} * @param string $key * @link https://redis.io/commands/smembers */ - public function sGetMembers( $key ) {} + public function sGetMembers($key) + { + } /** * Scan a set for members. @@ -1477,7 +1611,9 @@ public function sGetMembers( $key ) {} * } *
*/ - public function sScan( $key, &$iterator, $pattern = null, $count = 0 ) {} + public function sScan($key, &$iterator, $pattern = null, $count = 0) + { + } /** * Sets a value and returns the previous entry at that key. @@ -1493,12 +1629,14 @@ public function sScan( $key, &$iterator, $pattern = null, $count = 0 ) {} * $newValue = $redis->get('x')' // return 'lol' *
*/ - public function getSet( $key, $value ) {} + public function getSet($key, $value) + { + } /** * Returns a random key. * - * @return string: an existing key in redis. + * @return string an existing key in redis. * @link https://redis.io/commands/randomkey * @example *
@@ -1506,8 +1644,9 @@ public function getSet( $key, $value ) {}
      * $surprise = $redis->get($key);  // who knows what's in there.
      * 
*/ - public function randomKey( ) {} - + public function randomKey() + { + } /** * Switches to a given database. @@ -1524,7 +1663,9 @@ public function randomKey( ) {} * $redis->get('x'); // will return 42 *
*/ - public function select( $dbindex ) {} + public function select($dbindex) + { + } /** * Moves a key to a different database. @@ -1542,7 +1683,9 @@ public function select( $dbindex ) {} * $redis->get('x'); // will return 42 *
*/ - public function move( $key, $dbindex ) {} + public function move($key, $dbindex) + { + } /** * Renames a key. @@ -1559,7 +1702,9 @@ public function move( $key, $dbindex ) {} * $redis->get('x'); // → `FALSE` *
*/ - public function rename( $srcKey, $dstKey ) {} + public function rename($srcKey, $dstKey) + { + } /** * @see rename() @@ -1567,7 +1712,9 @@ public function rename( $srcKey, $dstKey ) {} * @param string $srcKey * @param string $dstKey */ - public function renameKey( $srcKey, $dstKey ) {} + public function renameKey($srcKey, $dstKey) + { + } /** * Renames a key. @@ -1587,7 +1734,9 @@ public function renameKey( $srcKey, $dstKey ) {} * $redis->get('x'); // → `FALSE` *
*/ - public function renameNx( $srcKey, $dstKey ) {} + public function renameNx($srcKey, $dstKey) + { + } /** * Sets an expiration date (a timeout) on an item. @@ -1604,7 +1753,9 @@ public function renameNx( $srcKey, $dstKey ) {} * $redis->get('x'); // will return `FALSE`, as 'x' has expired. *
*/ - public function expire( $key, $ttl ) {} + public function expire($key, $ttl) + { + } /** * Sets an expiration date (a timeout in milliseconds) on an item. @@ -1621,7 +1772,9 @@ public function expire( $key, $ttl ) {} * $redis->pttl('x'); // 11500 *
*/ - public function pExpire( $key, $ttl ) {} + public function pExpire($key, $ttl) + { + } /** * @see expire() @@ -1629,7 +1782,9 @@ public function pExpire( $key, $ttl ) {} * @param int $ttl * @link https://redis.io/commands/expire */ - public function setTimeout( $key, $ttl ) {} + public function setTimeout($key, $ttl) + { + } /** * Sets an expiration date (a timestamp) on an item. @@ -1647,7 +1802,9 @@ public function setTimeout( $key, $ttl ) {} * $redis->get('x'); // will return `FALSE`, as 'x' has expired. *
*/ - public function expireAt( $key, $timestamp ) {} + public function expireAt($key, $timestamp) + { + } /** * Sets an expiration date (a timestamp) on an item. Requires a timestamp in milliseconds @@ -1664,7 +1821,9 @@ public function expireAt( $key, $timestamp ) {} * echo $redis->pttl('x'); // 218270120575 *
*/ - public function pExpireAt( $key, $timestamp ) {} + public function pExpireAt($key, $timestamp) + { + } /** * Returns the keys that match a certain pattern. @@ -1678,19 +1837,23 @@ public function pExpireAt( $key, $timestamp ) {} * $keyWithUserPrefix = $redis->keys('user*'); *
*/ - public function keys( $pattern ) {} + public function keys($pattern) + { + } /** * @see keys() * @param string $pattern * @link https://redis.io/commands/keys */ - public function getKeys( $pattern ) {} + public function getKeys($pattern) + { + } /** * Returns the current database's size. * - * @return int: DB size, in number of keys. + * @return int DB size, in number of keys. * @link https://redis.io/commands/dbsize * @example *
@@ -1698,7 +1861,9 @@ public function getKeys( $pattern ) {}
      * echo "Redis has $count keys\n";
      * 
*/ - public function dbSize( ) {} + public function dbSize() + { + } /** * Authenticate the connection using a password. @@ -1709,7 +1874,9 @@ public function dbSize( ) {} * @link https://redis.io/commands/auth * @example $redis->auth('foobared'); */ - public function auth( $password ) {} + public function auth($password) + { + } /** * Starts the background rewrite of AOF (Append-Only File) @@ -1718,7 +1885,9 @@ public function auth( $password ) {} * @link https://redis.io/commands/bgrewriteaof * @example $redis->bgrewriteaof(); */ - public function bgrewriteaof( ) {} + public function bgrewriteaof() + { + } /** * Changes the slave status @@ -1735,7 +1904,9 @@ public function bgrewriteaof( ) {} * $redis->slaveof(); *
*/ - public function slaveof( $host = '127.0.0.1', $port = 6379 ) {} + public function slaveof($host = '127.0.0.1', $port = 6379) + { + } /** * Describes the object pointed to by a key. @@ -1756,7 +1927,9 @@ public function slaveof( $host = '127.0.0.1', $port = 6379 ) {} * $redis->object("idletime", "l"); // → 400 (in seconds, with a precision of 10 seconds). *
*/ - public function object( $string = '', $key = '' ) {} + public function object($string = '', $key = '') + { + } /** * Performs a synchronous save. @@ -1766,17 +1939,21 @@ public function object( $string = '', $key = '' ) {} * @link https://redis.io/commands/save * @example $redis->save(); */ - public function save( ) {} + public function save() + { + } /** * Performs a background save. * - * @return bool: TRUE in case of success, FALSE in case of failure. + * @return bool TRUE in case of success, FALSE in case of failure. * If a save is already running, this command will fail and return FALSE. * @link https://redis.io/commands/bgsave * @example $redis->bgSave(); */ - public function bgsave( ) {} + public function bgsave() + { + } /** * Returns the timestamp of the last disk save. @@ -1785,7 +1962,9 @@ public function bgsave( ) {} * @link https://redis.io/commands/lastsave * @example $redis->lastSave(); */ - public function lastSave( ) {} + public function lastSave() + { + } /** * Blocks the current client until all the previous write commands are successfully transferred and @@ -1797,7 +1976,9 @@ public function lastSave( ) {} * @link https://redis.io/commands/wait * @example $redis->wait(2, 1000); */ - public function wait( $numSlaves, $timeout ) {} + public function wait($numSlaves, $timeout) + { + } /** * Returns the type of data pointed by a given key. @@ -1816,7 +1997,9 @@ public function wait( $numSlaves, $timeout ) {} * @link https://redis.io/commands/type * @example $redis->type('key'); */ - public function type( $key ) {} + public function type($key) + { + } /** * Append specified string to the string stored in specified key. @@ -1832,8 +2015,9 @@ public function type( $key ) {} * $redis->get('key'); // 'value1value2' *
*/ - public function append( $key, $value ) {} - + public function append($key, $value) + { + } /** * Return a substring of a larger string @@ -1850,7 +2034,9 @@ public function append( $key, $value ) {} * $redis->getRange('key', -5, -1); // 'value' *
*/ - public function getRange( $key, $start, $end ) {} + public function getRange($key, $start, $end) + { + } /** * Return a substring of a larger string @@ -1860,8 +2046,9 @@ public function getRange( $key, $start, $end ) {} * @param int $start * @param int $end */ - public function substr( $key, $start, $end ) {} - + public function substr($key, $start, $end) + { + } /** * Changes a substring of a larger string. @@ -1878,7 +2065,9 @@ public function substr( $key, $start, $end ) {} * $redis->get('key'); // "Hello redis" *
*/ - public function setRange( $key, $offset, $value ) {} + public function setRange($key, $offset, $value) + { + } /** * Get the length of a string value. @@ -1892,7 +2081,9 @@ public function setRange( $key, $offset, $value ) {} * $redis->strlen('key'); // 5 *
*/ - public function strlen( $key ) {} + public function strlen($key) + { + } /** * Return the position of the first bit set to 1 or 0 in a string. The position is returned, thinking of the @@ -1924,7 +2115,9 @@ public function strlen( $key ) {} * $redis->bitpos('key', 0, 1, 5); // int(-1) *
*/ - public function bitpos( $key, $bit, $start = 0, $end = null) {} + public function bitpos($key, $bit, $start = 0, $end = null) + { + } /** * Return a single bit out of a larger string @@ -1940,7 +2133,9 @@ public function bitpos( $key, $bit, $start = 0, $end = null) {} * $redis->getBit('key', 1); // 1 *
*/ - public function getBit( $key, $offset ) {} + public function getBit($key, $offset) + { + } /** * Changes a single bit of a string. @@ -1958,7 +2153,9 @@ public function getBit( $key, $offset ) {} * $redis->get('key'); // chr(0x2f) = "/" = b("0010 1111") *
*/ - public function setBit( $key, $offset, $value ) {} + public function setBit($key, $offset, $value) + { + } /** * Count bits in a string. @@ -1975,7 +2172,9 @@ public function setBit( $key, $offset, $value ) {} * var_dump( $redis->bitCount('bit', 0, 2) ); // int(11) *
*/ - public function bitCount( $key ) {} + public function bitCount($key) + { + } /** * Bitwise operation on multiple keys. @@ -1998,7 +2197,9 @@ public function bitCount( $key ) {} * $redis->bitOp('XOR', 'bit', 'bit1', 'bit2'); // bit = 11 *
*/ - public function bitOp( $operation, $retKey, $key1, $key2, $key3 = null ) {} + public function bitOp($operation, $retKey, $key1, $key2, $key3 = null) + { + } /** * Removes all entries from the current database. @@ -2007,7 +2208,9 @@ public function bitOp( $operation, $retKey, $key1, $key2, $key3 = null ) {} * @link https://redis.io/commands/flushdb * @example $redis->flushDB(); */ - public function flushDB( ) {} + public function flushDB() + { + } /** * Removes all entries from all databases. @@ -2016,7 +2219,9 @@ public function flushDB( ) {} * @link https://redis.io/commands/flushall * @example $redis->flushAll(); */ - public function flushAll( ) {} + public function flushAll() + { + } /** * Sort @@ -2046,8 +2251,9 @@ public function flushAll( ) {} * var_dump($redis->sort('s', array('sort' => 'desc', 'store' => 'out'))); // (int)5 *
*/ - public function sort( $key, $option = null ) {} - + public function sort($key, $option = null) + { + } /** * Returns an associative array of strings and integers @@ -2109,7 +2315,9 @@ public function sort( $key, $option = null ) {} * $redis->info("CPU"); // just CPU information from Redis INFO *
*/ - public function info( $option = null ) {} + public function info($option = null) + { + } /** * Resets the statistics reported by Redis using the INFO command (`info()` function). @@ -2120,11 +2328,13 @@ public function info( $option = null ) {} * - Number of connections received * - Number of expired keys * - * @return bool: `TRUE` in case of success, `FALSE` in case of failure. + * @return bool `TRUE` in case of success, `FALSE` in case of failure. * @example $redis->resetStat(); * @link https://redis.io/commands/config-resetstat */ - public function resetStat( ) {} + public function resetStat() + { + } /** * Returns the time to live left for a given key, in seconds. If the key doesn't exist, FALSE is returned. @@ -2134,7 +2344,9 @@ public function resetStat( ) {} * @link https://redis.io/commands/ttl * @example $redis->ttl('key'); */ - public function ttl( $key ) {} + public function ttl($key) + { + } /** * Returns a time to live left for a given key, in milliseconds. @@ -2146,7 +2358,9 @@ public function ttl( $key ) {} * @link https://redis.io/commands/pttl * @example $redis->pttl('key'); */ - public function pttl( $key ) {} + public function pttl($key) + { + } /** * Remove the expiration timer from a key. @@ -2156,7 +2370,9 @@ public function pttl( $key ) {} * @link https://redis.io/commands/persist * @example $redis->persist('key'); */ - public function persist( $key ) {} + public function persist($key) + { + } /** * Sets multiple key-value pairs in one atomic command. @@ -2175,8 +2391,9 @@ public function persist( $key ) {} * // string(6) "value1" *
*/ - public function mset( array $array ) {} - + public function mset(array $array) + { + } /** * Returns the values of all specified keys. @@ -2189,7 +2406,7 @@ public function mset( array $array ) {} * @link https://redis.io/commands/mget * @example *
-     * $redis->delete('x', 'y', 'z', 'h');	// remove x y z
+     * $redis->delete('x', 'y', 'z', 'h');  // remove x y z
      * $redis->mset(array('x' => 'a', 'y' => 'b', 'z' => 'c'));
      * $redis->hset('h', 'field', 'value');
      * var_dump($redis->mget(array('x', 'y', 'z', 'h')));
@@ -2206,7 +2423,9 @@ public function mset( array $array ) {}
      * // }
      * 
*/ - public function mget( array $array ) {} + public function mget(array $array) + { + } /** * @see mset() @@ -2214,7 +2433,9 @@ public function mget( array $array ) {} * @return int 1 (if the keys were set) or 0 (no key was set) * @link https://redis.io/commands/msetnx */ - public function msetnx( array $array ) {} + public function msetnx(array $array) + { + } /** * Pops a value from the tail of a list, and pushes it to the front of another list. @@ -2256,7 +2477,9 @@ public function msetnx( array $array ) {} * //} *
*/ - public function rpoplpush( $srcKey, $dstKey ) {} + public function rpoplpush($srcKey, $dstKey) + { + } /** * A blocking version of rpoplpush, with an integral timeout in the third parameter. @@ -2267,7 +2490,9 @@ public function rpoplpush( $srcKey, $dstKey ) {} * @return string The element that was moved in case of success, FALSE in case of timeout. * @link https://redis.io/commands/brpoplpush */ - public function brpoplpush( $srcKey, $dstKey, $timeout ) {} + public function brpoplpush($srcKey, $dstKey, $timeout) + { + } /** * Adds the specified member with a given score to the sorted set stored at key. @@ -2295,7 +2520,9 @@ public function brpoplpush( $srcKey, $dstKey, $timeout ) {} *
*
*/ - public function zAdd( $key, $score1, $value1, $score2 = null, $value2 = null, $scoreN = null, $valueN = null ) {} + public function zAdd($key, $score1, $value1, $score2 = null, $value2 = null, $scoreN = null, $valueN = null) + { + } /** * Returns a range of elements from the ordered set stored at the specified key, @@ -2321,7 +2548,9 @@ public function zAdd( $key, $score1, $value1, $score2 = null, $value2 = null, $s * $redis->zRange('key1', 0, -1, true); // array('val0' => 0, 'val2' => 2, 'val10' => 10) *
*/ - public function zRange( $key, $start, $end, $withscores = null ) {} + public function zRange($key, $start, $end, $withscores = null) + { + } /** * Deletes a specified member from the ordered set. @@ -2344,7 +2573,9 @@ public function zRange( $key, $start, $end, $withscores = null ) {} * // } *
*/ - public function zRem( $key, $member1, $member2 = null, $memberN = null ) {} + public function zRem($key, $member1, $member2 = null, $memberN = null) + { + } /** * @see zRem() @@ -2355,7 +2586,9 @@ public function zRem( $key, $member1, $member2 = null, $memberN = null ) {} * @return int Number of deleted values * @link https://redis.io/commands/zrem */ - public function zDelete( $key, $member1, $member2 = null, $memberN = null ) {} + public function zDelete($key, $member1, $member2 = null, $memberN = null) + { + } /** * Returns the elements of the sorted set stored at the specified key in the range [start, end] @@ -2382,7 +2615,9 @@ public function zDelete( $key, $member1, $member2 = null, $memberN = null ) {} * $redis->zRevRange('key', 0, -1, true); // array('val10' => 10, 'val2' => 2, 'val0' => 0) *
*/ - public function zRevRange( $key, $start, $end, $withscore = null ) {} + public function zRevRange($key, $start, $end, $withscore = null) + { + } /** * Returns the elements of the sorted set stored at the specified key which have scores in the @@ -2411,7 +2646,9 @@ public function zRevRange( $key, $start, $end, $withscore = null ) {} * $redis->zRangeByScore('key', 0, 3, array('withscores' => TRUE, 'limit' => array(1, 1)); // array('val2' => 2) *
*/ - public function zRangeByScore( $key, $start, $end, array $options = array() ) {} + public function zRangeByScore($key, $start, $end, array $options = array()) + { + } /** * @see zRangeByScore() @@ -2419,10 +2656,12 @@ public function zRangeByScore( $key, $start, $end, array $options = array() ) {} * @param int $start * @param int $end * @param array $options - * - * @return array + * + * @return array */ - public function zRevRangeByScore( $key, $start, $end, array $options = array() ) {} + public function zRevRangeByScore($key, $start, $end, array $options = array()) + { + } /** * Returns a lexigraphical range of members in a sorted set, assuming the members have the same score. The @@ -2447,7 +2686,9 @@ public function zRevRangeByScore( $key, $start, $end, array $options = array() ) * $redis->zRangeByLex('key', '-', '[c'); // array('b', 'c') *
*/ - public function zRangeByLex( $key, $min, $max, $offset = null, $limit = null ) {} + public function zRangeByLex($key, $min, $max, $offset = null, $limit = null) + { + } /** * @see zRangeByLex() @@ -2459,7 +2700,9 @@ public function zRangeByLex( $key, $min, $max, $offset = null, $limit = null ) { * @return array * @link https://redis.io/commands/zrevrangebylex */ - public function zRevRangeByLex( $key, $min, $max, $offset = null, $limit = null ) {} + public function zRevRangeByLex($key, $min, $max, $offset = null, $limit = null) + { + } /** * Returns the number of elements of the sorted set stored at the specified key which have @@ -2479,7 +2722,9 @@ public function zRevRangeByLex( $key, $min, $max, $offset = null, $limit = null * $redis->zCount('key', 0, 3); // 2, corresponding to array('val0', 'val2') *
*/ - public function zCount( $key, $start, $end ) {} + public function zCount($key, $start, $end) + { + } /** * Deletes the elements of the sorted set stored at the specified key which have scores in the range [start,end]. @@ -2497,7 +2742,9 @@ public function zCount( $key, $start, $end ) {} * $redis->zRemRangeByScore('key', 0, 3); // 2 *
*/ - public function zRemRangeByScore( $key, $start, $end ) {} + public function zRemRangeByScore($key, $start, $end) + { + } /** * @see zRemRangeByScore() @@ -2505,7 +2752,9 @@ public function zRemRangeByScore( $key, $start, $end ) {} * @param float $start * @param float $end */ - public function zDeleteRangeByScore( $key, $start, $end ) {} + public function zDeleteRangeByScore($key, $start, $end) + { + } /** * Deletes the elements of the sorted set stored at the specified key which have rank in the range [start,end]. @@ -2524,7 +2773,9 @@ public function zDeleteRangeByScore( $key, $start, $end ) {} * $redis->zRange('key', 0, -1, array('withscores' => TRUE)); // array('three' => 3) *
*/ - public function zRemRangeByRank( $key, $start, $end ) {} + public function zRemRangeByRank($key, $start, $end) + { + } /** * @see zRemRangeByRank() @@ -2533,7 +2784,9 @@ public function zRemRangeByRank( $key, $start, $end ) {} * @param int $end * @link https://redis.io/commands/zremrangebyscore */ - public function zDeleteRangeByRank( $key, $start, $end ) {} + public function zDeleteRangeByRank($key, $start, $end) + { + } /** * Returns the cardinality of an ordered set. @@ -2549,13 +2802,17 @@ public function zDeleteRangeByRank( $key, $start, $end ) {} * $redis->zCard('key'); // 3 *
*/ - public function zCard( $key ) {} + public function zCard($key) + { + } /** * @see zCard() * @param string $key */ - public function zSize( $key ) {} + public function zSize($key) + { + } /** * Returns the score of a given member in the specified sorted set. @@ -2570,7 +2827,9 @@ public function zSize( $key ) {} * $redis->zScore('key', 'val2'); // 2.5 *
*/ - public function zScore( $key, $member ) {} + public function zScore($key, $member) + { + } /** * Returns the rank of a given member in the specified sorted set, starting at 0 for the item @@ -2591,7 +2850,9 @@ public function zScore( $key, $member ) {} * $redis->zRevRank('key', 'two'); // 0 *
*/ - public function zRank( $key, $member ) {} + public function zRank($key, $member) + { + } /** * @see zRank() @@ -2600,7 +2861,9 @@ public function zRank( $key, $member ) {} * @return int the item's score * @link https://redis.io/commands/zrevrank */ - public function zRevRank( $key, $member ) {} + public function zRevRank($key, $member) + { + } /** * Increments the score of a member from a sorted set by a given amount. @@ -2618,7 +2881,9 @@ public function zRevRank( $key, $member ) {} * $redis->zIncrBy('key', 1, 'member1'); // 3.5 *
*/ - public function zIncrBy( $key, $value, $member ) {} + public function zIncrBy($key, $value, $member) + { + } /** * Creates an union of sorted sets given in second argument. @@ -2657,7 +2922,9 @@ public function zIncrBy( $key, $value, $member ) {} * $redis->zUnion('ko3', array('k1', 'k2'), array(5, 1)); // 4, 'ko3' => array('val0', 'val2', 'val3', 'val1') *
*/ - public function zUnion($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM') {} + public function zUnion($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM') + { + } /** * Creates an intersection of sorted sets given in second argument. @@ -2700,7 +2967,9 @@ public function zUnion($Output, $ZSetKeys, array $Weights = null, $aggregateFunc * $redis->zInter('ko4', array('k1', 'k2'), array(1, 5), 'max'); // 2, 'ko4' => array('val3', 'val1') *
*/ - public function zInter($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM') {} + public function zInter($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM') + { + } /** * Scan a sorted set for members, with optional pattern and count. @@ -2720,7 +2989,9 @@ public function zInter($Output, $ZSetKeys, array $Weights = null, $aggregateFunc * } *
*/ - public function zScan( $key, &$iterator, $pattern = null, $count = 0 ) {} + public function zScan($key, &$iterator, $pattern = null, $count = 0) + { + } /** * Adds a value to the hash stored at key. If this value is already in the hash, FALSE is returned. @@ -2742,7 +3013,9 @@ public function zScan( $key, &$iterator, $pattern = null, $count = 0 ) {} * $redis->hGet('h', 'key1'); // returns "plop" *
*/ - public function hSet( $key, $hashKey, $value ) {} + public function hSet($key, $hashKey, $value) + { + } /** * Adds a value to the hash stored at key only if this field isn't already in the hash. @@ -2760,7 +3033,9 @@ public function hSet( $key, $hashKey, $value ) {} * wasn't replaced. *
*/ - public function hSetNx( $key, $hashKey, $value ) {} + public function hSetNx($key, $hashKey, $value) + { + } /** * Gets a value from the hash stored at key. @@ -2771,7 +3046,9 @@ public function hSetNx( $key, $hashKey, $value ) {} * @return string The value, if the command executed successfully BOOL FALSE in case of failure * @link https://redis.io/commands/hget */ - public function hGet($key, $hashKey) {} + public function hGet($key, $hashKey) + { + } /** * Returns the length of a hash, in number of items @@ -2787,7 +3064,9 @@ public function hGet($key, $hashKey) {} * $redis->hLen('h'); // returns 2 *
*/ - public function hLen( $key ) {} + public function hLen($key) + { + } /** * Removes a values from the hash stored at key. @@ -2819,7 +3098,9 @@ public function hLen( $key ) {} * // } *
*/ - public function hDel( $key, $hashKey1, $hashKey2 = null, $hashKeyN = null ) {} + public function hDel($key, $hashKey1, $hashKey2 = null, $hashKeyN = null) + { + } /** * Returns the keys in a hash, as an array of strings. @@ -2850,7 +3131,9 @@ public function hDel( $key, $hashKey1, $hashKey2 = null, $hashKeyN = null ) {} * // The order is random and corresponds to redis' own internal representation of the set structure. *
*/ - public function hKeys( $key ) {} + public function hKeys($key) + { + } /** * Returns the values in a hash, as an array of strings. @@ -2881,7 +3164,9 @@ public function hKeys( $key ) {} * // The order is random and corresponds to redis' own internal representation of the set structure. *
*/ - public function hVals( $key ) {} + public function hVals($key) + { + } /** * Returns the whole hash, as an array of strings indexed by strings. @@ -2912,7 +3197,9 @@ public function hVals( $key ) {} * // The order is random and corresponds to redis' own internal representation of the set structure. *
*/ - public function hGetAll( $key ) {} + public function hGetAll($key) + { + } /** * Verify if the specified member exists in a key. @@ -2928,7 +3215,9 @@ public function hGetAll( $key ) {} * $redis->hExists('h', 'NonExistingKey'); // FALSE *
*/ - public function hExists( $key, $hashKey ) {} + public function hExists($key, $hashKey) + { + } /** * Increments the value of a member from a hash by a given amount. @@ -2945,7 +3234,9 @@ public function hExists( $key, $hashKey ) {} * $redis->hIncrBy('h', 'x', 1); // h[x] ← 2 + 1. Returns 3 *
*/ - public function hIncrBy( $key, $hashKey, $value ) {} + public function hIncrBy($key, $hashKey, $value) + { + } /** * Increment the float value of a hash field by the given amount @@ -2973,7 +3264,9 @@ public function hIncrBy( $key, $hashKey, $value ) {} * } *
*/ - public function hIncrByFloat( $key, $field, $increment ) {} + public function hIncrByFloat($key, $field, $increment) + { + } /** * Fills in a whole hash. Non-string values are converted to string, using the standard (string) cast. @@ -2990,7 +3283,9 @@ public function hIncrByFloat( $key, $field, $increment ) {} * $redis->hIncrBy('user:1', 'salary', 100); // Joe earns 100 more now. *
*/ - public function hMSet( $key, $hashKeys ) {} + public function hMSet($key, $hashKeys) + { + } /** * Retirieve the values associated to the specified fields in the hash. @@ -3008,7 +3303,9 @@ public function hMSet( $key, $hashKeys ) {} * $redis->hmGet('h', array('field1', 'field2')); // returns array('field1' => 'value1', 'field2' => 'value2') *
*/ - public function hMGet( $key, $hashKeys ) {} + public function hMGet($key, $hashKeys) + { + } /** * Scan a HASH value for members, with an optional pattern and count. @@ -3028,8 +3325,9 @@ public function hMGet( $key, $hashKeys ) {} * // } *
*/ - public function hScan( $key, &$iterator, $pattern = null, $count = 0 ) {} - + public function hScan($key, &$iterator, $pattern = null, $count = 0) + { + } /** * Get or Set the redis config keys. @@ -3046,7 +3344,9 @@ public function hScan( $key, &$iterator, $pattern = null, $count = 0 ) {} * $redis->config("SET", "dir", "/var/run/redis/dumps/"); *
*/ - public function config( $operation, $key, $value ) {} + public function config($operation, $key, $value) + { + } /** * @see eval() @@ -3055,7 +3355,9 @@ public function config( $operation, $key, $value ) {} * @param int $numKeys * @return mixed @see eval() */ - public function evaluate( $script, $args = array(), $numKeys = 0 ) {} + public function evaluate($script, $args = array(), $numKeys = 0) + { + } /** * Evaluate a LUA script serverside, from the SHA1 hash of the script instead of the script itself. @@ -3074,7 +3376,9 @@ public function evaluate( $script, $args = array(), $numKeys = 0 ) {} * $redis->evalSha($sha); // Returns 1 *
*/ - public function evalSha( $scriptSha, $args = array(), $numKeys = 0 ) {} + public function evalSha($scriptSha, $args = array(), $numKeys = 0) + { + } /** * @see evalSha() @@ -3082,7 +3386,9 @@ public function evalSha( $scriptSha, $args = array(), $numKeys = 0 ) {} * @param array $args * @param int $numKeys */ - public function evaluateSha( $scriptSha, $args = array(), $numKeys = 0 ) {} + public function evaluateSha($scriptSha, $args = array(), $numKeys = 0) + { + } /** * Execute the Redis SCRIPT command to perform various operations on the scripting subsystem. @@ -3106,7 +3412,9 @@ public function evaluateSha( $scriptSha, $args = array(), $numKeys = 0 ) {} * SCRIPT KILL will return true if a script was able to be killed and false if not * SCRIPT EXISTS will return an array with TRUE or FALSE for each passed script */ - public function script( $command, $script ) {} + public function script($command, $script) + { + } /** * The last error message (if any) @@ -3118,7 +3426,9 @@ public function script( $command, $script ) {} * // "ERR Error compiling script (new function): user_script:1: '=' expected near '-'" *
*/ - public function getLastError() {} + public function getLastError() + { + } /** * Clear the last error message @@ -3135,7 +3445,9 @@ public function getLastError() {} * // NULL *
*/ - public function clearLastError() {} + public function clearLastError() + { + } /** * A utility method to prefix the value with the prefix setting for phpredis. @@ -3147,7 +3459,9 @@ public function clearLastError() {} * $redis->_prefix('my-value'); // Will return 'my-prefix:my-value' *
*/ - public function _prefix( $value ) {} + public function _prefix($value) + { + } /** * A utility method to unserialize data with whatever serializer is set up. If there is no serializer set, the @@ -3162,7 +3476,9 @@ public function _prefix( $value ) {} * $redis->_unserialize('a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}'); // Will return Array(1,2,3) *
*/ - public function _unserialize( $value ) {} + public function _unserialize($value) + { + } /** * A utility method to serialize values manually. This method allows you to serialize a value with whatever @@ -3182,7 +3498,9 @@ public function _unserialize( $value ) {} * $redis->_serialize("foo"); // Returns 's:3:"foo";' *
*/ - public function _serialize( $value ) {} + public function _serialize($value) + { + } /** * Dump a key out of a redis database, the value of which can later be passed into redis using the RESTORE command. @@ -3196,7 +3514,9 @@ public function _serialize( $value ) {} * $val = $redis->dump('foo'); // $val will be the Redis encoded key value *
*/ - public function dump( $key ) {} + public function dump($key) + { + } /** * Restore a key from the result of a DUMP operation. @@ -3213,7 +3533,9 @@ public function dump( $key ) {} * $redis->restore('bar', 0, $val); // The key 'bar', will now be equal to the key 'foo' *
*/ - public function restore( $key, $ttl, $value ) {} + public function restore($key, $ttl, $value) + { + } /** * Migrates a key to a different Redis instance. @@ -3232,7 +3554,9 @@ public function restore( $key, $ttl, $value ) {} * $redis->migrate('backup', 6379, 'foo', 0, 3600); *
*/ - public function migrate( $host, $port, $key, $db, $timeout, $copy = false, $replace = false ) {} + public function migrate($host, $port, $key, $db, $timeout, $copy = false, $replace = false) + { + } /** * Return the current Redis server time. @@ -3248,7 +3572,9 @@ public function migrate( $host, $port, $key, $db, $timeout, $copy = false, $repl * // } *
*/ - public function time() {} + public function time() + { + } /** * Scan the keyspace for keys. @@ -3267,7 +3593,9 @@ public function time() {} * } *
*/ - public function scan( &$iterator, $pattern = null, $count = 0 ) {} + public function scan(&$iterator, $pattern = null, $count = 0) + { + } /** * Adds all the element arguments to the HyperLogLog data structure stored at the key. @@ -3277,7 +3605,9 @@ public function scan( &$iterator, $pattern = null, $count = 0 ) {} * @link https://redis.io/commands/pfadd * @example $redis->pfAdd('key', array('elem1', 'elem2')) */ - public function pfAdd( $key, array $elements ) {} + public function pfAdd($key, array $elements) + { + } /** * When called with a single key, returns the approximated cardinality computed by the HyperLogLog data @@ -3292,7 +3622,9 @@ public function pfAdd( $key, array $elements ) {} * $redis->pfCount('key1'); // int(2) * $redis->pfCount(array('key1', 'key2')); // int(3) */ - public function pfCount( $key ) {} + public function pfCount($key) + { + } /** * Merge multiple HyperLogLog values into an unique value that will approximate the cardinality @@ -3308,7 +3640,9 @@ public function pfCount( $key ) {} * $redis->pfMerge('key3', array('key1', 'key2')); * $redis->pfCount('key3'); // int(3) */ - public function pfMerge( $destkey, array $sourcekeys ) {} + public function pfMerge($destkey, array $sourcekeys) + { + } /** * Send arbitrary things to the redis server. @@ -3321,14 +3655,18 @@ public function pfMerge( $destkey, array $sourcekeys ) {} * $redis->rawCommand('GET", 'key'); // string(5) "value" *
*/ - public function rawCommand( $command, $arguments ) {} + public function rawCommand($command, $arguments) + { + } /** * Detect whether we're in ATOMIC/MULTI/PIPELINE mode. * @return int Either Redis::ATOMIC, Redis::MULTI or Redis::PIPELINE * @example $redis->getMode(); */ - public function getMode() {} + public function getMode() + { + } /** * Acknowledge one or more messages on behalf of a consumer group. @@ -3342,7 +3680,9 @@ public function getMode() {} * $obj_redis->xAck('stream', 'group1', ['1530063064286-0', '1530063064286-1']); *
*/ - public function xAck($stream, $group, $arr_messages) {} + public function xAck($stream, $group, $arr_messages) + { + } /** * Add a message to a stream. @@ -3360,7 +3700,9 @@ public function xAck($stream, $group, $arr_messages) {} * $obj_redis->xAdd('mystream', "*", ['field' => 'value'], 10, true); *
*/ - public function xAdd($str_key, $str_id, $arr_message, $i_maxlen = 0, $boo_approximate = false) {} + public function xAdd($str_key, $str_id, $arr_message, $i_maxlen = 0, $boo_approximate = false) + { + } /** * Claim ownership of one or more pending messages. @@ -3391,7 +3733,9 @@ public function xAdd($str_key, $str_id, $arr_message, $i_maxlen = 0, $boo_approx * ); *
*/ - public function xClaim($str_key, $str_group, $str_consumer, $min_idle_time, $arr_ids, $arr_options = []) {} + public function xClaim($str_key, $str_group, $str_consumer, $min_idle_time, $arr_ids, $arr_options = []) + { + } /** * Delete one or more messages from a stream. @@ -3404,7 +3748,9 @@ public function xClaim($str_key, $str_group, $str_consumer, $min_idle_time, $arr * $obj_redis->xDel('mystream', ['1530115304877-0', '1530115305731-0']); *
*/ - public function xDel($str_key, $arr_ids) {} + public function xDel($str_key, $arr_ids) + { + } /** * @param string $operation e.g.: 'HELP', 'SETID', 'DELGROUP', 'CREATE', 'DELCONSUMER' @@ -3421,7 +3767,9 @@ public function xDel($str_key, $arr_ids) {} * $obj_redis->xGroup('DESTROY', 'mystream', 'mygroup'); *
*/ - public function xGroup($operation, $str_key, $str_group, $str_msg_id = '', $boo_mkstream = false) {} + public function xGroup($operation, $str_key, $str_group, $str_msg_id = '', $boo_mkstream = false) + { + } /** * Get information about a stream or consumer groups. @@ -3435,7 +3783,9 @@ public function xGroup($operation, $str_key, $str_group, $str_msg_id = '', $boo_ * $obj_redis->xInfo('STREAM', 'mystream'); *
*/ - public function xInfo($operation, $str_stream, $str_group) {} + public function xInfo($operation, $str_stream, $str_group) + { + } /** * Get the length of a given stream. @@ -3447,7 +3797,9 @@ public function xInfo($operation, $str_stream, $str_group) {} * $obj_redis->xLen('mystream'); *
*/ - public function xLen($str_stream) {} + public function xLen($str_stream) + { + } /** * Get information about pending messages in a given stream. @@ -3465,7 +3817,9 @@ public function xLen($str_stream) {} * $obj_redis->xPending('mystream', 'mygroup', '-', '+', 1, 'consumer-1'); *
*/ - public function xPending($str_stream, $str_group, $str_start = null, $str_end = null, $i_count = null, $str_consumer = null) {} + public function xPending($str_stream, $str_group, $str_start = null, $str_end = null, $i_count = null, $str_consumer = null) + { + } /** * Get a range of messages from a given stream. @@ -3483,7 +3837,9 @@ public function xPending($str_stream, $str_group, $str_start = null, $str_end = * $obj_redis->xRange('mystream', '-', '+', 2); *
*/ - public function xRange($str_stream, $str_start, $str_end, $i_count = null) {} + public function xRange($str_stream, $str_start, $str_end, $i_count = null) + { + } /** * Read data from one or more streams and only return IDs greater than sent in the command. @@ -3497,7 +3853,9 @@ public function xRange($str_stream, $str_start, $str_end, $i_count = null) {} * $obj_redis->xRead(['stream1' => '1535222584555-0', 'stream2' => '1535222584555-0']); *
*/ - public function xRead($arr_streams, $i_count = null, $i_block = null) {} + public function xRead($arr_streams, $i_count = null, $i_block = null) + { + } /** * This method is similar to xRead except that it supports reading messages for a specific consumer group. @@ -3516,7 +3874,9 @@ public function xRead($arr_streams, $i_count = null, $i_block = null) {} * $obj_redis->xReadGroup('mygroup', 'consumer2', ['s1' => 0, 's2' => 0], 1, 1000); * */ - public function xReadGroup($str_group, $str_consumer, $arr_streams, $i_count = null, $i_block = null) {} + public function xReadGroup($str_group, $str_consumer, $arr_streams, $i_count = null, $i_block = null) + { + } /** * This is identical to xRange except the results come back in reverse order. Also note that Redis reverses the order of "start" and "end". @@ -3531,7 +3891,9 @@ public function xReadGroup($str_group, $str_consumer, $arr_streams, $i_count = n * $obj_redis->xRevRange('mystream', '+', '-'); * */ - public function xRevRange($str_stream, $str_end, $str_start, $i_count = null) {} + public function xRevRange($str_stream, $str_end, $str_start, $i_count = null) + { + } /** * Trim the stream length to a given maximum. If the "approximate" flag is pasesed, Redis will use your size as a hint but only trim trees in whole nodes (this is more efficient).. @@ -3548,12 +3910,17 @@ public function xRevRange($str_stream, $str_end, $str_start, $i_count = null) {} * $obj_redis->xTrim('mystream', 100, true); * */ - public function xTrim($str_stream, $i_max_len, $boo_approximate) {} + public function xTrim($str_stream, $i_max_len, $boo_approximate) + { + } } -class RedisException extends Exception {} +class RedisException extends Exception +{ +} -class RedisArray { +class RedisArray +{ /** * Constructor * @@ -3561,26 +3928,36 @@ class RedisArray { * @param array $opts Array of options * @link https://github.com/nicolasff/phpredis/blob/master/arrays.markdown */ - function __construct($hosts, array $opts = null) {} + public function __construct($hosts, array $opts = null) + { + } /** * @return array list of hosts for the selected array */ - public function _hosts() {} + public function _hosts() + { + } /** * @return string the name of the function used to extract key parts during consistent hashing */ - public function _function() {} + public function _function() + { + } /** * @param string $key The key for which you want to lookup the host * @return string the host to be used for a certain key */ - public function _target($key) {} + public function _target($key) + { + } /** * Use this function when a new node is added and keys need to be rehashed. */ - public function _rehash() {} + public function _rehash() + { + } } From e07ec5fe491825a7134bdec6e5a314e51891f94b Mon Sep 17 00:00:00 2001 From: Maksim Kamashev Date: Sun, 28 Jul 2019 22:57:05 +0300 Subject: [PATCH 75/97] Add missed methods #35 #30: - getHost - getPort - getDbNum - getTimeout - getReadTimeout - getPersistentID - getAuth - swapdb - slowLog - client - bzPopMax - bzPopMin - hStrLen - geoadd - geohash - geopos - geodist - georadius - georadiusbymember --- src/Redis.php | 565 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 540 insertions(+), 25 deletions(-) diff --git a/src/Redis.php b/src/Redis.php index da84d57..813a6f0 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -1,32 +1,10 @@ * @link https://github.com/ukko/phpredis-phpdoc - * - * @method eval( $script, $args = array(), $numKeys = 0 ) - * Evaluate a LUA script serverside - * @param string $script - * @param array $args - * @param int $numKeys - * @return mixed What is returned depends on what the LUA script itself returns, which could be a scalar value - * (int/string), or an array. Arrays that are returned can also contain other arrays, if that's how it was set up in - * your LUA script. If there is an error executing the LUA script, the getLastError() function can tell you the - * message that came back from Redis (e.g. compile error). - * @link https://redis.io/commands/eval - * @example - *
- *  $redis->eval("return 1"); // Returns an integer: 1
- *  $redis->eval("return {1,2,3}"); // Returns Array(1,2,3)
- *  $redis->del('mylist');
- *  $redis->rpush('mylist','a');
- *  $redis->rpush('mylist','b');
- *  $redis->rpush('mylist','c');
- *  // Nested response:  Array(1,2,3,Array('a','b','c'));
- *  $redis->eval("return {1,2,3,redis.call('lrange','mylist',0,-1)}}");
- * 
- * */ class Redis { @@ -118,6 +96,73 @@ public function isConnected() { } + /** + * Retrieve our host or unix socket that we're connected to + * + * @return mixed The host or unix socket we're connected to or FALSE if we're not connected + */ + public function getHost() + { + } + + /** + * Get the port we're connected to + * + * @return mixed Returns the port we're connected to or FALSE if we're not connected + */ + public function getPort() + { + } + + /** + * Get the database number phpredis is pointed to + * + * @return mixed Returns the database number (LONG) phpredis thinks it's pointing to + * or FALSE if we're not connected + */ + public function getDbNum() + { + } + + /** + * Get the (write) timeout in use for phpredis + * + * @return mixed The timeout (DOUBLE) specified in our connect call or FALSE if we're not connected + */ + public function getTimeout() + { + } + + /** + * Get the read timeout specified to phpredis or FALSE if we're not connected + * + * @return mixed Returns the read timeout (which can be set using setOption and Redis::OPT_READ_TIMEOUT) + * or FALSE if we're not connected + */ + public function getReadTimeout() + { + } + + /** + * Gets the persistent ID that phpredis is using + * + * @return mixed Returns the persistent id phpredis is using (which will only be set if connected with pconnect), + * NULL if we're not using a persistent ID, and FALSE if we're not connected + */ + public function getPersistentID() + { + } + + /** + * Get the password used to authenticate the phpredis connection + * + * @return mixed Returns the password used to authenticate a phpredis session or NULL if none was used, + * and FALSE if we're not connected + */ + public function getAuth() + { + } + /** * @see connect() * @param string $host @@ -185,6 +230,25 @@ public function close() { } + /** + * Swap one Redis database with another atomically + * + * Note: Requires Redis >= 4.0.0 + * + * @param int $db1 + * @param int $db2 + * @return bool TRUE on success and FALSE on failure + * + * @link https://redis.io/commands/swapdb + * @since >= 4.0 + * @example + * // Swaps DB 0 with DB 1 atomically + * $redis->swapdb(0, 1); + */ + public function swapdb(int $db1, int $db2) + { + } + /** * Set client option. * @@ -1908,6 +1972,37 @@ public function slaveof($host = '127.0.0.1', $port = 6379) { } + /** + * Access the Redis slowLog + * + * @param string $operation This can be either GET, LEN, or RESET + * @param int|null $length If executing a SLOWLOG GET command, you can pass an optional length. + * @return mixed The return value of SLOWLOG will depend on which operation was performed. + * - SLOWLOG GET: Array of slowLog entries, as provided by Redis + * - SLOGLOG LEN: Integer, the length of the slowLog + * - SLOWLOG RESET: Boolean, depending on success + * + * @example + *
+     * // Get ten slowLog entries
+     * $redis->slowLog('get', 10);
+     * // Get the default number of slowLog entries
+     *
+     * $redis->slowLog('get');
+     * // Reset our slowLog
+     * $redis->slowLog('reset');
+     *
+     * // Retrieve slowLog length
+     * $redis->slowLog('len');
+     * 
+ * + * @link https://redis.io/commands/slowlog + */ + public function slowLog(string $operation, int $length = null) + { + } + + /** * Describes the object pointed to by a key. * The information to retrieve (string) and the key (string). @@ -2978,6 +3073,7 @@ public function zInter($Output, $ZSetKeys, array $Weights = null, $aggregateFunc * @param string $pattern String (optional), the pattern to match. * @param int $count How many keys to return per iteration (Redis might return a different number). * @return array PHPRedis will return matching keys from Redis, or FALSE when iteration is complete. + * * @link https://redis.io/commands/zscan * @example *
@@ -2993,6 +3089,48 @@ public function zScan($key, &$iterator, $pattern = null, $count = 0)
     {
     }
 
+    /**
+     * Block until Redis can pop the highest or lowest scoring members from one or more ZSETs.
+     * There are two commands (BZPOPMIN and BZPOPMAX for popping the lowest and highest scoring elements respectively.)
+     *
+     * @param string|array $key1
+     * @param string|array $key2 ...
+     * @param int $timeout
+     * @return array Either an array with the key member and score of the higest or lowest element or an empty array
+     * if the timeout was reached without an element to pop.
+     *
+     * @since >= 5.0
+     * @link https://redis.io/commands/bzpopmax
+     * @example
+     * 
+     * // Wait up to 5 seconds to pop the *lowest* scoring member from sets `zs1` and `zs2`.
+     * $redis->bzPopMin(['zs1', 'zs2'], 5);
+     * $redis->bzPopMin('zs1', 'zs2', 5);
+     *
+     * // Wait up to 5 seconds to pop the *highest* scoring member from sets `zs1` and `zs2`
+     * $redis->bzPopMax(['zs1', 'zs2'], 5);
+     * $redis->bzPopMax('zs1', 'zs2', 5);
+     * 
+ */ + public function bzPopMax($key1, $key2, $timeout) + { + } + + /** + * @param string|array $key1 + * @param string|array $key2 ... + * @param int $timeout + * @return array Either an array with the key member and score of the higest or lowest element or an empty array + * if the timeout was reached without an element to pop. + * + * @see @bzPopMax + * @since >= 5.0 + * @link https://redis.io/commands/bzpopmin + */ + public function bzPopMin($key1, $key2, $timeout) + { + } + /** * Adds a value to the hash stored at key. If this value is already in the hash, FALSE is returned. * @@ -3000,8 +3138,9 @@ public function zScan($key, &$iterator, $pattern = null, $count = 0) * @param string $hashKey * @param string $value * @return int - * 1 if value didn't exist and was added successfully, - * 0 if the value was already present and was replaced, FALSE if there was an error. + * - 1 if value didn't exist and was added successfully, + * - 0 if the value was already present and was replaced, FALSE if there was an error. + * * @link https://redis.io/commands/hset * @example *
@@ -3024,6 +3163,7 @@ public function hSet($key, $hashKey, $value)
      * @param   string  $hashKey
      * @param   string  $value
      * @return  bool    TRUE if the field was set, FALSE if it was already present.
+     *
      * @link    https://redis.io/commands/hsetnx
      * @example
      * 
@@ -3044,6 +3184,7 @@ public function hSetNx($key, $hashKey, $value)
      * @param   string  $key
      * @param   string  $hashKey
      * @return  string  The value, if the command executed successfully BOOL FALSE in case of failure
+     *
      * @link    https://redis.io/commands/hget
      */
     public function hGet($key, $hashKey)
@@ -3055,6 +3196,7 @@ public function hGet($key, $hashKey)
      *
      * @param   string  $key
      * @return  int     the number of items in a hash, FALSE if the key doesn't exist or isn't a hash.
+     *
      * @link    https://redis.io/commands/hlen
      * @example
      * 
@@ -3077,6 +3219,7 @@ public function hLen($key)
      * @param   string  $hashKey2
      * @param   string  $hashKeyN
      * @return  int     Number of deleted fields
+     *
      * @link    https://redis.io/commands/hdel
      * @example
      * 
@@ -3107,6 +3250,7 @@ public function hDel($key, $hashKey1, $hashKey2 = null, $hashKeyN = null)
      *
      * @param   string  $key
      * @return  array   An array of elements, the keys of the hash. This works like PHP's array_keys().
+     *
      * @link    https://redis.io/commands/hkeys
      * @example
      * 
@@ -3140,6 +3284,7 @@ public function hKeys($key)
      *
      * @param   string  $key
      * @return  array   An array of elements, the values of the hash. This works like PHP's array_values().
+     *
      * @link    https://redis.io/commands/hvals
      * @example
      * 
@@ -3173,6 +3318,7 @@ public function hVals($key)
      *
      * @param   string  $key
      * @return  array   An array of elements, the contents of the hash.
+     *
      * @link    https://redis.io/commands/hgetall
      * @example
      * 
@@ -3207,6 +3353,7 @@ public function hGetAll($key)
      * @param   string  $key
      * @param   string  $hashKey
      * @return  bool:   If the member exists in the hash table, return TRUE, otherwise return FALSE.
+     *
      * @link    https://redis.io/commands/hexists
      * @example
      * 
@@ -3226,6 +3373,7 @@ public function hExists($key, $hashKey)
      * @param   string  $hashKey
      * @param   int     $value (integer) value that will be added to the member's value
      * @return  int     the new value
+     *
      * @link    https://redis.io/commands/hincrby
      * @example
      * 
@@ -3240,10 +3388,12 @@ public function hIncrBy($key, $hashKey, $value)
 
     /**
      * Increment the float value of a hash field by the given amount
+     *
      * @param   string  $key
      * @param   string  $field
      * @param   float   $increment
      * @return  float
+     *
      * @link    https://redis.io/commands/hincrbyfloat
      * @example
      * 
@@ -3275,6 +3425,7 @@ public function hIncrByFloat($key, $field, $increment)
      * @param   string  $key
      * @param   array   $hashKeys key → value array
      * @return  bool
+     *
      * @link    https://redis.io/commands/hmset
      * @example
      * 
@@ -3294,6 +3445,7 @@ public function hMSet($key, $hashKeys)
      * @param   array   $hashKeys
      * @return  array   Array An array of elements, the values of the specified fields in the hash,
      * with the hash keys as array keys.
+     *
      * @link    https://redis.io/commands/hmget
      * @example
      * 
@@ -3309,11 +3461,13 @@ public function hMGet($key, $hashKeys)
 
     /**
      * Scan a HASH value for members, with an optional pattern and count.
+     *
      * @param   string    $key
      * @param   int       $iterator
      * @param   string    $pattern    Optional pattern to match against.
      * @param   int       $count      How many keys to return in a go (only a sugestion to Redis).
      * @return  array     An array of members that match our pattern.
+     *
      * @link    https://redis.io/commands/hscan
      * @example
      * 
@@ -3329,6 +3483,302 @@ public function hScan($key, &$iterator, $pattern = null, $count = 0)
     {
     }
 
+    /**
+     * Get the string length of the value associated with field in the hash stored at key
+     *
+     * @param string $key
+     * @param string $field
+     * @return int the string length of the value associated with field, or zero when field is not present in the hash
+     * or key does not exist at all.
+     *
+     * @link https://redis.io/commands/hstrlen
+     * @since >= 3.2
+     */
+    public function hStrLen(string $key, string $field)
+    {
+    }
+
+    /**
+     * Add one or more geospatial items to the specified key.
+     * This function must be called with at least one longitude, latitude, member triplet.
+     *
+     * @param string $key
+     * @param float $longitude
+     * @param float $latitude
+     * @param string string $member
+     * @return int The number of elements added to the geospatial key
+     *
+     * @link https://redis.io/commands/geoadd
+     * @since >=3.2
+     *
+     * @example
+     * 
+     * $redis->del("myplaces");
+     *
+     * // Since the key will be new, $result will be 2
+     * $result = $redis->geoAdd(
+     *   "myplaces",
+     *   -122.431, 37.773, "San Francisco",
+     *   -157.858, 21.315, "Honolulu"
+     * ); // 2
+     * 
+ */ + public function geoadd($key, $longitude, $latitude, $member) + { + } + + /** + * Retrieve Geohash strings for one or more elements of a geospatial index. + + * @param string $key + * @param string $member ... + * @return array One or more Redis Geohash encoded strings + * + * @link https://redis.io/commands/geohash + * @since >=3.2 + * + * @example + *
+     * $redis->geoAdd("hawaii", -157.858, 21.306, "Honolulu", -156.331, 20.798, "Maui");
+     * $hashes = $redis->geoHash("hawaii", "Honolulu", "Maui");
+     * var_dump($hashes);
+     * // Output: array(2) {
+     * //   [0]=>
+     * //   string(11) "87z9pyek3y0"
+     * //   [1]=>
+     * //   string(11) "8e8y6d5jps0"
+     * // }
+     * 
+ */ + public function geohash($key, ...$member) + { + } + + /** + * Return longitude, latitude positions for each requested member. + * + * @param string $key + * @param string $member + * @return array One or more longitude/latitude positions + * + * @link https://redis.io/commands/geopos + * @since >=3.2 + * + * @example + *
+     * $redis->geoAdd("hawaii", -157.858, 21.306, "Honolulu", -156.331, 20.798, "Maui");
+     * $positions = $redis->geoPos("hawaii", "Honolulu", "Maui");
+     * var_dump($positions);
+     *
+     * // Output:
+     * array(2) {
+     *  [0]=> array(2) {
+     *      [0]=> string(22) "-157.85800248384475708"
+     *      [1]=> string(19) "21.3060004581273077"
+     *  }
+     *  [1]=> array(2) {
+     *      [0]=> string(22) "-156.33099943399429321"
+     *      [1]=> string(20) "20.79799924753607598"
+     *  }
+     * }
+     * 
+ */ + public function geopos(string $key, string $member) + { + } + + /** + * Return the distance between two members in a geospatial set. + * + * If units are passed it must be one of the following values: + * - 'm' => Meters + * - 'km' => Kilometers + * - 'mi' => Miles + * - 'ft' => Feet + * + * @param string $key + * @param string $member1 + * @param string $member2 + * @param string|null $unit + * @return float The distance between the two passed members in the units requested (meters by default) + * + * @link https://redis.io/commands/geodist + * @since >=3.2 + * + * @example + *
+     * $redis->geoAdd("hawaii", -157.858, 21.306, "Honolulu", -156.331, 20.798, "Maui");
+     *
+     * $meters = $redis->geoDist("hawaii", "Honolulu", "Maui");
+     * $kilometers = $redis->geoDist("hawaii", "Honolulu", "Maui", 'km');
+     * $miles = $redis->geoDist("hawaii", "Honolulu", "Maui", 'mi');
+     * $feet = $redis->geoDist("hawaii", "Honolulu", "Maui", 'ft');
+     *
+     * echo "Distance between Honolulu and Maui:\n";
+     * echo "  meters    : $meters\n";
+     * echo "  kilometers: $kilometers\n";
+     * echo "  miles     : $miles\n";
+     * echo "  feet      : $feet\n";
+     *
+     * // Bad unit
+     * $inches = $redis->geoDist("hawaii", "Honolulu", "Maui", 'in');
+     * echo "Invalid unit returned:\n";
+     * var_dump($inches);
+     *
+     * // Output
+     * Distance between Honolulu and Maui:
+     * meters    : 168275.204
+     * kilometers: 168.2752
+     * miles     : 104.5616
+     * feet      : 552084.0028
+     * Invalid unit returned:
+     * bool(false)
+     * 
+ */ + public function geodist($key, $member1, $member2, $unit = null) + { + } + + /** + * Return members of a set with geospatial information that are within the radius specified by the caller. + * + * @param $key + * @param $longitude + * @param $latitude + * @param $radius + * @param $unit + * @param array|null $options + * |Key |Value |Description | + * |------------|---------------|---------------------------------------------------| + * |COUNT |integer > 0 |Limit how many results are returned | + * | |WITHCOORD |Return longitude and latitude of matching members | + * | |WITHDIST |Return the distance from the center | + * | |WITHHASH |Return the raw geohash-encoded score | + * | |ASC |Sort results in ascending order | + * | |DESC |Sort results in descending order | + * |STORE |key |Store results in key | + * |STOREDIST |key |Store the results as distances in key | + * Note: It doesn't make sense to pass both ASC and DESC options but if both are passed + * the last one passed will be used. + * Note: When using STORE[DIST] in Redis Cluster, the store key must has to the same slot as + * the query key or you will get a CROSSLOT error. + * @return mixed When no STORE option is passed, this function returns an array of results. + * If it is passed this function returns the number of stored entries. + * + * @link https://redis.io/commands/georadius + * @since >= 3.2 + * @example + *
+     * // Add some cities
+     * $redis->geoAdd("hawaii", -157.858, 21.306, "Honolulu", -156.331, 20.798, "Maui");
+     *
+     * echo "Within 300 miles of Honolulu:\n";
+     * var_dump($redis->geoRadius("hawaii", -157.858, 21.306, 300, 'mi'));
+     *
+     * echo "\nWithin 300 miles of Honolulu with distances:\n";
+     * $options = ['WITHDIST'];
+     * var_dump($redis->geoRadius("hawaii", -157.858, 21.306, 300, 'mi', $options));
+     *
+     * echo "\nFirst result within 300 miles of Honolulu with distances:\n";
+     * $options['count'] = 1;
+     * var_dump($redis->geoRadius("hawaii", -157.858, 21.306, 300, 'mi', $options));
+     *
+     * echo "\nFirst result within 300 miles of Honolulu with distances in descending sort order:\n";
+     * $options[] = 'DESC';
+     * var_dump($redis->geoRadius("hawaii", -157.858, 21.306, 300, 'mi', $options));
+     *
+     * // Output
+     * Within 300 miles of Honolulu:
+     * array(2) {
+     *  [0]=> string(8) "Honolulu"
+     *  [1]=> string(4) "Maui"
+     * }
+     *
+     * Within 300 miles of Honolulu with distances:
+     * array(2) {
+     *     [0]=>
+     *   array(2) {
+     *         [0]=>
+     *     string(8) "Honolulu"
+     *         [1]=>
+     *     string(6) "0.0002"
+     *   }
+     *   [1]=>
+     *   array(2) {
+     *         [0]=>
+     *     string(4) "Maui"
+     *         [1]=>
+     *     string(8) "104.5615"
+     *   }
+     * }
+     *
+     * First result within 300 miles of Honolulu with distances:
+     * array(1) {
+     *     [0]=>
+     *   array(2) {
+     *         [0]=>
+     *     string(8) "Honolulu"
+     *         [1]=>
+     *     string(6) "0.0002"
+     *   }
+     * }
+     *
+     * First result within 300 miles of Honolulu with distances in descending sort order:
+     * array(1) {
+     *     [0]=>
+     *   array(2) {
+     *         [0]=>
+     *     string(4) "Maui"
+     *         [1]=>
+     *     string(8) "104.5615"
+     *   }
+     * }
+     * 
+ */ + public function georadius($key, $longitude, $latitude, $radius, $unit, array $options = null) + { + } + + /** + * This method is identical to geoRadius except that instead of passing a longitude and latitude as the "source" + * you pass an existing member in the geospatial set. + * @param string $key + * @param string $member + * @param $radius + * @param $units + * @param array|null $options see georadius + * @return array The zero or more entries that are close enough to the member given the distance and radius specified + * + * @link https://redis.io/commands/georadiusbymember + * @since >= 3.2 + * @see georadius + * @example + *
+     * $redis->geoAdd("hawaii", -157.858, 21.306, "Honolulu", -156.331, 20.798, "Maui");
+     *
+     * echo "Within 300 miles of Honolulu:\n";
+     * var_dump($redis->geoRadiusByMember("hawaii", "Honolulu", 300, 'mi'));
+     *
+     * echo "\nFirst match within 300 miles of Honolulu:\n";
+     * var_dump($redis->geoRadiusByMember("hawaii", "Honolulu", 300, 'mi', ['count' => 1]));
+     *
+     * // Output
+     * Within 300 miles of Honolulu:
+     * array(2) {
+     *  [0]=> string(8) "Honolulu"
+     *  [1]=> string(4) "Maui"
+     * }
+     *
+     * First match within 300 miles of Honolulu:
+     * array(1) {
+     *  [0]=> string(8) "Honolulu"
+     * }
+     * 
+ */ + public function georadiusbymember($key, $member, $radius, $units, array $options = null) + { + } + /** * Get or Set the redis config keys. * @@ -3348,6 +3798,32 @@ public function config($operation, $key, $value) { } + /** + * Evaluate a LUA script serverside + * @param string $script + * @param array $args + * @param int $numKeys + * @return mixed What is returned depends on what the LUA script itself returns, which could be a scalar value + * (int/string), or an array. Arrays that are returned can also contain other arrays, if that's how it was set up in + * your LUA script. If there is an error executing the LUA script, the getLastError() function can tell you the + * message that came back from Redis (e.g. compile error). + * @link https://redis.io/commands/eval + * @example + *
+     *  $redis->eval("return 1"); // Returns an integer: 1
+     *  $redis->eval("return {1,2,3}"); // Returns Array(1,2,3)
+     *  $redis->del('mylist');
+     *  $redis->rpush('mylist','a');
+     *  $redis->rpush('mylist','b');
+     *  $redis->rpush('mylist','c');
+     *  // Nested response:  Array(1,2,3,Array('a','b','c'));
+     *  $redis->eval("return {1,2,3,redis.call('lrange','mylist',0,-1)}}");
+     * 
+ */ + public function eval($script, $args = array(), $numKeys = 0) + { + } + /** * @see eval() * @param string $script @@ -3395,6 +3871,7 @@ public function evaluateSha($scriptSha, $args = array(), $numKeys = 0) * @param string $command load | flush | kill | exists * @param string $script * @return mixed + * * @link https://redis.io/commands/script-load * @link https://redis.io/commands/script-kill * @link https://redis.io/commands/script-flush @@ -3419,6 +3896,7 @@ public function script($command, $script) /** * The last error message (if any) * @return string A string with the last returned script based error message, or NULL if there is no error + * * @example *
      * $redis->eval('this-is-not-lua');
@@ -3434,6 +3912,7 @@ public function getLastError()
      * Clear the last error message
      *
      * @return bool true
+     *
      * @example
      * 
      * $redis->set('x', 'a');
@@ -3449,6 +3928,41 @@ public function clearLastError()
     {
     }
 
+    /**
+     * Issue the CLIENT command with various arguments.
+     * The Redis CLIENT command can be used in four ways:
+     * - CLIENT LIST
+     * - CLIENT GETNAME
+     * - CLIENT SETNAME [name]
+     * - CLIENT KILL [ip:port]
+     *
+     * @param string $command
+     * @param string $value
+     * @return mixed This will vary depending on which client command was executed:
+     * - CLIENT LIST will return an array of arrays with client information.
+     * - CLIENT GETNAME will return the client name or false if none has been set
+     * - CLIENT SETNAME will return true if it can be set and false if not
+     * - CLIENT KILL will return true if the client can be killed, and false if not
+     *
+     * Note: phpredis will attempt to reconnect so you can actually kill your own connection but may not notice losing it!
+     *
+     * @link https://redis.io/commands/client-list
+     * @link https://redis.io/commands/client-getname
+     * @link https://redis.io/commands/client-setname
+     * @link https://redis.io/commands/client-kill
+     *
+     * @example
+     * 
+     * $redis->client('list'); // Get a list of clients
+     * $redis->client('getname'); // Get the name of the current connection
+     * $redis->client('setname', 'somename'); // Set the name of the current connection
+     * $redis->client('kill', ); // Kill the process at ip:port
+     * 
+ */ + public function client($command, $value) + { + } + /** * A utility method to prefix the value with the prefix setting for phpredis. * @param mixed $value The value you wish to prefix @@ -3913,6 +4427,7 @@ public function xRevRange($str_stream, $str_end, $str_start, $i_count = null) public function xTrim($str_stream, $i_max_len, $boo_approximate) { } + } class RedisException extends Exception From 89d0df9319f6700191dde0f78cabc7b5659e52b5 Mon Sep 17 00:00:00 2001 From: Maksim Kamashev Date: Sun, 28 Jul 2019 23:39:52 +0300 Subject: [PATCH 76/97] Add deprecate tag #52 --- src/Redis.php | 275 +++++++++++++++++++++++++++++++------------------- 1 file changed, 171 insertions(+), 104 deletions(-) diff --git a/src/Redis.php b/src/Redis.php index 813a6f0..6893e0b 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -165,6 +165,8 @@ public function getAuth() /** * @see connect() + * @deprecated use Redis::connect() + * * @param string $host * @param int $port * @param float $timeout @@ -211,6 +213,8 @@ public function pconnect($host, $port = 6379, $timeout = 0.0, $persistent_id = n /** * @see pconnect() + * @deprecated use Redis::pconnect() + * * @param string $host * @param int $port * @param float $timeout @@ -393,19 +397,19 @@ public function setnx($key, $value) /** * Remove specified keys. * - * @param string|array $key1 An array of keys, or an undefined number of parameters, each a key: key1 key2 key3 ... keyN - * @param string $key2 ... - * @param string $key3 ... - * @return int Number of keys deleted. - * @link https://redis.io/commands/del + * @param string|array $key1 An array of keys, or an undefined number of parameters, each a key: key1 key2 key3 ... keyN + * @param string $key2 ... + * @param string $key3 ... + * @return int Number of keys deleted + * @link https://redis.io/commands/del * @example *
      * $redis->set('key1', 'val1');
      * $redis->set('key2', 'val2');
      * $redis->set('key3', 'val3');
      * $redis->set('key4', 'val4');
-     * $redis->delete('key1', 'key2');          // return 2
-     * $redis->delete(array('key3', 'key4'));   // return 2
+     * $redis->del('key1', 'key2');          // return 2
+     * $redis->del(array('key3', 'key4'));   // return 2
      * 
*/ public function del($key1, $key2 = null, $key3 = null) @@ -414,10 +418,12 @@ public function del($key1, $key2 = null, $key3 = null) /** * @see del() + * @deprecated use Redis::del() + * * @param string|array $key1 * @param string $key2 * @param string $key3 - * @return int Number of keys deleted. + * @return int Number of keys deleted */ public function delete($key1, $key2 = null, $key3 = null) { @@ -749,25 +755,6 @@ public function decrBy($key, $value) { } - /** - * Get the values of all the specified keys. If one or more keys dont exist, the array will contain FALSE at the - * position of the key. - * - * @param array $keys Array containing the list of the keys - * @return array Array containing the values related to keys in argument - * @example - *
-     * $redis->set('key1', 'value1');
-     * $redis->set('key2', 'value2');
-     * $redis->set('key3', 'value3');
-     * $redis->getMultiple(array('key1', 'key2', 'key3')); // array('value1', 'value2', 'value3');
-     * $redis->getMultiple(array('key0', 'key1', 'key5')); // array(`FALSE`, 'value2', `FALSE`);
-     * 
- */ - public function getMultiple(array $keys) - { - } - /** * Adds the string values to the head (left) of the list. Creates the list if the key didn't exist. * If the key exists and is not a list, FALSE is returned. @@ -831,7 +818,7 @@ public function rPush($key, $value1, $value2 = null, $valueN = null) * @link https://redis.io/commands/lpushx * @example *
-     * $redis->delete('key1');
+     * $redis->del('key1');
      * $redis->lPushx('key1', 'A');     // returns 0
      * $redis->lPush('key1', 'A');      // returns 1
      * $redis->lPushx('key1', 'B');     // returns 2
@@ -852,7 +839,7 @@ public function lPushx($key, $value)
      * @link    https://redis.io/commands/rpushx
      * @example
      * 
-     * $redis->delete('key1');
+     * $redis->del('key1');
      * $redis->rPushx('key1', 'A'); // returns 0
      * $redis->rPush('key1', 'A'); // returns 1
      * $redis->rPushx('key1', 'B'); // returns 2
@@ -916,7 +903,7 @@ public function rPop($key)
      * 
      * // Non blocking feature
      * $redis->lPush('key1', 'A');
-     * $redis->delete('key2');
+     * $redis->del('key2');
      *
      * $redis->blPop('key1', 'key2', 10); // array('key1', 'A')
      * // OR
@@ -929,7 +916,7 @@ public function rPop($key)
      * // Blocking feature
      *
      * // process 1
-     * $redis->delete('key1');
+     * $redis->del('key1');
      * $redis->blPop('key1', 10);
      * // blocking for 10 seconds
      *
@@ -960,7 +947,7 @@ public function blPop(array $keys, $timeout)
      * 
      * // Non blocking feature
      * $redis->lPush('key1', 'A');
-     * $redis->delete('key2');
+     * $redis->del('key2');
      *
      * $redis->blPop('key1', 'key2', 10); // array('key1', 'A')
      * // OR
@@ -973,7 +960,7 @@ public function blPop(array $keys, $timeout)
      * // Blocking feature
      *
      * // process 1
-     * $redis->delete('key1');
+     * $redis->del('key1');
      * $redis->blPop('key1', 10);
      * // blocking for 10 seconds
      *
@@ -1011,9 +998,11 @@ public function lLen($key)
     }
 
     /**
-     * @see     lLen()
-     * @param   string    $key
+     * @see lLen()
      * @link    https://redis.io/commands/llen
+     * @deprecated use Redis::lLen()
+     *
+     * @param   string    $key
      */
     public function lSize($key)
     {
@@ -1027,15 +1016,16 @@ public function lSize($key)
      * @param int       $index
      * @return String the element at this index
      * Bool FALSE if the key identifies a non-string data type, or no value corresponds to this index in the list Key.
+     *
      * @link    https://redis.io/commands/lindex
      * @example
      * 
      * $redis->rPush('key1', 'A');
      * $redis->rPush('key1', 'B');
      * $redis->rPush('key1', 'C');  // key1 => [ 'A', 'B', 'C' ]
-     * $redis->lGet('key1', 0);     // 'A'
-     * $redis->lGet('key1', -1);    // 'C'
-     * $redis->lGet('key1', 10);    // `FALSE`
+     * $redis->lIndex('key1', 0);     // 'A'
+     * $redis->lIndex('key1', -1);    // 'C'
+     * $redis->lIndex('key1', 10);    // `FALSE`
      * 
*/ public function lIndex($key, $index) @@ -1044,9 +1034,11 @@ public function lIndex($key, $index) /** * @see lIndex() - * @param string $key - * @param int $index - * @link https://redis.io/commands/lindex + * @link https://redis.io/commands/lindex + * @deprecated use Redis::lIndex() + * + * @param string $key + * @param int $index */ public function lGet($key, $index) { @@ -1066,9 +1058,9 @@ public function lGet($key, $index) * $redis->rPush('key1', 'A'); * $redis->rPush('key1', 'B'); * $redis->rPush('key1', 'C'); // key1 => [ 'A', 'B', 'C' ] - * $redis->lGet('key1', 0); // 'A' + * $redis->lIndex('key1', 0); // 'A' * $redis->lSet('key1', 0, 'X'); - * $redis->lGet('key1', 0); // 'X' + * $redis->lIndex('key1', 0); // 'X' *
*/ public function lSet($key, $index, $value) @@ -1099,6 +1091,8 @@ public function lRange($key, $start, $end) /** * @see lRange() * @link https://redis.io/commands/lrange + * @deprecated use Redis::lRange() + * * @param string $key * @param int $start * @param int $end @@ -1132,6 +1126,8 @@ public function lTrim($key, $start, $stop) /** * @see lTrim() * @link https://redis.io/commands/ltrim + * @deprecated use Redis::lTrim() + * * @param string $key * @param int $start * @param int $stop @@ -1170,10 +1166,12 @@ public function lRem($key, $value, $count) /** * @see lRem - * @link https://redis.io/commands/lremove - * @param string $key - * @param string $value - * @param int $count + * @link https://redis.io/commands/lremove + * @deprecated use Redis::lRem() + * + * @param string $key + * @param string $value + * @param int $count */ public function lRemove($key, $value, $count) { @@ -1192,7 +1190,7 @@ public function lRemove($key, $value, $count) * @link https://redis.io/commands/linsert * @example *
-     * $redis->delete('key1');
+     * $redis->del('key1');
      * $redis->lInsert('key1', Redis::AFTER, 'A', 'X');     // 0
      *
      * $redis->lPush('key1', 'A');
@@ -1259,6 +1257,8 @@ public function sRem($key, $member1, $member2 = null, $memberN = null)
     /**
      * @see sRem()
      * @link    https://redis.io/commands/srem
+     * @deprecated use Redis::sRem()
+     *
      * @param   string  $key
      * @param   string  $member1
      * @param   string  $member2
@@ -1316,6 +1316,8 @@ public function sIsMember($key, $value)
     /**
      * @see sIsMember()
      * @link    https://redis.io/commands/sismember
+     * @deprecated use Redis::sIsMember()
+     *
      * @param   string  $key
      * @param   string  $value
      */
@@ -1479,7 +1481,7 @@ public function sInterStore($dstKey, $key1, $key2, $keyN = null)
      * @link    https://redis.io/commands/sunionstore
      * @example
      * 
-     * $redis->delete('s0', 's1', 's2');
+     * $redis->del('s0', 's1', 's2');
      *
      * $redis->sAdd('s0', '1');
      * $redis->sAdd('s0', '2');
@@ -1517,7 +1519,7 @@ public function sUnion($key1, $key2, $keyN = null)
      * @link    https://redis.io/commands/sunionstore
      * @example
      * 
-     * $redis->delete('s0', 's1', 's2');
+     * $redis->del('s0', 's1', 's2');
      *
      * $redis->sAdd('s0', '1');
      * $redis->sAdd('s0', '2');
@@ -1556,7 +1558,7 @@ public function sUnionStore($dstKey, $key1, $key2, $keyN = null)
      * @link    https://redis.io/commands/sdiff
      * @example
      * 
-     * $redis->delete('s0', 's1', 's2');
+     * $redis->del('s0', 's1', 's2');
      *
      * $redis->sAdd('s0', '1');
      * $redis->sAdd('s0', '2');
@@ -1591,7 +1593,7 @@ public function sDiff($key1, $key2, $keyN = null)
      * @link    https://redis.io/commands/sdiffstore
      * @example
      * 
-     * $redis->delete('s0', 's1', 's2');
+     * $redis->del('s0', 's1', 's2');
      *
      * $redis->sAdd('s0', '1');
      * $redis->sAdd('s0', '2');
@@ -1625,7 +1627,7 @@ public function sDiffStore($dstKey, $key1, $key2, $keyN = null)
      * @link    https://redis.io/commands/smembers
      * @example
      * 
-     * $redis->delete('s');
+     * $redis->del('s');
      * $redis->sAdd('s', 'a');
      * $redis->sAdd('s', 'b');
      * $redis->sAdd('s', 'a');
@@ -1649,9 +1651,11 @@ public function sMembers($key)
 
     /**
      * @see sMembers()
+     * @link    https://redis.io/commands/smembers
+     * @deprecated use Redis::sMembers()
+     *
      * @return  array   An array of elements, the contents of the set.
      * @param   string  $key
-     * @link    https://redis.io/commands/smembers
      */
     public function sGetMembers($key)
     {
@@ -1773,6 +1777,8 @@ public function rename($srcKey, $dstKey)
     /**
      * @see rename()
      * @link    https://redis.io/commands/rename
+     * @deprecated use Redis::rename()
+     *
      * @param   string  $srcKey
      * @param   string  $dstKey
      */
@@ -1812,7 +1818,7 @@ public function renameNx($srcKey, $dstKey)
      * @example
      * 
      * $redis->set('x', '42');
-     * $redis->setTimeout('x', 3);  // x will disappear in 3 seconds.
+     * $redis->expire('x', 3);  // x will disappear in 3 seconds.
      * sleep(5);                    // wait 5 seconds
      * $redis->get('x');            // will return `FALSE`, as 'x' has expired.
      * 
@@ -1842,9 +1848,11 @@ public function pExpire($key, $ttl) /** * @see expire() + * @link https://redis.io/commands/expire + * @deprecated use Redis::expire() + * * @param string $key * @param int $ttl - * @link https://redis.io/commands/expire */ public function setTimeout($key, $ttl) { @@ -1907,6 +1915,8 @@ public function keys($pattern) /** * @see keys() + * @deprecated use Redis::keys() + * * @param string $pattern * @link https://redis.io/commands/keys */ @@ -2334,7 +2344,7 @@ public function flushAll() * @link https://redis.io/commands/sort * @example *
-     * $redis->delete('s');
+     * $redis->del('s');
      * $redis->sadd('s', 5);
      * $redis->sadd('s', 4);
      * $redis->sadd('s', 2);
@@ -2490,6 +2500,27 @@ public function mset(array $array)
     {
     }
 
+    /**
+     * Get the values of all the specified keys.
+     * If one or more keys dont exist, the array will contain FALSE at the position of the key.
+     *
+     * @param array $keys Array containing the list of the keys
+     * @return array Array containing the values related to keys in argument
+     *
+     * @deprecated use Redis::mGet()
+     * @example
+     * 
+     * $redis->set('key1', 'value1');
+     * $redis->set('key2', 'value2');
+     * $redis->set('key3', 'value3');
+     * $redis->getMultiple(array('key1', 'key2', 'key3')); // array('value1', 'value2', 'value3');
+     * $redis->getMultiple(array('key0', 'key1', 'key5')); // array(`FALSE`, 'value2', `FALSE`);
+     * 
+ */ + public function getMultiple(array $keys) + { + } + /** * Returns the values of all specified keys. * @@ -2498,23 +2529,20 @@ public function mset(array $array) * * @param array $array * @return array + * * @link https://redis.io/commands/mget * @example *
-     * $redis->delete('x', 'y', 'z', 'h');  // remove x y z
+     * $redis->del('x', 'y', 'z', 'h');  // remove x y z
      * $redis->mset(array('x' => 'a', 'y' => 'b', 'z' => 'c'));
      * $redis->hset('h', 'field', 'value');
      * var_dump($redis->mget(array('x', 'y', 'z', 'h')));
      * // Output:
      * // array(3) {
-     * // [0]=>
-     * // string(1) "a"
-     * // [1]=>
-     * // string(1) "b"
-     * // [2]=>
-     * // string(1) "c"
-     * // [3]=>
-     * // bool(false)
+     * //   [0]=> string(1) "a"
+     * //   [1]=> string(1) "b"
+     * //   [2]=> string(1) "c"
+     * //   [3]=> bool(false)
      * // }
      * 
*/ @@ -2543,7 +2571,7 @@ public function msetnx(array $array) * @link https://redis.io/commands/rpoplpush * @example *
-     * $redis->delete('x', 'y');
+     * $redis->del('x', 'y');
      *
      * $redis->lPush('x', 'abc');
      * $redis->lPush('x', 'def');
@@ -2674,12 +2702,14 @@ public function zRem($key, $member1, $member2 = null, $memberN = null)
 
     /**
      * @see zRem()
+     * @link https://redis.io/commands/zrem
+     * @deprecated use Redis::zRem()
+     *
      * @param   string  $key
      * @param   string  $member1
      * @param   string  $member2
      * @param   string  $memberN
      * @return  int     Number of deleted values
-     * @link    https://redis.io/commands/zrem
      */
     public function zDelete($key, $member1, $member2 = null, $memberN = null)
     {
@@ -2843,6 +2873,8 @@ public function zRemRangeByScore($key, $start, $end)
 
     /**
      * @see zRemRangeByScore()
+     * @deprecated use Redis::zRemRangeByScore()
+     *
      * @param string    $key
      * @param float     $start
      * @param float     $end
@@ -2874,10 +2906,12 @@ public function zRemRangeByRank($key, $start, $end)
 
     /**
      * @see zRemRangeByRank()
+     * @link    https://redis.io/commands/zremrangebyscore
+     * @deprecated use Redis::zRemRangeByRank()
+     *
      * @param   string  $key
      * @param   int     $start
      * @param   int     $end
-     * @link    https://redis.io/commands/zremrangebyscore
      */
     public function zDeleteRangeByRank($key, $start, $end)
     {
@@ -2888,6 +2922,7 @@ public function zDeleteRangeByRank($key, $start, $end)
      *
      * @param   string  $key
      * @return  int     the set's cardinality
+     *
      * @link    https://redis.io/commands/zsize
      * @example
      * 
@@ -2903,6 +2938,8 @@ public function zCard($key)
 
     /**
      * @see zCard()
+     * @deprecated use Redis::zCard()
+     *
      * @param string $key
      */
     public function zSize($key)
@@ -2936,7 +2973,7 @@ public function zScore($key, $member)
      * @link    https://redis.io/commands/zrank
      * @example
      * 
-     * $redis->delete('z');
+     * $redis->del('z');
      * $redis->zAdd('key', 1, 'one');
      * $redis->zAdd('key', 2, 'two');
      * $redis->zRank('key', 'one');     // 0
@@ -2970,7 +3007,7 @@ public function zRevRank($key, $member)
      * @link    https://redis.io/commands/zincrby
      * @example
      * 
-     * $redis->delete('key');
+     * $redis->del('key');
      * $redis->zIncrBy('key', 2.5, 'member1');  // key or member1 didn't exist, so member1's score is to 0
      *                                          // before the increment and now has the value 2.5
      * $redis->zIncrBy('key', 1, 'member1');    // 3.5
@@ -2992,17 +3029,17 @@ public function zIncrBy($key, $value, $member)
      * @param array     $ZSetKeys
      * @param array     $Weights
      * @param string    $aggregateFunction  Either "SUM", "MIN", or "MAX": defines the behaviour to use on
-     * duplicate entries during the zUnion.
+     * duplicate entries during the zUnionStore
      * @return int The number of values in the new sorted set.
      * @link    https://redis.io/commands/zunionstore
      * @example
      * 
-     * $redis->delete('k1');
-     * $redis->delete('k2');
-     * $redis->delete('k3');
-     * $redis->delete('ko1');
-     * $redis->delete('ko2');
-     * $redis->delete('ko3');
+     * $redis->del('k1');
+     * $redis->del('k2');
+     * $redis->del('k3');
+     * $redis->del('ko1');
+     * $redis->del('ko2');
+     * $redis->del('ko3');
      *
      * $redis->zAdd('k1', 0, 'val0');
      * $redis->zAdd('k1', 1, 'val1');
@@ -3010,13 +3047,26 @@ public function zIncrBy($key, $value, $member)
      * $redis->zAdd('k2', 2, 'val2');
      * $redis->zAdd('k2', 3, 'val3');
      *
-     * $redis->zUnion('ko1', array('k1', 'k2')); // 4, 'ko1' => array('val0', 'val1', 'val2', 'val3')
+     * $redis->zUnionStore('ko1', array('k1', 'k2')); // 4, 'ko1' => array('val0', 'val1', 'val2', 'val3')
      *
-     * // Weighted zUnion
-     * $redis->zUnion('ko2', array('k1', 'k2'), array(1, 1)); // 4, 'ko2' => array('val0', 'val1', 'val2', 'val3')
-     * $redis->zUnion('ko3', array('k1', 'k2'), array(5, 1)); // 4, 'ko3' => array('val0', 'val2', 'val3', 'val1')
+     * // Weighted zUnionStore
+     * $redis->zUnionStore('ko2', array('k1', 'k2'), array(1, 1)); // 4, 'ko2' => array('val0', 'val1', 'val2', 'val3')
+     * $redis->zUnionStore('ko3', array('k1', 'k2'), array(5, 1)); // 4, 'ko3' => array('val0', 'val2', 'val3', 'val1')
      * 
*/ + public function zUnionStore($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM') + { + } + + /** + * @see zUnionStore + * @deprecated use Redis::zUnionStore() + * + * @param $Output + * @param $ZSetKeys + * @param array|null $Weights + * @param string $aggregateFunction + */ public function zUnion($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM') { } @@ -3033,19 +3083,19 @@ public function zUnion($Output, $ZSetKeys, array $Weights = null, $aggregateFunc * @param array $ZSetKeys * @param array $Weights * @param string $aggregateFunction Either "SUM", "MIN", or "MAX": - * defines the behaviour to use on duplicate entries during the zInter. + * defines the behaviour to use on duplicate entries during the zInterStore. * @return int The number of values in the new sorted set. * @link https://redis.io/commands/zinterstore * @example *
-     * $redis->delete('k1');
-     * $redis->delete('k2');
-     * $redis->delete('k3');
+     * $redis->del('k1');
+     * $redis->del('k2');
+     * $redis->del('k3');
      *
-     * $redis->delete('ko1');
-     * $redis->delete('ko2');
-     * $redis->delete('ko3');
-     * $redis->delete('ko4');
+     * $redis->del('ko1');
+     * $redis->del('ko2');
+     * $redis->del('ko3');
+     * $redis->del('ko4');
      *
      * $redis->zAdd('k1', 0, 'val0');
      * $redis->zAdd('k1', 1, 'val1');
@@ -3054,14 +3104,27 @@ public function zUnion($Output, $ZSetKeys, array $Weights = null, $aggregateFunc
      * $redis->zAdd('k2', 2, 'val1');
      * $redis->zAdd('k2', 3, 'val3');
      *
-     * $redis->zInter('ko1', array('k1', 'k2'));               // 2, 'ko1' => array('val1', 'val3')
-     * $redis->zInter('ko2', array('k1', 'k2'), array(1, 1));  // 2, 'ko2' => array('val1', 'val3')
+     * $redis->zInterStore('ko1', array('k1', 'k2'));               // 2, 'ko1' => array('val1', 'val3')
+     * $redis->zInterStore('ko2', array('k1', 'k2'), array(1, 1));  // 2, 'ko2' => array('val1', 'val3')
      *
-     * // Weighted zInter
-     * $redis->zInter('ko3', array('k1', 'k2'), array(1, 5), 'min'); // 2, 'ko3' => array('val1', 'val3')
-     * $redis->zInter('ko4', array('k1', 'k2'), array(1, 5), 'max'); // 2, 'ko4' => array('val3', 'val1')
+     * // Weighted zInterStore
+     * $redis->zInterStore('ko3', array('k1', 'k2'), array(1, 5), 'min'); // 2, 'ko3' => array('val1', 'val3')
+     * $redis->zInterStore('ko4', array('k1', 'k2'), array(1, 5), 'max'); // 2, 'ko4' => array('val3', 'val1')
      * 
*/ + public function zInterStore($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM') + { + } + + /** + * @see zInterStore + * @deprecated use Redis::zInterStore() + * + * @param $Output + * @param $ZSetKeys + * @param array|null $Weights + * @param string $aggregateFunction + */ public function zInter($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM') { } @@ -3144,7 +3207,7 @@ public function bzPopMin($key1, $key2, $timeout) * @link https://redis.io/commands/hset * @example *
-     * $redis->delete('h')
+     * $redis->del('h')
      * $redis->hSet('h', 'key1', 'hello');  // 1, 'key1' => 'hello' in the hash at "h"
      * $redis->hGet('h', 'key1');           // returns "hello"
      *
@@ -3167,7 +3230,7 @@ public function hSet($key, $hashKey, $value)
      * @link    https://redis.io/commands/hsetnx
      * @example
      * 
-     * $redis->delete('h')
+     * $redis->del('h')
      * $redis->hSetNx('h', 'key1', 'hello'); // TRUE, 'key1' => 'hello' in the hash at "h"
      * $redis->hSetNx('h', 'key1', 'world'); // FALSE, 'key1' => 'hello' in the hash at "h". No change since the field
      * wasn't replaced.
@@ -3200,7 +3263,7 @@ public function hGet($key, $hashKey)
      * @link    https://redis.io/commands/hlen
      * @example
      * 
-     * $redis->delete('h')
+     * $redis->del('h')
      * $redis->hSet('h', 'key1', 'hello');
      * $redis->hSet('h', 'key2', 'plop');
      * $redis->hLen('h'); // returns 2
@@ -3254,7 +3317,7 @@ public function hDel($key, $hashKey1, $hashKey2 = null, $hashKeyN = null)
      * @link    https://redis.io/commands/hkeys
      * @example
      * 
-     * $redis->delete('h');
+     * $redis->del('h');
      * $redis->hSet('h', 'a', 'x');
      * $redis->hSet('h', 'b', 'y');
      * $redis->hSet('h', 'c', 'z');
@@ -3288,7 +3351,7 @@ public function hKeys($key)
      * @link    https://redis.io/commands/hvals
      * @example
      * 
-     * $redis->delete('h');
+     * $redis->del('h');
      * $redis->hSet('h', 'a', 'x');
      * $redis->hSet('h', 'b', 'y');
      * $redis->hSet('h', 'c', 'z');
@@ -3322,7 +3385,7 @@ public function hVals($key)
      * @link    https://redis.io/commands/hgetall
      * @example
      * 
-     * $redis->delete('h');
+     * $redis->del('h');
      * $redis->hSet('h', 'a', 'x');
      * $redis->hSet('h', 'b', 'y');
      * $redis->hSet('h', 'c', 'z');
@@ -3377,7 +3440,7 @@ public function hExists($key, $hashKey)
      * @link    https://redis.io/commands/hincrby
      * @example
      * 
-     * $redis->delete('h');
+     * $redis->del('h');
      * $redis->hIncrBy('h', 'x', 2); // returns 2: h[x] = 2 now.
      * $redis->hIncrBy('h', 'x', 1); // h[x] ← 2 + 1. Returns 3
      * 
@@ -3429,7 +3492,7 @@ public function hIncrByFloat($key, $field, $increment) * @link https://redis.io/commands/hmset * @example *
-     * $redis->delete('user:1');
+     * $redis->del('user:1');
      * $redis->hMSet('user:1', array('name' => 'Joe', 'salary' => 2000));
      * $redis->hIncrBy('user:1', 'salary', 100); // Joe earns 100 more now.
      * 
@@ -3449,7 +3512,7 @@ public function hMSet($key, $hashKeys) * @link https://redis.io/commands/hmget * @example *
-     * $redis->delete('h');
+     * $redis->del('h');
      * $redis->hSet('h', 'field1', 'value1');
      * $redis->hSet('h', 'field2', 'value2');
      * $redis->hmGet('h', array('field1', 'field2')); // returns array('field1' => 'value1', 'field2' => 'value2')
@@ -3826,6 +3889,8 @@ public function eval($script, $args = array(), $numKeys = 0)
 
     /**
      * @see eval()
+     * @deprecated use Redis::eval()
+     *
      * @param   string  $script
      * @param   array   $args
      * @param   int     $numKeys
@@ -3858,6 +3923,8 @@ public function evalSha($scriptSha, $args = array(), $numKeys = 0)
 
     /**
      * @see evalSha()
+     * @deprecated use Redis::evalSha()
+     *
      * @param string $scriptSha
      * @param array  $args
      * @param int    $numKeys

From 92a58668943c90126fffe05f09baed133d0a9ced Mon Sep 17 00:00:00 2001
From: Maksim Kamashev 
Date: Sun, 28 Jul 2019 23:50:59 +0300
Subject: [PATCH 77/97] Fix composer config

---
 composer.json | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/composer.json b/composer.json
index c2faee3..ff3839d 100644
--- a/composer.json
+++ b/composer.json
@@ -9,22 +9,16 @@
         {
             "name":     "Max Kamashev",
             "email":    "max.kamashev@gmail.com",
-            "homepage": "http://uk0.us/",
+            "homepage": "http://max.kamashev.name/",
             "role":     "Developer"
         }
     ],
     "require":{
         "php":">=5.3.0"
     },
-    "version": "2.2.2",
     "autoload": {
         "psr-0": {
             "phpredis-phpdoc": "src/"
         }
-    },
-    "extra": {
-        "branch-alias": {
-            "dev-master": "2.2.x-dev"
-        }
     }
 }

From cc8a6facac7c6fb6fecf6815a6a4f34731d61e3f Mon Sep 17 00:00:00 2001
From: Maksim Kamashev 
Date: Thu, 1 Aug 2019 00:36:58 +0300
Subject: [PATCH 78/97] Fix set type in set & get commands #31

- fix type if used serializer
- add new serializer constant
- fix formatting
- fix vars naming, from snake_case to camelCase
- fetch patches from https://github.com/JetBrains/phpstorm-stubs
---
 composer.json |    2 +-
 src/Redis.php | 2026 ++++++++++++++++++++++++++++++-------------------
 2 files changed, 1235 insertions(+), 793 deletions(-)

diff --git a/composer.json b/composer.json
index ff3839d..e50c12b 100644
--- a/composer.json
+++ b/composer.json
@@ -14,7 +14,7 @@
         }
     ],
     "require":{
-        "php":">=5.3.0"
+        "php":">=7.0"
     },
     "autoload": {
         "psr-0": {
diff --git a/src/Redis.php b/src/Redis.php
index 6893e0b..b60dc8e 100644
--- a/src/Redis.php
+++ b/src/Redis.php
@@ -39,6 +39,8 @@ class Redis
     const SERIALIZER_NONE       = 0;
     const SERIALIZER_PHP        = 1;
     const SERIALIZER_IGBINARY   = 2;
+    const SERIALIZER_MSGPACK    = 3;
+    const SERIALIZER_JSON       = 4;
 
     /**
      * Multi
@@ -69,13 +71,15 @@ public function __construct()
     /**
      * Connects to a Redis instance.
      *
-     * @param string    $host           can be a host, or the path to a unix domain socket
-     * @param int       $port           optional
-     * @param float     $timeout        value in seconds (optional, default is 0.0 meaning unlimited)
-     * @param null      $reserved       should be null if $retry_interval is specified
-     * @param int       $retry_interval retry interval in milliseconds.
-     * @param float     $read_timeout   value in seconds (optional, default is 0 meaning unlimited)
-     * @return bool                     TRUE on success, FALSE on error.
+     * @param string $host          can be a host, or the path to a unix domain socket
+     * @param int    $port          optional
+     * @param float  $timeout       value in seconds (optional, default is 0.0 meaning unlimited)
+     * @param null   $reserved      should be null if $retryInterval is specified
+     * @param int    $retryInterval retry interval in milliseconds.
+     * @param float  $readTimeout   value in seconds (optional, default is 0 meaning unlimited)
+     *
+     * @return bool TRUE on success, FALSE on error
+     *
      * @example
      * 
      * $redis->connect('127.0.0.1', 6379);
@@ -84,12 +88,44 @@ public function __construct()
      * $redis->connect('/tmp/redis.sock');      // unix domain socket.
      * 
*/ - public function connect($host, $port = 6379, $timeout = 0.0, $reserved = null, $retry_interval = 0, $read_timeout = 0.0) - { + public function connect( + $host, + $port = 6379, + $timeout = 0.0, + $reserved = null, + $retryInterval = 0, + $readTimeout = 0.0 + ) { + } + + /** + * Connects to a Redis instance. + * + * @param string $host can be a host, or the path to a unix domain socket + * @param int $port optional + * @param float $timeout value in seconds (optional, default is 0.0 meaning unlimited) + * @param null $reserved should be null if $retry_interval is specified + * @param int $retryInterval retry interval in milliseconds. + * @param float $readTimeout value in seconds (optional, default is 0 meaning unlimited) + * + * @return bool TRUE on success, FALSE on error + * + * @see connect() + * @deprecated use Redis::connect() + */ + public function open( + $host, + $port = 6379, + $timeout = 0.0, + $reserved = null, + $retryInterval = 0, + $readTimeout = 0.0 + ) { } /** * A method to determine if a phpredis object thinks it's connected to a server + * * @return bool Returns TRUE if phpredis thinks it's connected and FALSE if not */ public function isConnected() @@ -99,7 +135,7 @@ public function isConnected() /** * Retrieve our host or unix socket that we're connected to * - * @return mixed The host or unix socket we're connected to or FALSE if we're not connected + * @return string|bool The host or unix socket we're connected to or FALSE if we're not connected */ public function getHost() { @@ -108,7 +144,7 @@ public function getHost() /** * Get the port we're connected to * - * @return mixed Returns the port we're connected to or FALSE if we're not connected + * @return int|bool Returns the port we're connected to or FALSE if we're not connected */ public function getPort() { @@ -117,7 +153,7 @@ public function getPort() /** * Get the database number phpredis is pointed to * - * @return mixed Returns the database number (LONG) phpredis thinks it's pointing to + * @return int|bool Returns the database number (int) phpredis thinks it's pointing to * or FALSE if we're not connected */ public function getDbNum() @@ -127,7 +163,7 @@ public function getDbNum() /** * Get the (write) timeout in use for phpredis * - * @return mixed The timeout (DOUBLE) specified in our connect call or FALSE if we're not connected + * @return float|bool The timeout (DOUBLE) specified in our connect call or FALSE if we're not connected */ public function getTimeout() { @@ -136,7 +172,7 @@ public function getTimeout() /** * Get the read timeout specified to phpredis or FALSE if we're not connected * - * @return mixed Returns the read timeout (which can be set using setOption and Redis::OPT_READ_TIMEOUT) + * @return float|bool Returns the read timeout (which can be set using setOption and Redis::OPT_READ_TIMEOUT) * or FALSE if we're not connected */ public function getReadTimeout() @@ -146,8 +182,10 @@ public function getReadTimeout() /** * Gets the persistent ID that phpredis is using * - * @return mixed Returns the persistent id phpredis is using (which will only be set if connected with pconnect), - * NULL if we're not using a persistent ID, and FALSE if we're not connected + * @return string|null|bool Returns the persistent id phpredis is using + * (which will only be set if connected with pconnect), + * NULL if we're not using a persistent ID, + * and FALSE if we're not connected */ public function getPersistentID() { @@ -156,29 +194,13 @@ public function getPersistentID() /** * Get the password used to authenticate the phpredis connection * - * @return mixed Returns the password used to authenticate a phpredis session or NULL if none was used, + * @return string|null|bool Returns the password used to authenticate a phpredis session or NULL if none was used, * and FALSE if we're not connected */ public function getAuth() { } - /** - * @see connect() - * @deprecated use Redis::connect() - * - * @param string $host - * @param int $port - * @param float $timeout - * @param null $reserved - * @param int $retry_interval - * @param float $read_timeout - * @return bool - */ - public function open($host, $port = 6379, $timeout = 0.0, $reserved = null, $retry_interval = 0, $read_timeout = 0.0) - { - } - /** * Connects to a Redis instance or reuse a connection already established with pconnect/popen. * @@ -187,48 +209,78 @@ public function open($host, $port = 6379, $timeout = 0.0, $reserved = null, $ret * many servers connecting to one redis server. * * Also more than one persistent connection can be made identified by either host + port + timeout - * or host + persistent_id or unix socket + timeout. + * or host + persistentId or unix socket + timeout. * * This feature is not available in threaded versions. pconnect and popen then working like their non persistent * equivalents. * - * @param string $host can be a host, or the path to a unix domain socket - * @param int $port optional - * @param float $timeout value in seconds (optional, default is 0 meaning unlimited) - * @param string $persistent_id identity for the requested persistent connection - * @param int $retry_interval retry interval in milliseconds. - * @param float $read_timeout value in seconds (optional, default is 0 meaning unlimited) - * @return bool TRUE on success, FALSE on ertcnror. + * @param string $host can be a host, or the path to a unix domain socket + * @param int $port optional + * @param float $timeout value in seconds (optional, default is 0 meaning unlimited) + * @param string $persistentId identity for the requested persistent connection + * @param int $retryInterval retry interval in milliseconds. + * @param float $readTimeout value in seconds (optional, default is 0 meaning unlimited) + * + * @return bool TRUE on success, FALSE on ertcnror. + * + * @example *
      * $redis->pconnect('127.0.0.1', 6379);
-     * $redis->pconnect('127.0.0.1');                 // port 6379 by default - same connection like before.
-     * $redis->pconnect('127.0.0.1', 6379, 2.5);      // 2.5 sec timeout and would be another connection than the two before.
-     * $redis->pconnect('127.0.0.1', 6379, 2.5, 'x'); // x is sent as persistent_id and would be another connection than the three before.
-     * $redis->pconnect('/tmp/redis.sock');           // unix domain socket - would be another connection than the four before.
+     *
+     * // port 6379 by default - same connection like before
+     * $redis->pconnect('127.0.0.1');
+     *
+     * // 2.5 sec timeout and would be another connection than the two before.
+     * $redis->pconnect('127.0.0.1', 6379, 2.5);
+     *
+     * // x is sent as persistent_id and would be another connection than the three before.
+     * $redis->pconnect('127.0.0.1', 6379, 2.5, 'x');
+     *
+     * // unix domain socket - would be another connection than the four before.
+     * $redis->pconnect('/tmp/redis.sock');
      * 
*/ - public function pconnect($host, $port = 6379, $timeout = 0.0, $persistent_id = null, $retry_interval = 0, $read_timeout = 0.0) - { + public function pconnect( + $host, + $port = 6379, + $timeout = 0.0, + $persistentId = null, + $retryInterval = 0, + $readTimeout = 0.0 + ) { } /** - * @see pconnect() - * @deprecated use Redis::pconnect() + * @param string $host + * @param int $port + * @param float $timeout + * @param string $persistentId + * @param int $retryInterval + * @param float $readTimeout * - * @param string $host - * @param int $port - * @param float $timeout - * @param string $persistent_id - * @param int $retry_interval - * @param float $read_timeout * @return bool + * + * @deprecated use Redis::pconnect() + * @see pconnect() */ - public function popen($host, $port = 6379, $timeout = 0.0, $persistent_id = '', $retry_interval = 0, $read_timeout = 0.0) - { + public function popen( + $host, + $port = 6379, + $timeout = 0.0, + $persistentId = '', + $retryInterval = 0, + $readTimeout = 0.0 + ) { } /** - * Disconnects from the Redis instance, except when pconnect is used. + * Disconnects from the Redis instance. + * + * Note: Closing a persistent connection requires PhpRedis >= 4.2.0 + * + * @since >= 4.2 Closing a persistent connection requires PhpRedis + * + * @return bool TRUE on success, FALSE on error */ public function close() { @@ -241,53 +293,74 @@ public function close() * * @param int $db1 * @param int $db2 + * * @return bool TRUE on success and FALSE on failure * * @link https://redis.io/commands/swapdb * @since >= 4.0 * @example + *
      * // Swaps DB 0 with DB 1 atomically
      * $redis->swapdb(0, 1);
+     * 
*/ public function swapdb(int $db1, int $db2) { } /** - * Set client option. + * Set client option + * + * @param int $option option name + * @param mixed $value option value + * + * @return bool TRUE on success, FALSE on error * - * @param string $name parameter name - * @param string $value parameter value - * @return bool: TRUE on success, FALSE on error. * @example *
      * $redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_NONE);        // don't serialize data
      * $redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP);         // use built-in serialize/unserialize
      * $redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_IGBINARY);    // use igBinary serialize/unserialize
+     * $redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_MSGPACK);     // Use msgpack serialize/unserialize
+     * $redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_JSON);        // Use json serialize/unserialize
+     *
      * $redis->setOption(Redis::OPT_PREFIX, 'myAppName:');                      // use custom prefix on all keys
+     *
+     * // Options for the SCAN family of commands, indicating whether to abstract
+     * // empty results from the user.  If set to SCAN_NORETRY (the default), phpredis
+     * // will just issue one SCAN command at a time, sometimes returning an empty
+     * // array of results.  If set to SCAN_RETRY, phpredis will retry the scan command
+     * // until keys come back OR Redis returns an iterator of zero
+     * $redis->setOption(Redis::OPT_SCAN, Redis::SCAN_NORETRY);
+     * $redis->setOption(Redis::OPT_SCAN, Redis::SCAN_RETRY);
      * 
*/ - public function setOption($name, $value) + public function setOption($option, $value) { } /** * Get client option * - * @param string $name parameter name - * @return int Parameter value. + * @param int $option parameter name + * + * @return mixed|null Parameter value + * + * @see setOption() * @example - * // return Redis::SERIALIZER_NONE, Redis::SERIALIZER_PHP, or Redis::SERIALIZER_IGBINARY. + * // return option value * $redis->getOption(Redis::OPT_SERIALIZER); */ - public function getOption($name) + public function getOption($option) { } /** * Check the current connection status * - * @return string STRING: +PONG on success. Throws a RedisException object on connectivity error, as described above. + * @return string STRING: +PONG on success. + * Throws a RedisException object on connectivity error, as described above. + * @throws RedisException * @link https://redis.io/commands/ping */ public function ping() @@ -297,8 +370,10 @@ public function ping() /** * Echo the given string * - * @param string $message - * @return string: Returns message. + * @param string $message + * + * @return string Returns message + * * @link https://redis.io/commands/echo */ public function echo($message) @@ -308,10 +383,29 @@ public function echo($message) /** * Get the value related to the specified key * - * @param string $key - * @return string|bool: If key didn't exist, FALSE is returned. Otherwise, the value related to this key is returned. + * @param string $key + * + * @return string|mixed|bool If key didn't exist, FALSE is returned. + * Otherwise, the value related to this key is returned + * * @link https://redis.io/commands/get - * @example $redis->get('key'); + * @example + *
+     * $redis->set('key', 'hello');
+     * $redis->get('key');
+     *
+     * // set and get with serializer
+     * $redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_JSON);
+     *
+     * $redis->set('key', ['asd' => 'as', 'dd' => 123, 'b' => true]);
+     * var_dump($redis->get('key'));
+     * // Output:
+     * array(3) {
+     *  'asd' => string(2) "as"
+     *  'dd' => int(123)
+     *  'b' => bool(true)
+     * }
+     * 
*/ public function get($key) { @@ -322,10 +416,15 @@ public function get($key) * * @since If you're using Redis >= 2.6.12, you can pass extended options as explained in example * - * @param string $key - * @param string $value - * @param int|array $timeout If you pass an integer, phpredis will redirect to SETEX, and will try to use Redis >= 2.6.12 extended options if you pass an array with valid values - * + * @param string $key + * @param string|mixed $value string if not used serializer + * @param int|array $timeout [optional] Calling setex() is preferred if you want a timeout.
+ * Since 2.6.12 it also supports different flags inside an array. Example ['NX', 'EX' => 60]
+ * - EX seconds -- Set the specified expire time, in seconds.
+ * - PX milliseconds -- Set the specified expire time, in milliseconds.
+ * - PX milliseconds -- Set the specified expire time, in milliseconds.
+ * - NX -- Only set the key if it does not already exist.
+ * - XX -- Only set the key if it already exist.
*
      * // Simple key -> value set
      * $redis->set('key', 'value');
@@ -334,13 +433,13 @@ public function get($key)
      * $redis->set('key','value', 10);
      *
      * // Will set the key, if it doesn't exist, with a ttl of 10 seconds
-     * $redis->set('key', 'value', Array('nx', 'ex'=>10));
+     * $redis->set('key', 'value', ['nx', 'ex' => 10]);
      *
      * // Will set a key, if it does exist, with a ttl of 1000 miliseconds
-     * $redis->set('key', 'value', Array('xx', 'px'=>1000));
+     * $redis->set('key', 'value', ['xx', 'px' => 1000]);
      * 
* - * @return bool TRUE if the command is successful. + * @return bool TRUE if the command is successful * * @link https://redis.io/commands/set */ @@ -351,10 +450,12 @@ public function set($key, $value, $timeout = null) /** * Set the string value in argument as value of the key, with a time to live. * - * @param string $key - * @param int $ttl - * @param string $value - * @return bool: TRUE if the command is successful. + * @param string $key + * @param int $ttl + * @param string|mixed $value + * + * @return bool TRUE if the command is successful + * * @link https://redis.io/commands/setex * @example $redis->setex('key', 3600, 'value'); // sets key → value, with 1h TTL. */ @@ -366,10 +467,12 @@ public function setex($key, $ttl, $value) * Set the value and expiration in milliseconds of a key. * * @see setex() - * @param string $key - * @param int $ttl, in milliseconds. - * @param string $value - * @return bool: TRUE if the command is successful. + * @param string $key + * @param int $ttl, in milliseconds. + * @param string|mixed $value + * + * @return bool TRUE if the command is successful + * * @link https://redis.io/commands/psetex * @example $redis->psetex('key', 1000, 'value'); // sets key → value, with 1sec TTL. */ @@ -380,9 +483,11 @@ public function psetex($key, $ttl, $value) /** * Set the string value in argument as value of the key if the key doesn't already exist in the database. * - * @param string $key - * @param string $value - * @return bool: TRUE in case of success, FALSE in case of failure. + * @param string $key + * @param string|mixed $value + * + * @return bool TRUE in case of success, FALSE in case of failure + * * @link https://redis.io/commands/setnx * @example *
@@ -397,10 +502,11 @@ public function setnx($key, $value)
     /**
      * Remove specified keys.
      *
-     * @param string|array $key1 An array of keys, or an undefined number of parameters, each a key: key1 key2 key3 ... keyN
-     * @param string $key2 ...
-     * @param string $key3 ...
+     * @param   int|string|array $key1 An array of keys, or an undefined number of parameters, each a key: key1 key2 key3 ... keyN
+     * @param   int|string       ...$otherKeys
+     *
      * @return int Number of keys deleted
+     *
      * @link https://redis.io/commands/del
      * @example
      * 
@@ -408,11 +514,12 @@ public function setnx($key, $value)
      * $redis->set('key2', 'val2');
      * $redis->set('key3', 'val3');
      * $redis->set('key4', 'val4');
-     * $redis->del('key1', 'key2');          // return 2
-     * $redis->del(array('key3', 'key4'));   // return 2
+     *
+     * $redis->del('key1', 'key2');     // return 2
+     * $redis->del(['key3', 'key4']);   // return 2
      * 
*/ - public function del($key1, $key2 = null, $key3 = null) + public function del($key1, ...$otherKeys) { } @@ -420,9 +527,10 @@ public function del($key1, $key2 = null, $key3 = null) * @see del() * @deprecated use Redis::del() * - * @param string|array $key1 - * @param string $key2 - * @param string $key3 + * @param string|string[] $key1 + * @param string $key2 + * @param string $key3 + * * @return int Number of keys deleted */ public function delete($key1, $key2 = null, $key3 = null) @@ -433,9 +541,10 @@ public function delete($key1, $key2 = null, $key3 = null) * Delete a key asynchronously in another thread. Otherwise it is just as DEL, but non blocking. * * @see del() - * @param string|array $key1 - * @param string $key2 - * @param string $key3 + * @param string|string[] $key1 + * @param string $key2 + * @param string $key3 + * * @return int Number of keys unlinked. * * @link https://redis.io/commands/unlink @@ -456,13 +565,15 @@ public function unlink($key1, $key2 = null, $key3 = null) /** * Enter and exit transactional mode. * - * @param int Redis::MULTI|Redis::PIPELINE + * @param int $mode Redis::MULTI|Redis::PIPELINE * Defaults to Redis::MULTI. * A Redis::MULTI block of commands runs as a single transaction; * a Redis::PIPELINE block is simply transmitted faster to the server, but without any guarantee of atomicity. * discard cancels a transaction. - * @return Redis returns the Redis instance and enters multi-mode. + * + * @return resource Redis returns the Redis instance and enters multi-mode. * Once in multi-mode, all subsequent method calls return the same object until exec() is called. + * * @link https://redis.io/commands/multi * @example *
@@ -485,9 +596,10 @@ public function multi($mode = Redis::MULTI)
     }
 
     /**
-     * @see multi()
      * @return void|array
-     * @link    https://redis.io/commands/exec
+     *
+     * @see multi()
+     * @link https://redis.io/commands/exec
      */
     public function exec()
     {
@@ -495,7 +607,7 @@ public function exec()
 
     /**
      * @see multi()
-     * @link    https://redis.io/commands/discard
+     * @link https://redis.io/commands/discard
      */
     public function discard()
     {
@@ -504,8 +616,10 @@ public function discard()
     /**
      * Watches a key for modifications by another client. If the key is modified between WATCH and EXEC,
      * the MULTI/EXEC transaction will fail (return FALSE). unwatch cancels all the watching of all keys by this client.
-     * @param string | array $key: a list of keys
+     * @param string|string[] $key a list of keys
+     *
      * @return void
+     *
      * @link    https://redis.io/commands/watch
      * @example
      * 
@@ -530,12 +644,16 @@ public function unwatch()
     }
 
     /**
-     * Subscribe to channels. Warning: this function will probably change in the future.
+     * Subscribe to channels.
      *
-     * @param array             $channels an array of channels to subscribe
-     * @param string | array    $callback either a string or an array($instance, 'method_name').
+     * Warning: this function will probably change in the future.
+     *
+     * @param string[]     $channels an array of channels to subscribe
+     * @param string|array $callback either a string or an array($instance, 'method_name').
      * The callback function receives 3 parameters: the redis instance, the channel name, and the message.
-     * @return mixed            Any non-null return value in the callback will be returned to the caller.
+     *
+     * @return mixed|null Any non-null return value in the callback will be returned to the caller.
+     *
      * @link    https://redis.io/commands/subscribe
      * @example
      * 
@@ -565,10 +683,11 @@ public function subscribe($channels, $callback)
     /**
      * Subscribe to channels by pattern
      *
-     * @param   array           $patterns   an array of glob-style patterns to subscribe
-     * @param   string|array    $callback   Either a string or an array with an object and method.
-     *                          The callback will get four arguments ($redis, $pattern, $channel, $message)
-     * @param   mixed           Any non-null return value in the callback will be returned to the caller.
+     * @param array        $patterns   an array of glob-style patterns to subscribe
+     * @param string|array $callback   Either a string or an array with an object and method.
+     *                     The callback will get four arguments ($redis, $pattern, $channel, $message)
+     * @param mixed        Any non-null return value in the callback will be returned to the caller
+     *
      * @link    https://redis.io/commands/psubscribe
      * @example
      * 
@@ -584,12 +703,16 @@ public function psubscribe($patterns, $callback)
     }
 
     /**
-     * Publish messages to channels. Warning: this function will probably change in the future.
+     * Publish messages to channels.
+     *
+     * Warning: this function will probably change in the future.
+     *
+     * @param string $channel a channel to publish to
+     * @param string $message string
+     *
+     * @return int Number of clients that received the message
      *
-     * @param   string $channel a channel to publish to
-     * @param   string $message string
      * @link    https://redis.io/commands/publish
-     * @return  int Number of clients that received the message
      * @example $redis->publish('chan-1', 'hello, world!'); // send message.
      */
     public function publish($channel, $message)
@@ -597,16 +720,19 @@ public function publish($channel, $message)
     }
 
     /**
-     * A command allowing you to get information on the Redis pub/sub system.
-     * @param   string          $keyword    String, which can be: "channels", "numsub", or "numpat"
-     * @param   string|array    $argument   Optional, variant.
-     *                                      For the "channels" subcommand, you can pass a string pattern.
-     *                                      For "numsub" an array of channel names
-     * @return  array|int                   Either an integer or an array.
-     *                          - channels  Returns an array where the members are the matching channels.
-     *                          - numsub    Returns a key/value array where the keys are channel names and
-     *                                      values are their counts.
-     *                          - numpat    Integer return containing the number active pattern subscriptions.
+     * A command allowing you to get information on the Redis pub/sub system
+     *
+     * @param string       $keyword    String, which can be: "channels", "numsub", or "numpat"
+     * @param string|array $argument   Optional, variant.
+     *                                 For the "channels" subcommand, you can pass a string pattern.
+     *                                 For "numsub" an array of channel names
+     *
+     * @return array|int Either an integer or an array.
+     *   - channels  Returns an array where the members are the matching channels.
+     *   - numsub    Returns a key/value array where the keys are channel names and
+     *               values are their counts.
+     *   - numpat    Integer return containing the number active pattern subscriptions
+     *
      * @link    https://redis.io/commands/pubsub
      * @example
      * 
@@ -623,7 +749,8 @@ public function pubsub($keyword, $argument)
     /**
      * Stop listening for messages posted to the given channels.
      *
-     * @param   array             $channels an array of channels to usubscribe
+     * @param array $channels an array of channels to usubscribe
+     *
      * @link    https://redis.io/commands/unsubscribe
      */
     public function unsubscribe($channels = null)
@@ -633,24 +760,35 @@ public function unsubscribe($channels = null)
     /**
      * Stop listening for messages posted to the given channels.
      *
-     * @param   array           $patterns   an array of glob-style patterns to unsubscribe
-     * @link    https://redis.io/commands/punsubscribe
+     * @param array $patterns   an array of glob-style patterns to unsubscribe
+     *
+     * @link https://redis.io/commands/punsubscribe
      */
     public function punsubscribe($patterns = null)
     {
     }
 
     /**
-     * Verify if the specified key exists.
+     * Verify if the specified key/keys exists
      *
-     * @param   string $key
-     * @return  bool: If the key exists, return TRUE, otherwise return FALSE.
-     * @link    https://redis.io/commands/exists
+     * This function took a single argument and returned TRUE or FALSE in phpredis versions < 4.0.0.
+     *
+     * @since >= 4.0 Returned int, if < 4.0 returned bool
+     *
+     * @param string|string[] $key
+     *
+     * @return bool The number of keys tested that do exist
+     *
+     * @link https://redis.io/commands/exists
+     * @link https://github.com/phpredis/phpredis#exists
      * @example
      * 
-     * $redis->set('key', 'value');
-     * $redis->exists('key');               //  TRUE
-     * $redis->exists('NonExistingKey');    // FALSE
+     * $redis->exists('key'); // 1
+     * $redis->exists('NonExistingKey'); // 0
+     *
+     * $redis->mset(['foo' => 'foo', 'bar' => 'bar', 'baz' => 'baz']);
+     * $redis->exists(['foo', 'bar', 'baz]); // 3
+     * $redis->exists('foo', 'bar', 'baz'); // 3
      * 
*/ public function exists($key) @@ -661,7 +799,9 @@ public function exists($key) * Increment the number stored at key by one. * * @param string $key - * @return int the new value + * + * @return int the new value + * * @link https://redis.io/commands/incr * @example *
@@ -678,19 +818,17 @@ public function incr($key)
     /**
      * Increment the float value of a key by the given amount
      *
-     * @param   string  $key
-     * @param   float   $increment
-     * @return  float
+     * @param string $key
+     * @param float  $increment
+     *
+     * @return float
+     *
      * @link    https://redis.io/commands/incrbyfloat
      * @example
      * 
-     * $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"
+     * $redis->incrByFloat('x', 1.5);   // float(4.5)
+     * $redis->get('x');                // float(4.5)
      * 
*/ public function incrByFloat($key, $increment) @@ -698,12 +836,14 @@ public function incrByFloat($key, $increment) } /** - * Increment the number stored at key by one. If the second argument is filled, it will be used as the integer - * value of the increment. + * Increment the number stored at key by one. + * If the second argument is filled, it will be used as the integer value of the increment. + * + * @param string $key key + * @param int $value value that will be added to key (only for incrBy) + * + * @return int the new value * - * @param string $key key - * @param int $value value that will be added to key (only for incrBy) - * @return int the new value * @link https://redis.io/commands/incrby * @example *
@@ -721,8 +861,10 @@ public function incrBy($key, $value)
     /**
      * Decrement the number stored at key by one.
      *
-     * @param   string $key
-     * @return  int    the new value
+     * @param string $key
+     *
+     * @return int the new value
+     *
      * @link    https://redis.io/commands/decr
      * @example
      * 
@@ -736,12 +878,14 @@ public function decr($key)
     }
 
     /**
-     * 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.
+     * 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
      *
-     * @param   string    $key
-     * @param   int       $value  that will be substracted to key (only for decrBy)
-     * @return  int       the new value
      * @link    https://redis.io/commands/decrby
      * @example
      * 
@@ -756,20 +900,21 @@ public function decrBy($key, $value)
     }
 
     /**
-     * Adds the string values to the head (left) of the list. Creates the list if the key didn't exist.
+     * Adds the string values to the head (left) of the list.
+     * Creates the list if the key didn't exist.
      * If the key exists and is not a list, FALSE is returned.
      *
-     * @param   string $key
-     * @param   string $value1  String, value to push in key
-     * @param   string $value2  Optional
-     * @param   string $valueN  Optional
-     * @return  int    The new length of the list in case of success, FALSE in case of Failure.
-     * @link    https://redis.io/commands/lpush
+     * @param string $key
+     * @param string|mixed $value1... Variadic list of values to push in key, if dont used serialized, used string
+     *
+     * @return int|bool The new length of the list in case of success, FALSE in case of Failure
+     *
+     * @link https://redis.io/commands/lpush
      * @example
      * 
      * $redis->lPush('l', 'v1', 'v2', 'v3', 'v4')   // int(4)
      * var_dump( $redis->lRange('l', 0, -1) );
-     * //// Output:
+     * // Output:
      * // array(4) {
      * //   [0]=> string(2) "v4"
      * //   [1]=> string(2) "v3"
@@ -778,25 +923,26 @@ public function decrBy($key, $value)
      * // }
      * 
*/ - public function lPush($key, $value1, $value2 = null, $valueN = null) + public function lPush($key, ...$value1) { } /** - * Adds the string values to the tail (right) of the list. Creates the list if the key didn't exist. + * Adds the string values to the tail (right) of the list. + * Creates the list if the key didn't exist. * If the key exists and is not a list, FALSE is returned. * - * @param string $key - * @param string $value1 String, value to push in key - * @param string $value2 Optional - * @param string $valueN Optional - * @return int The new length of the list in case of success, FALSE in case of Failure. + * @param string $key + * @param string|mixed $value1... Variadic list of values to push in key, if dont used serialized, used string + * + * @return int|bool The new length of the list in case of success, FALSE in case of Failure + * * @link https://redis.io/commands/rpush * @example *
      * $redis->rPush('l', 'v1', 'v2', 'v3', 'v4');    // int(4)
      * var_dump( $redis->lRange('l', 0, -1) );
-     * //// Output:
+     * // Output:
      * // array(4) {
      * //   [0]=> string(2) "v1"
      * //   [1]=> string(2) "v2"
@@ -805,16 +951,18 @@ public function lPush($key, $value1, $value2 = null, $valueN = null)
      * // }
      * 
*/ - public function rPush($key, $value1, $value2 = null, $valueN = null) + public function rPush($key, ...$value1) { } /** * Adds the string value to the head (left) of the list if the list exists. * - * @param string $key - * @param string $value String, value to push in key - * @return int The new length of the list in case of success, FALSE in case of Failure. + * @param string $key + * @param string|mixed $value String, value to push in key + * + * @return int|bool The new length of the list in case of success, FALSE in case of Failure. + * * @link https://redis.io/commands/lpushx * @example *
@@ -833,9 +981,11 @@ public function lPushx($key, $value)
     /**
      * Adds the string value to the tail (right) of the list if the ist exists. FALSE in case of Failure.
      *
-     * @param   string  $key
-     * @param   string  $value String, value to push in key
-     * @return  int     The new length of the list in case of success, FALSE in case of Failure.
+     * @param string $key
+     * @param string|mixed $value String, value to push in key
+     *
+     * @return int|bool The new length of the list in case of success, FALSE in case of Failure.
+     *
      * @link    https://redis.io/commands/rpushx
      * @example
      * 
@@ -855,7 +1005,9 @@ public function rPushx($key, $value)
      * Returns and removes the first element of the list.
      *
      * @param   string $key
-     * @return  string if command executed successfully BOOL FALSE in case of failure (empty list)
+     *
+     * @return  mixed|bool if command executed successfully BOOL FALSE in case of failure (empty list)
+     *
      * @link    https://redis.io/commands/lpop
      * @example
      * 
@@ -873,7 +1025,9 @@ public function lPop($key)
      * Returns and removes the last element of the list.
      *
      * @param   string $key
-     * @return  string if command executed successfully BOOL FALSE in case of failure (empty list)
+     *
+     * @return  mixed|bool if command executed successfully BOOL FALSE in case of failure (empty list)
+     *
      * @link    https://redis.io/commands/rpop
      * @example
      * 
@@ -893,11 +1047,11 @@ public function rPop($key)
      * Il all the list identified by the keys passed in arguments are empty, blPop will block
      * during the specified timeout until an element is pushed to one of those lists. This element will be popped.
      *
-     * @param array $keys    Array containing the keys of the lists
-     * Or STRING Key1 STRING Key2 STRING Key3 ... STRING Keyn
-     * @param int   $timeout Timeout
+     * @param string|string[] $keys    String array containing the keys of the lists OR variadic list of strings
+     * @param int             $timeout Timeout is always the required final parameter
+     *
+     * @return array ['listName', 'element']
      *
-     * @return  array array('listName', 'element')
      * @link    https://redis.io/commands/blpop
      * @example
      * 
@@ -905,13 +1059,13 @@ public function rPop($key)
      * $redis->lPush('key1', 'A');
      * $redis->del('key2');
      *
-     * $redis->blPop('key1', 'key2', 10); // array('key1', 'A')
+     * $redis->blPop('key1', 'key2', 10);        // array('key1', 'A')
      * // OR
-     * $redis->blPop(array('key1', 'key2'), 10); // array('key1', 'A')
+     * $redis->blPop(['key1', 'key2'], 10);      // array('key1', 'A')
      *
-     * $redis->brPop('key1', 'key2', 10); // array('key1', 'A')
+     * $redis->brPop('key1', 'key2', 10);        // array('key1', 'A')
      * // OR
-     * $redis->brPop(array('key1', 'key2'), 10); // array('key1', 'A')
+     * $redis->brPop(['key1', 'key2'], 10); // array('key1', 'A')
      *
      * // Blocking feature
      *
@@ -927,7 +1081,7 @@ public function rPop($key)
      * // array('key1', 'A') is returned
      * 
*/ - public function blPop(array $keys, $timeout) + public function blPop($keys, $timeout) { } @@ -938,10 +1092,11 @@ public function blPop(array $keys, $timeout) * block during the specified timeout until an element is pushed to one of those lists. T * his element will be popped. * - * @param array $keys Array containing the keys of the lists - * Or STRING Key1 STRING Key2 STRING Key3 ... STRING Keyn - * @param int $timeout Timeout - * @return array array('listName', 'element') + * @param string|string[] $keys String array containing the keys of the lists OR variadic list of strings + * @param int $timeout Timeout is always the required final parameter + * + * @return array ['listName', 'element'] + * * @link https://redis.io/commands/brpop * @example *
@@ -979,15 +1134,17 @@ public function brPop(array $keys, $timeout)
      * Returns the size of a list identified by Key. If the list didn't exist or is empty,
      * the command returns 0. If the data type identified by Key is not a list, the command return FALSE.
      *
-     * @param   string  $key
-     * @return  int     The size of the list identified by Key exists.
+     * @param string $key
+     *
+     * @return int|bool The size of the list identified by Key exists.
      * bool FALSE if the data type identified by Key is not list
+     *
      * @link    https://redis.io/commands/llen
      * @example
      * 
      * $redis->rPush('key1', 'A');
      * $redis->rPush('key1', 'B');
-     * $redis->rPush('key1', 'C');  // key1 => [ 'A', 'B', 'C' ]
+     * $redis->rPush('key1', 'C'); // key1 => [ 'A', 'B', 'C' ]
      * $redis->lLen('key1');       // 3
      * $redis->rPop('key1');
      * $redis->lLen('key1');       // 2
@@ -999,10 +1156,12 @@ public function lLen($key)
 
     /**
      * @see lLen()
-     * @link    https://redis.io/commands/llen
+     * @link https://redis.io/commands/llen
      * @deprecated use Redis::lLen()
      *
-     * @param   string    $key
+     * @param string $key
+     *
+     * @return int The size of the list identified by Key exists
      */
     public function lSize($key)
     {
@@ -1012,9 +1171,12 @@ public function lSize($key)
      * Return the specified element of the list stored at the specified key.
      * 0 the first element, 1 the second ... -1 the last element, -2 the penultimate ...
      * Return FALSE in case of a bad index or a key that doesn't point to a list.
-     * @param string    $key
-     * @param int       $index
-     * @return String the element at this index
+     *
+     * @param string $key
+     * @param int    $index
+     *
+     * @return mixed|bool the element at this index
+     *
      * Bool FALSE if the key identifies a non-string data type, or no value corresponds to this index in the list Key.
      *
      * @link    https://redis.io/commands/lindex
@@ -1039,6 +1201,7 @@ public function lIndex($key, $index)
      *
      * @param string $key
      * @param int $index
+     * @return mixed|bool the element at this index
      */
     public function lGet($key, $index)
     {
@@ -1047,17 +1210,19 @@ public function lGet($key, $index)
     /**
      * Set the list at index with the new value.
      *
-     * @param string    $key
-     * @param int       $index
-     * @param string    $value
-     * @return BOOL TRUE if the new value is setted. FALSE if the index is out of range, or data type identified by key
-     * is not a list.
+     * @param string $key
+     * @param int    $index
+     * @param string $value
+     *
+     * @return bool TRUE if the new value is setted.
+     * FALSE if the index is out of range, or data type identified by key is not a list.
+     *
      * @link    https://redis.io/commands/lset
      * @example
      * 
      * $redis->rPush('key1', 'A');
      * $redis->rPush('key1', 'B');
-     * $redis->rPush('key1', 'C');  // key1 => [ 'A', 'B', 'C' ]
+     * $redis->rPush('key1', 'C');    // key1 => [ 'A', 'B', 'C' ]
      * $redis->lIndex('key1', 0);     // 'A'
      * $redis->lSet('key1', 0, 'X');
      * $redis->lIndex('key1', 0);     // 'X'
@@ -1071,10 +1236,13 @@ public function lSet($key, $index, $value)
      * Returns the specified elements of the list stored at the specified key in
      * the range [start, end]. start and stop are interpretated as indices: 0 the first element,
      * 1 the second ... -1 the last element, -2 the penultimate ...
-     * @param   string  $key
-     * @param   int     $start
-     * @param   int     $end
-     * @return  array containing the values in specified range.
+     *
+     * @param string $key
+     * @param int    $start
+     * @param int    $end
+     *
+     * @return array containing the values in specified range.
+     *
      * @link    https://redis.io/commands/lrange
      * @example
      * 
@@ -1096,6 +1264,7 @@ public function lRange($key, $start, $end)
      * @param string    $key
      * @param int       $start
      * @param int       $end
+     * @return array
      */
     public function lGetRange($key, $start, $end)
     {
@@ -1104,10 +1273,12 @@ public function lGetRange($key, $start, $end)
     /**
      * Trims an existing list so that it will contain only a specified range of elements.
      *
-     * @param string    $key
-     * @param int       $start
-     * @param int       $stop
-     * @return array    Bool return FALSE if the key identify a non-list value.
+     * @param string $key
+     * @param int    $start
+     * @param int    $stop
+     *
+     * @return array|bool Bool return FALSE if the key identify a non-list value
+     *
      * @link        https://redis.io/commands/ltrim
      * @example
      * 
@@ -1141,11 +1312,13 @@ public function listTrim($key, $start, $stop)
      * If count is zero, all the matching elements are removed. If count is negative,
      * elements are removed from tail to head.
      *
-     * @param   string  $key
-     * @param   string  $value
-     * @param   int     $count
-     * @return  int     the number of elements to remove
+     * @param string $key
+     * @param string $value
+     * @param int    $count
+     *
+     * @return int|bool the number of elements to remove
      * bool FALSE if the value identified by key is not a list.
+     *
      * @link    https://redis.io/commands/lrem
      * @example
      * 
@@ -1182,11 +1355,13 @@ public function lRemove($key, $value, $count)
      * specify the position of the insert (before or after). If the list didn't exists,
      * or the pivot didn't exists, the value is not inserted.
      *
-     * @param   string  $key
-     * @param   int     $position Redis::BEFORE | Redis::AFTER
-     * @param   string  $pivot
-     * @param   string  $value
-     * @return  int     The number of the elements in the list, -1 if the pivot didn't exists.
+     * @param string       $key
+     * @param int          $position Redis::BEFORE | Redis::AFTER
+     * @param string       $pivot
+     * @param string|mixed $value
+     *
+     * @return int The number of the elements in the list, -1 if the pivot didn't exists.
+     *
      * @link    https://redis.io/commands/linsert
      * @example
      * 
@@ -1212,13 +1387,13 @@ public function lInsert($key, $position, $pivot, $value)
 
     /**
      * Adds a values to the set value stored at key.
-     * If this value is already in the set, FALSE is returned.
      *
-     * @param   string  $key        Required key
-     * @param   string  $value1     Required value
-     * @param   string  $value2     Optional value
-     * @param   string  $valueN     Optional value
-     * @return  int     The number of elements added to the set
+     * @param string       $key       Required key
+     * @param string|mixed ...$value1 Variadic list of values
+     *
+     * @return int|bool The number of elements added to the set.
+     * If this value is already in the set, FALSE is returned
+     *
      * @link    https://redis.io/commands/sadd
      * @example
      * 
@@ -1226,18 +1401,18 @@ public function lInsert($key, $position, $pivot, $value)
      * $redis->sAdd('k', 'v1', 'v2', 'v3');    // int(2)
      * 
*/ - public function sAdd($key, $value1, $value2 = null, $valueN = null) + public function sAdd($key, ...$value1) { } /** * Removes the specified members from the set value stored at key. * - * @param string $key - * @param string $member1 - * @param string $member2 - * @param string $memberN - * @return int The number of elements removed from the set. + * @param string $key + * @param string|mixed ...$member1 Variadic list of members + * + * @return int The number of elements removed from the set + * * @link https://redis.io/commands/srem * @example *
@@ -1250,7 +1425,7 @@ public function sAdd($key, $value1, $value2 = null, $valueN = null)
      * // }
      * 
*/ - public function sRem($key, $member1, $member2 = null, $memberN = null) + public function sRem($key, ...$member1) { } @@ -1260,22 +1435,22 @@ public function sRem($key, $member1, $member2 = null, $memberN = null) * @deprecated use Redis::sRem() * * @param string $key - * @param string $member1 - * @param string $member2 - * @param string $memberN + * @param string|mixed ...$member1 */ - public function sRemove($key, $member1, $member2 = null, $memberN = null) + public function sRemove($key, ...$member1) { } /** * Moves the specified member from the set at srcKey to the set at dstKey. * - * @param string $srcKey - * @param string $dstKey - * @param string $member - * @return bool If the operation is successful, return TRUE. + * @param string $srcKey + * @param string $dstKey + * @param string|mixed $member + * + * @return bool If the operation is successful, return TRUE. * If the srcKey and/or dstKey didn't exist, and/or the member didn't exist in srcKey, FALSE is returned. + * * @link https://redis.io/commands/smove * @example *
@@ -1295,9 +1470,11 @@ public function sMove($srcKey, $dstKey, $member)
     /**
      * Checks if value is a member of the set stored at the key key.
      *
-     * @param   string  $key
-     * @param   string  $value
-     * @return  bool    TRUE if value is a member of the set at key key, FALSE otherwise.
+     * @param string       $key
+     * @param string|mixed $value
+     *
+     * @return bool TRUE if value is a member of the set at key key, FALSE otherwise
+     *
      * @link    https://redis.io/commands/sismember
      * @example
      * 
@@ -1318,8 +1495,8 @@ public function sIsMember($key, $value)
      * @link    https://redis.io/commands/sismember
      * @deprecated use Redis::sIsMember()
      *
-     * @param   string  $key
-     * @param   string  $value
+     * @param string       $key
+     * @param string|mixed $value
      */
     public function sContains($key, $value)
     {
@@ -1328,8 +1505,10 @@ public function sContains($key, $value)
     /**
      * Returns the cardinality of the set identified by key.
      *
-     * @param   string  $key
-     * @return  int     the cardinality of the set identified by key, 0 if the set doesn't exist.
+     * @param string $key
+     *
+     * @return int the cardinality of the set identified by key, 0 if the set doesn't exist.
+     * 
      * @link    https://redis.io/commands/scard
      * @example
      * 
@@ -1347,9 +1526,11 @@ public function sCard($key)
     /**
      * Removes and returns a random element from the set value at Key.
      *
-     * @param   string  $key
-     * @return  string  "popped" value
+     * @param string $key
+     *
+     * @return string|mixed|bool "popped" value
      * bool FALSE if set identified by key is empty or doesn't exist.
+     *
      * @link    https://redis.io/commands/spop
      * @example
      * 
@@ -1367,10 +1548,12 @@ public function sPop($key)
     /**
      * Returns a random element(s) from the set value at Key, without removing it.
      *
-     * @param   string        $key
-     * @param   int           $count [optional]
-     * @return  string|array  value(s) from the set
+     * @param string $key
+     * @param int    $count [optional]
+     *
+     * @return string|mixed|array|bool value(s) from the set
      * bool FALSE if set identified by key is empty or doesn't exist and count argument isn't passed.
+     *
      * @link    https://redis.io/commands/srandmember
      * @example
      * 
@@ -1390,7 +1573,7 @@ public function sPop($key)
      * // }
      * 
*/ - public function sRandMember($key, $count = null) + public function sRandMember($key, $count = 1) { } @@ -1399,12 +1582,13 @@ public function sRandMember($key, $count = null) * held at the specified keys. If just a single key is specified, then this command * produces the members of this set. If one of the keys is missing, FALSE is returned. * - * @param string $key1 keys identifying the different sets on which we will apply the intersection. - * @param string $key2 ... - * @param string $keyN ... - * @return array, contain the result of the intersection between those keys. + * @param string $key1 keys identifying the different sets on which we will apply the intersection. + * @param string ...$otherKeys variadic list of keys + * + * @return array contain the result of the intersection between those keys * If the intersection between the different sets is empty, the return value will be empty array. - * @link https://redis.io/commands/sinterstore + * + * @link https://redis.io/commands/sinter * @example *
      * $redis->sAdd('key1', 'val1');
@@ -1428,18 +1612,19 @@ public function sRandMember($key, $count = null)
      * //}
      * 
*/ - public function sInter($key1, $key2, $keyN = null) + public function sInter($key1, ...$otherKeys) { } /** * Performs a sInter command and stores the result in a new set. * - * @param string $dstKey the key to store the diff into. - * @param string $key1 are intersected as in sInter. - * @param string $key2 ... - * @param string $keyN ... - * @return int: The cardinality of the resulting set, or FALSE in case of a missing key. + * @param string $dstKey the key to store the diff into. + * @param string $key1 keys identifying the different sets on which we will apply the intersection. + * @param string ...$otherKeys variadic list of keys + * + * @return int|bool The cardinality of the resulting set, or FALSE in case of a missing key + * * @link https://redis.io/commands/sinterstore * @example *
@@ -1467,22 +1652,21 @@ public function sInter($key1, $key2, $keyN = null)
      * //}
      * 
*/ - public function sInterStore($dstKey, $key1, $key2, $keyN = null) + public function sInterStore($dstKey, $key1, ...$otherKeys) { } /** * Performs the union between N sets and returns it. * - * @param string $key1 Any number of keys corresponding to sets in redis. - * @param string $key2 ... - * @param string $keyN ... - * @return array of strings: The union of all these sets. + * @param string $key1 first key for union + * @param string ...$otherKeys variadic list of keys corresponding to sets in redis + * + * @return array string[] The union of all these sets + * * @link https://redis.io/commands/sunionstore * @example *
-     * $redis->del('s0', 's1', 's2');
-     *
      * $redis->sAdd('s0', '1');
      * $redis->sAdd('s0', '2');
      * $redis->sAdd('s1', '3');
@@ -1504,7 +1688,7 @@ public function sInterStore($dstKey, $key1, $key2, $keyN = null)
      * //}
      * 
*/ - public function sUnion($key1, $key2, $keyN = null) + public function sUnion($key1, ...$otherKeys) { } @@ -1512,10 +1696,11 @@ public function sUnion($key1, $key2, $keyN = null) * Performs the same action as sUnion, but stores the result in the first key * * @param string $dstKey the key to store the diff into. - * @param string $key1 Any number of keys corresponding to sets in redis. - * @param string $key2 ... - * @param string $keyN ... - * @return int Any number of keys corresponding to sets in redis. + * @param string $key1 first key for union + * @param string ...$otherKeys variadic list of keys corresponding to sets in redis + * + * @return int Any number of keys corresponding to sets in redis + * * @link https://redis.io/commands/sunionstore * @example *
@@ -1544,17 +1729,18 @@ public function sUnion($key1, $key2, $keyN = null)
      * //}
      * 
*/ - public function sUnionStore($dstKey, $key1, $key2, $keyN = null) + public function sUnionStore($dstKey, $key1, ...$otherKeys) { } /** * Performs the difference between N sets and returns it. * - * @param string $key1 Any number of keys corresponding to sets in redis. - * @param string $key2 ... - * @param string $keyN ... - * @return array of strings: The difference of the first set will all the others. + * @param string $key1 first key for diff + * @param string ...$otherKeys variadic list of keys corresponding to sets in redis + * + * @return array string[] The difference of the first set will all the others + * * @link https://redis.io/commands/sdiff * @example *
@@ -1578,18 +1764,19 @@ public function sUnionStore($dstKey, $key1, $key2, $keyN = null)
      * //}
      * 
*/ - public function sDiff($key1, $key2, $keyN = null) + public function sDiff($key1, ...$otherKeys) { } /** * Performs the same action as sDiff, but stores the result in the first key * - * @param string $dstKey the key to store the diff into. - * @param string $key1 Any number of keys corresponding to sets in redis - * @param string $key2 ... - * @param string $keyN ... - * @return int: The cardinality of the resulting set, or FALSE in case of a missing key. + * @param string $dstKey the key to store the diff into. + * @param string $key1 first key for diff + * @param string ...$otherKeys variadic list of keys corresponding to sets in redis + * + * @return int|bool The cardinality of the resulting set, or FALSE in case of a missing key + * * @link https://redis.io/commands/sdiffstore * @example *
@@ -1615,15 +1802,17 @@ public function sDiff($key1, $key2, $keyN = null)
      * //}
      * 
*/ - public function sDiffStore($dstKey, $key1, $key2, $keyN = null) + public function sDiffStore($dstKey, $key1, ...$otherKeys) { } /** * Returns the contents of a set. * - * @param string $key - * @return array An array of elements, the contents of the set. + * @param string $key + * + * @return array An array of elements, the contents of the set + * * @link https://redis.io/commands/smembers * @example *
@@ -1654,20 +1843,23 @@ public function sMembers($key)
      * @link    https://redis.io/commands/smembers
      * @deprecated use Redis::sMembers()
      *
-     * @return  array   An array of elements, the contents of the set.
-     * @param   string  $key
+     * @param  string  $key
+     * @return array   An array of elements, the contents of the set
      */
     public function sGetMembers($key)
     {
     }
 
     /**
-     * Scan a set for members.
-     * @param   string  $key        The set to search.
-     * @param   int     $iterator   LONG (reference) to the iterator as we go.
-     * @param   null    $pattern    String, optional pattern to match against.
-     * @param   int     $count      How many members to return at a time (Redis might return a different amount).
-     * @return  array   PHPRedis will return an array of keys or FALSE when we're done iterating.
+     * Scan a set for members
+     *
+     * @param string $key      The set to search.
+     * @param int    $iterator LONG (reference) to the iterator as we go.
+     * @param null   $pattern  String, optional pattern to match against.
+     * @param int    $count    How many members to return at a time (Redis might return a different amount)
+     *
+     * @return array|bool PHPRedis will return an array of keys or FALSE when we're done iterating
+     *
      * @link    https://redis.io/commands/sscan
      * @example
      * 
@@ -1686,9 +1878,11 @@ public function sScan($key, &$iterator, $pattern = null, $count = 0)
     /**
      * Sets a value and returns the previous entry at that key.
      *
-     * @param   string  $key
-     * @param   string  $value
-     * @return  string  A string, the previous value located at this key.
+     * @param string       $key
+     * @param string|mixed $value
+     *
+     * @return string|mixed A string (mixed, if used serializer), the previous value located at this key
+     *
      * @link    https://redis.io/commands/getset
      * @example
      * 
@@ -1702,9 +1896,10 @@ public function getSet($key, $value)
     }
 
     /**
-     * Returns a random key.
+     * Returns a random key
+     *
+     * @return string an existing key in redis
      *
-     * @return string an existing key in redis.
      * @link    https://redis.io/commands/randomkey
      * @example
      * 
@@ -1717,10 +1912,12 @@ public function randomKey()
     }
 
     /**
-     * Switches to a given database.
+     * Switches to a given database
+     *
+     * @param int $dbIndex
+     *
+     * @return bool TRUE in case of success, FALSE in case of failure
      *
-     * @param   int     $dbindex
-     * @return  bool    TRUE in case of success, FALSE in case of failure.
      * @link    https://redis.io/commands/select
      * @example
      * 
@@ -1731,16 +1928,18 @@ public function randomKey()
      * $redis->get('x');        // will return 42
      * 
*/ - public function select($dbindex) + public function select($dbIndex) { } /** * Moves a key to a different database. * - * @param string $key - * @param int $dbindex - * @return bool: TRUE in case of success, FALSE in case of failure. + * @param string $key + * @param int $dbIndex + * + * @return bool TRUE in case of success, FALSE in case of failure + * * @link https://redis.io/commands/move * @example *
@@ -1751,16 +1950,18 @@ public function select($dbindex)
      * $redis->get('x');        // will return 42
      * 
*/ - public function move($key, $dbindex) + public function move($key, $dbIndex) { } /** - * Renames a key. + * Renames a key + * + * @param string $srcKey + * @param string $dstKey + * + * @return bool TRUE in case of success, FALSE in case of failure * - * @param string $srcKey - * @param string $dstKey - * @return bool: TRUE in case of success, FALSE in case of failure. * @link https://redis.io/commands/rename * @example *
@@ -1787,14 +1988,16 @@ public function renameKey($srcKey, $dstKey)
     }
 
     /**
-     * Renames a key.
+     * Renames a key
      *
      * Same as rename, but will not replace a key if the destination already exists.
      * This is the same behaviour as setNx.
      *
-     * @param   string  $srcKey
-     * @param   string  $dstKey
-     * @return  bool:   TRUE in case of success, FALSE in case of failure.
+     * @param string $srcKey
+     * @param string $dstKey
+     *
+     * @return bool TRUE in case of success, FALSE in case of failure
+     *
      * @link    https://redis.io/commands/renamenx
      * @example
      * 
@@ -1809,11 +2012,13 @@ public function renameNx($srcKey, $dstKey)
     }
 
     /**
-     * Sets an expiration date (a timeout) on an item.
+     * Sets an expiration date (a timeout) on an item
+     *
+     * @param string $key The key that will disappear
+     * @param int    $ttl The key's remaining Time To Live, in seconds
+     *
+     * @return bool TRUE in case of success, FALSE in case of failure
      *
-     * @param   string  $key    The key that will disappear.
-     * @param   int     $ttl    The key's remaining Time To Live, in seconds.
-     * @return  bool:   TRUE in case of success, FALSE in case of failure.
      * @link    https://redis.io/commands/expire
      * @example
      * 
@@ -1828,11 +2033,13 @@ public function expire($key, $ttl)
     }
 
     /**
-     * Sets an expiration date (a timeout in milliseconds) on an item.
+     * Sets an expiration date (a timeout in milliseconds) on an item
+     *
+     * @param string $key The key that will disappear.
+     * @param int    $ttl The key's remaining Time To Live, in milliseconds
+     *
+     * @return bool TRUE in case of success, FALSE in case of failure
      *
-     * @param   string  $key    The key that will disappear.
-     * @param   int     $ttl   The key's remaining Time To Live, in milliseconds.
-     * @return  bool:   TRUE in case of success, FALSE in case of failure.
      * @link    https://redis.io/commands/pexpire
      * @example
      * 
@@ -1853,6 +2060,7 @@ public function pExpire($key, $ttl)
      *
      * @param   string  $key
      * @param   int     $ttl
+     * @return  bool
      */
     public function setTimeout($key, $ttl)
     {
@@ -1861,9 +2069,11 @@ public function setTimeout($key, $ttl)
     /**
      * Sets an expiration date (a timestamp) on an item.
      *
-     * @param   string  $key        The key that will disappear.
-     * @param   int     $timestamp  Unix timestamp. The key's date of death, in seconds from Epoch time.
-     * @return  bool:   TRUE in case of success, FALSE in case of failure.
+     * @param string $key       The key that will disappear.
+     * @param int    $timestamp Unix timestamp. The key's date of death, in seconds from Epoch time.
+     *
+     * @return bool TRUE in case of success, FALSE in case of failure
+     * 
      * @link    https://redis.io/commands/expireat
      * @example
      * 
@@ -1881,9 +2091,11 @@ public function expireAt($key, $timestamp)
     /**
      * Sets an expiration date (a timestamp) on an item. Requires a timestamp in milliseconds
      *
-     * @param   string  $key        The key that will disappear.
-     * @param   int     $timestamp  Unix timestamp. The key's date of death, in seconds from Epoch time.
-     * @return  bool:   TRUE in case of success, FALSE in case of failure.
+     * @param string $key       The key that will disappear
+     * @param int    $timestamp Unix timestamp. The key's date of death, in seconds from Epoch time
+     *
+     * @return bool TRUE in case of success, FALSE in case of failure
+     *
      * @link    https://redis.io/commands/pexpireat
      * @example
      * 
@@ -1900,8 +2112,10 @@ public function pExpireAt($key, $timestamp)
     /**
      * Returns the keys that match a certain pattern.
      *
-     * @param   string  $pattern pattern, using '*' as a wildcard.
-     * @return  array   of STRING: The keys that match a certain pattern.
+     * @param string $pattern pattern, using '*' as a wildcard
+     *
+     * @return array string[] The keys that match a certain pattern.
+     *
      * @link    https://redis.io/commands/keys
      * @example
      * 
@@ -1917,7 +2131,7 @@ public function keys($pattern)
      * @see keys()
      * @deprecated use Redis::keys()
      *
-     * @param   string  $pattern
+     * @param string $pattern
      * @link    https://redis.io/commands/keys
      */
     public function getKeys($pattern)
@@ -1925,9 +2139,10 @@ public function getKeys($pattern)
     }
 
     /**
-     * Returns the current database's size.
+     * Returns the current database's size
+     *
+     * @return int DB size, in number of keys
      *
-     * @return int DB size, in number of keys.
      * @link    https://redis.io/commands/dbsize
      * @example
      * 
@@ -1943,8 +2158,10 @@ public function dbSize()
      * Authenticate the connection using a password.
      * Warning: The password is sent in plain-text over the network.
      *
-     * @param   string  $password
-     * @return  bool:   TRUE if the connection is authenticated, FALSE otherwise.
+     * @param string $password
+     *
+     * @return bool TRUE if the connection is authenticated, FALSE otherwise
+     *
      * @link    https://redis.io/commands/auth
      * @example $redis->auth('foobared');
      */
@@ -1955,7 +2172,8 @@ public function auth($password)
     /**
      * Starts the background rewrite of AOF (Append-Only File)
      *
-     * @return  bool:   TRUE in case of success, FALSE in case of failure.
+     * @return bool TRUE in case of success, FALSE in case of failure
+     *
      * @link    https://redis.io/commands/bgrewriteaof
      * @example $redis->bgrewriteaof();
      */
@@ -1967,9 +2185,11 @@ public function bgrewriteaof()
      * Changes the slave status
      * Either host and port, or no parameter to stop being a slave.
      *
-     * @param   string  $host [optional]
-     * @param   int $port [optional]
-     * @return  bool:   TRUE in case of success, FALSE in case of failure.
+     * @param string $host [optional]
+     * @param int    $port [optional]
+     *
+     * @return bool TRUE in case of success, FALSE in case of failure
+     *
      * @link    https://redis.io/commands/slaveof
      * @example
      * 
@@ -1985,8 +2205,9 @@ public function slaveof($host = '127.0.0.1', $port = 6379)
     /**
      * Access the Redis slowLog
      *
-     * @param string $operation This can be either GET, LEN, or RESET
-     * @param int|null $length If executing a SLOWLOG GET command, you can pass an optional length.
+     * @param string   $operation This can be either GET, LEN, or RESET
+     * @param int|null $length    If executing a SLOWLOG GET command, you can pass an optional length.
+     *
      * @return mixed The return value of SLOWLOG will depend on which operation was performed.
      * - SLOWLOG GET: Array of slowLog entries, as provided by Redis
      * - SLOGLOG LEN: Integer, the length of the slowLog
@@ -2021,12 +2242,15 @@ public function slowLog(string $operation, int $length = null)
      * - "refcount"
      * - "idletime"
      *
-     * @param   string  $string
-     * @param   string  $key
-     * @return  string  for "encoding", int for "refcount" and "idletime", FALSE if the key doesn't exist.
+     * @param string $string
+     * @param string $key
+     *
+     * @return string|int|bool for "encoding", int for "refcount" and "idletime", FALSE if the key doesn't exist.
+     *
      * @link    https://redis.io/commands/object
      * @example
      * 
+     * $redis->lPush('l', 'Hello, world!');
      * $redis->object("encoding", "l"); // → ziplist
      * $redis->object("refcount", "l"); // → 1
      * $redis->object("idletime", "l"); // → 400 (in seconds, with a precision of 10 seconds).
@@ -2039,8 +2263,9 @@ public function object($string = '', $key = '')
     /**
      * Performs a synchronous save.
      *
-     * @return  bool:   TRUE in case of success, FALSE in case of failure.
+     * @return bool TRUE in case of success, FALSE in case of failure
      * If a save is already running, this command will fail and return FALSE.
+     *
      * @link    https://redis.io/commands/save
      * @example $redis->save();
      */
@@ -2051,8 +2276,9 @@ public function save()
     /**
      * Performs a background save.
      *
-     * @return bool TRUE in case of success, FALSE in case of failure.
-     * If a save is already running, this command will fail and return FALSE.
+     * @return bool TRUE in case of success, FALSE in case of failure
+     * If a save is already running, this command will fail and return FALSE
+     *
      * @link    https://redis.io/commands/bgsave
      * @example $redis->bgSave();
      */
@@ -2063,7 +2289,8 @@ public function bgsave()
     /**
      * Returns the timestamp of the last disk save.
      *
-     * @return  int:    timestamp.
+     * @return int timestamp
+     *
      * @link    https://redis.io/commands/lastsave
      * @example $redis->lastSave();
      */
@@ -2074,10 +2301,13 @@ public function lastSave()
     /**
      * Blocks the current client until all the previous write commands are successfully transferred and
      * acknowledged by at least the specified number of slaves.
-     * @param   int $numSlaves  Number of slaves that need to acknowledge previous write commands.
-     * @param   int $timeout    Timeout in milliseconds.
+     *
+     * @param int $numSlaves Number of slaves that need to acknowledge previous write commands.
+     * @param int $timeout   Timeout in milliseconds.
+     *
      * @return  int The command returns the number of slaves reached by all the writes performed in the
-     *              context of the current connection.
+     *              context of the current connection
+     *
      * @link    https://redis.io/commands/wait
      * @example $redis->wait(2, 1000);
      */
@@ -2088,9 +2318,9 @@ public function wait($numSlaves, $timeout)
     /**
      * Returns the type of data pointed by a given key.
      *
-     * @param   string  $key
-     * @return  int
+     * @param string $key
      *
+     * @return int
      * Depending on the type of the data pointed by the key,
      * this method will return the following value:
      * - string: Redis::REDIS_STRING
@@ -2099,6 +2329,7 @@ public function wait($numSlaves, $timeout)
      * - zset:  Redis::REDIS_ZSET
      * - hash:  Redis::REDIS_HASH
      * - other: Redis::REDIS_NOT_FOUND
+     *
      * @link    https://redis.io/commands/type
      * @example $redis->type('key');
      */
@@ -2109,9 +2340,11 @@ public function type($key)
     /**
      * Append specified string to the string stored in specified key.
      *
-     * @param   string  $key
-     * @param   string  $value
-     * @return  int:    Size of the value after the append
+     * @param string       $key
+     * @param string|mixed $value
+     *
+     * @return int Size of the value after the append
+     *
      * @link    https://redis.io/commands/append
      * @example
      * 
@@ -2127,10 +2360,12 @@ public function append($key, $value)
     /**
      * Return a substring of a larger string
      *
-     * @param   string  $key
-     * @param   int     $start
-     * @param   int     $end
-     * @return  string: the substring
+     * @param string $key
+     * @param int    $start
+     * @param int    $end
+     *
+     * @return string the substring
+     *
      * @link    https://redis.io/commands/getrange
      * @example
      * 
@@ -2158,10 +2393,12 @@ public function substr($key, $start, $end)
     /**
      * Changes a substring of a larger string.
      *
-     * @param   string  $key
-     * @param   int     $offset
-     * @param   string  $value
-     * @return  string: the length of the string after it was modified.
+     * @param string $key
+     * @param int    $offset
+     * @param string $value
+     *
+     * @return int the length of the string after it was modified
+     *
      * @link    https://redis.io/commands/setrange
      * @example
      * 
@@ -2177,8 +2414,9 @@ public function setRange($key, $offset, $value)
     /**
      * Get the length of a string value.
      *
-     * @param   string  $key
-     * @return  int
+     * @param string $key
+     * @return int
+     *
      * @link    https://redis.io/commands/strlen
      * @example
      * 
@@ -2194,20 +2432,23 @@ public function strlen($key)
      * Return the position of the first bit set to 1 or 0 in a string. The position is returned, thinking of the
      * string as an array of bits from left to right, where the first byte's most significant bit is at position 0,
      * the second byte's most significant bit is at position 8, and so forth.
-     * @param   string  $key
-     * @param   int     $bit
-     * @param   int     $start
-     * @param   int     $end
-     * @return  int     The command returns the position of the first bit set to 1 or 0 according to the request.
-     *                  If we look for set bits (the bit argument is 1) and the string is empty or composed of just
-     *                  zero bytes, -1 is returned. If we look for clear bits (the bit argument is 0) and the string
-     *                  only contains bit set to 1, the function returns the first bit not part of the string on the
-     *                  right. So if the string is three bytes set to the value 0xff the command BITPOS key 0 will
-     *                  return 24, since up to bit 23 all the bits are 1. Basically, the function considers the right
-     *                  of the string as padded with zeros if you look for clear bits and specify no range or the
-     *                  start argument only. However, this behavior changes if you are looking for clear bits and
-     *                  specify a range with both start and end. If no clear bit is found in the specified range, the
-     *                  function returns -1 as the user specified a clear range and there are no 0 bits in that range.
+     *
+     * @param string $key
+     * @param int    $bit
+     * @param int    $start
+     * @param int    $end
+     *
+     * @return int The command returns the position of the first bit set to 1 or 0 according to the request.
+     * If we look for set bits (the bit argument is 1) and the string is empty or composed of just
+     * zero bytes, -1 is returned. If we look for clear bits (the bit argument is 0) and the string
+     * only contains bit set to 1, the function returns the first bit not part of the string on the
+     * right. So if the string is three bytes set to the value 0xff the command BITPOS key 0 will
+     * return 24, since up to bit 23 all the bits are 1. Basically, the function considers the right
+     * of the string as padded with zeros if you look for clear bits and specify no range or the
+     * start argument only. However, this behavior changes if you are looking for clear bits and
+     * specify a range with both start and end. If no clear bit is found in the specified range, the
+     * function returns -1 as the user specified a clear range and there are no 0 bits in that range.
+     *
      * @link    https://redis.io/commands/bitpos
      * @example
      * 
@@ -2227,9 +2468,11 @@ public function bitpos($key, $bit, $start = 0, $end = null)
     /**
      * Return a single bit out of a larger string
      *
-     * @param   string  $key
-     * @param   int     $offset
-     * @return  int:    the bit value (0 or 1)
+     * @param string $key
+     * @param int    $offset
+     *
+     * @return int the bit value (0 or 1)
+     *
      * @link    https://redis.io/commands/getbit
      * @example
      * 
@@ -2245,10 +2488,12 @@ public function getBit($key, $offset)
     /**
      * Changes a single bit of a string.
      *
-     * @param   string  $key
-     * @param   int     $offset
-     * @param   bool|int $value bool or int (1 or 0)
-     * @return  int:    0 or 1, the value of the bit before it was set.
+     * @param string   $key
+     * @param int      $offset
+     * @param bool|int $value  bool or int (1 or 0)
+     *
+     * @return int 0 or 1, the value of the bit before it was set
+     *
      * @link    https://redis.io/commands/setbit
      * @example
      * 
@@ -2263,10 +2508,12 @@ public function setBit($key, $offset, $value)
     }
 
     /**
-     * Count bits in a string.
+     * Count bits in a string
+     *
+     * @param string $key
+     *
+     * @return int The number of bits set to 1 in the value behind the input key
      *
-     * @param   string  $key
-     * @return  int     The number of bits set to 1 in the value behind the input key.
      * @link    https://redis.io/commands/bitcount
      * @example
      * 
@@ -2284,12 +2531,13 @@ public function bitCount($key)
     /**
      * Bitwise operation on multiple keys.
      *
-     * @param   string  $operation  either "AND", "OR", "NOT", "XOR"
-     * @param   string  $retKey     return key
-     * @param   string  $key1
-     * @param   string  $key2
-     * @param   string  $key3
-     * @return  int     The size of the string stored in the destination key.
+     * @param string $operation    either "AND", "OR", "NOT", "XOR"
+     * @param string $retKey       return key
+     * @param string $key1         first key
+     * @param string ...$otherKeys variadic list of keys
+     *
+     * @return int The size of the string stored in the destination key
+     *
      * @link    https://redis.io/commands/bitop
      * @example
      * 
@@ -2302,14 +2550,14 @@ public function bitCount($key)
      * $redis->bitOp('XOR', 'bit', 'bit1', 'bit2'); // bit = 11
      * 
*/ - public function bitOp($operation, $retKey, $key1, $key2, $key3 = null) + public function bitOp($operation, $retKey, $key1, ...$otherKeys) { } /** * Removes all entries from the current database. * - * @return bool: Always TRUE. + * @return bool Always TRUE * @link https://redis.io/commands/flushdb * @example $redis->flushDB(); */ @@ -2320,7 +2568,8 @@ public function flushDB() /** * Removes all entries from all databases. * - * @return bool: Always TRUE. + * @return bool Always TRUE + * * @link https://redis.io/commands/flushall * @example $redis->flushAll(); */ @@ -2331,16 +2580,18 @@ public function flushAll() /** * Sort * - * @param string $key - * @param array $option array(key => value, ...) - optional, with the following keys and values: + * @param string $key + * @param array $option array(key => value, ...) - optional, with the following keys and values: * - 'by' => 'some_pattern_*', * - 'limit' => array(0, 1), * - 'get' => 'some_other_pattern_*' or an array of patterns, * - 'sort' => 'asc' or 'desc', * - 'alpha' => TRUE, * - 'store' => 'external-key' - * @return array - * An array of values, or a number corresponding to the number of elements stored if that was used. + * + * @return array + * An array of values, or a number corresponding to the number of elements stored if that was used + * * @link https://redis.io/commands/sort * @example *
@@ -2362,7 +2613,8 @@ public function sort($key, $option = null)
 
     /**
      * Returns an associative array of strings and integers
-     * @param   string   $option    Optional. The option to provide redis.
+     *
+     * @param string $option Optional. The option to provide redis.
      * SERVER | CLIENTS | MEMORY | PERSISTENCE | STATS | REPLICATION | CPU | CLASTER | KEYSPACE | COMANDSTATS
      *
      * Returns an associative array of strings and integers, with the following keys:
@@ -2408,8 +2660,10 @@ public function sort($key, $option = null)
      * - latest_fork_usec
      * - vm_enabled
      * - role
-     * @link    https://redis.io/commands/info
+     *
      * @return string
+     *
+     * @link    https://redis.io/commands/info
      * @example
      * 
      * $redis->info();
@@ -2434,6 +2688,7 @@ public function info($option = null)
      *      - Number of expired keys
      *
      * @return bool `TRUE` in case of success, `FALSE` in case of failure.
+     *
      * @example $redis->resetStat();
      * @link https://redis.io/commands/config-resetstat
      */
@@ -2444,10 +2699,16 @@ public function resetStat()
     /**
      * Returns the time to live left for a given key, in seconds. If the key doesn't exist, FALSE is returned.
      *
-     * @param   string  $key
-     * @return  int,    the time left to live in seconds.
+     * @param string $key
+     *
+     * @return int|bool the time left to live in seconds
+     *
      * @link    https://redis.io/commands/ttl
-     * @example $redis->ttl('key');
+     * @example
+     * 
+     * $redis->setex('key', 123, 'test');
+     * $redis->ttl('key'); // int(123)
+     * 
*/ public function ttl($key) { @@ -2458,10 +2719,16 @@ public function ttl($key) * * If the key doesn't exist, FALSE is returned. * - * @param string $key - * @return int the time left to live in milliseconds. + * @param string $key + * + * @return int|bool the time left to live in milliseconds + * * @link https://redis.io/commands/pttl - * @example $redis->pttl('key'); + * @example + *
+     * $redis->setex('key', 123, 'test');
+     * $redis->pttl('key'); // int(122999)
+     * 
*/ public function pttl($key) { @@ -2470,8 +2737,10 @@ public function pttl($key) /** * Remove the expiration timer from a key. * - * @param string $key - * @return bool: TRUE if a timeout was removed, FALSE if the key didn’t exist or didn’t have an expiration timer. + * @param string $key + * + * @return bool TRUE if a timeout was removed, FALSE if the key didn’t exist or didn’t have an expiration timer. + * * @link https://redis.io/commands/persist * @example $redis->persist('key'); */ @@ -2483,8 +2752,10 @@ public function persist($key) * Sets multiple key-value pairs in one atomic command. * MSETNX only returns TRUE if all the keys were set (see SETNX). * - * @param array(key => value) $array Pairs: array(key => value, ...) - * @return bool TRUE in case of success, FALSE in case of failure. + * @param array $array Pairs: array(key => value, ...) + * + * @return bool TRUE in case of success, FALSE in case of failure + * * @link https://redis.io/commands/mset * @example *
@@ -2505,6 +2776,7 @@ public function mset(array $array)
      * If one or more keys dont exist, the array will contain FALSE at the position of the key.
      *
      * @param array $keys Array containing the list of the keys
+     *
      * @return array Array containing the values related to keys in argument
      *
      * @deprecated use Redis::mGet()
@@ -2528,6 +2800,7 @@ public function getMultiple(array $keys)
      * the special value false is returned. Because of this, the operation never fails.
      *
      * @param array $array
+     *
      * @return array
      *
      * @link https://redis.io/commands/mget
@@ -2552,8 +2825,9 @@ public function mget(array $array)
 
     /**
      * @see mset()
-     * @param   array $array
-     * @return  int 1 (if the keys were set) or 0 (no key was set)
+     * @param array $array
+     * @return int 1 (if the keys were set) or 0 (no key was set)
+     *
      * @link    https://redis.io/commands/msetnx
      */
     public function msetnx(array $array)
@@ -2565,9 +2839,12 @@ public function msetnx(array $array)
      * Also return this value.
      *
      * @since   redis >= 1.1
-     * @param   string  $srcKey
-     * @param   string  $dstKey
-     * @return  string  The element that was moved in case of success, FALSE in case of failure.
+     *
+     * @param string $srcKey
+     * @param string $dstKey
+     *
+     * @return string|mixed|bool The element that was moved in case of success, FALSE in case of failure.
+     *
      * @link    https://redis.io/commands/rpoplpush
      * @example
      * 
@@ -2607,10 +2884,12 @@ public function rpoplpush($srcKey, $dstKey)
     /**
      * A blocking version of rpoplpush, with an integral timeout in the third parameter.
      *
-     * @param   string  $srcKey
-     * @param   string  $dstKey
-     * @param   int     $timeout
-     * @return  string  The element that was moved in case of success, FALSE in case of timeout.
+     * @param string $srcKey
+     * @param string $dstKey
+     * @param int    $timeout
+     *
+     * @return  string|mixed|bool  The element that was moved in case of success, FALSE in case of timeout
+     *
      * @link    https://redis.io/commands/brpoplpush
      */
     public function brpoplpush($srcKey, $dstKey, $timeout)
@@ -2618,32 +2897,50 @@ public function brpoplpush($srcKey, $dstKey, $timeout)
     }
 
     /**
-     * Adds the specified member with a given score to the sorted set stored at key.
+     * Adds the specified member with a given score to the sorted set stored at key
+     *
+     * @param string       $key     Required key
+     * @param array        $options Options if needed
+     * @param float        $score1  Required score
+     * @param string|mixed $value1  Required value
+     * @param float        $score2  Optional score
+     * @param string|mixed $value2  Optional value
+     * @param float        $scoreN  Optional score
+     * @param string|mixed $valueN  Optional value
+     *
+     * @return int Number of values added
      *
-     * @param   string  $key    Required key
-     * @param   float   $score1 Required score
-     * @param   string  $value1 Required value
-     * @param   float   $score2 Optional score
-     * @param   string  $value2 Optional value
-     * @param   float   $scoreN Optional score
-     * @param   string  $valueN Optional value
-     * @return  int     Number of values added
      * @link    https://redis.io/commands/zadd
      * @example
      * 
      * 
      * $redis->zAdd('z', 1, 'v1', 2, 'v2', 3, 'v3', 4, 'v4' );  // int(2)
      * $redis->zRem('z', 'v2', 'v3');                           // int(2)
+     * $redis->zAdd('z', ['NX'], 5, 'v5');                      // int(1)
+     * $redis->zAdd('z', ['NX'], 6, 'v5');                      // int(0)
+     * $redis->zAdd('z', 7, 'v6');                              // int(1)
+     * $redis->zAdd('z', 8, 'v6');                              // int(0)
+     *
      * var_dump( $redis->zRange('z', 0, -1) );
-     * //// Output:
-     * // array(2) {
+     * // Output:
+     * // array(4) {
      * //   [0]=> string(2) "v1"
      * //   [1]=> string(2) "v4"
+     * //   [2]=> string(2) "v5"
+     * //   [3]=> string(2) "v8"
      * // }
+     *
+     * var_dump( $redis->zRange('z', 0, -1, true) );
+     * // Output:
+     * // array(4) {
+     * //   ["v1"]=> float(1)
+     * //   ["v4"]=> float(4)
+     * //   ["v5"]=> float(5)
+     * //   ["v6"]=> float(8)
      * 
*
*/ - public function zAdd($key, $score1, $value1, $score2 = null, $value2 = null, $scoreN = null, $valueN = null) + public function zAdd($key, $options, $score1, $value1, $score2 = null, $value2 = null, $scoreN = null, $valueN = null) { } @@ -2655,11 +2952,13 @@ public function zAdd($key, $score1, $value1, $score2 = null, $value2 = null, $sc * -1 the last element, * -2 the penultimate ... * - * @param string $key - * @param int $start - * @param int $end - * @param bool $withscores - * @return array Array containing the values in specified range. + * @param string $key + * @param int $start + * @param int $end + * @param bool $withscores + * + * @return array Array containing the values in specified range. + * * @link https://redis.io/commands/zrange * @example *
@@ -2678,11 +2977,12 @@ public function zRange($key, $start, $end, $withscores = null)
     /**
      * Deletes a specified member from the ordered set.
      *
-     * @param   string  $key
-     * @param   string  $member1
-     * @param   string  $member2
-     * @param   string  $memberN
-     * @return  int     Number of deleted values
+     * @param string       $key
+     * @param string|mixed $member1
+     * @param string|mixed ...$otherMembers
+     *
+     * @return int Number of deleted values
+     *
      * @link    https://redis.io/commands/zrem
      * @example
      * 
@@ -2696,7 +2996,7 @@ public function zRange($key, $start, $end, $withscores = null)
      * // }
      * 
*/ - public function zRem($key, $member1, $member2 = null, $memberN = null) + public function zRem($key, $member1, ...$otherMembers) { } @@ -2705,13 +3005,13 @@ public function zRem($key, $member1, $member2 = null, $memberN = null) * @link https://redis.io/commands/zrem * @deprecated use Redis::zRem() * - * @param string $key - * @param string $member1 - * @param string $member2 - * @param string $memberN - * @return int Number of deleted values + * @param string $key + * @param string|mixed $member1 + * @param string|mixed ...$otherMembers + * + * @return int Number of deleted values */ - public function zDelete($key, $member1, $member2 = null, $memberN = null) + public function zDelete($key, $member1, ...$otherMembers) { } @@ -2723,11 +3023,13 @@ public function zDelete($key, $member1, $member2 = null, $memberN = null) * -1 the last element, * -2 the penultimate ... * - * @param string $key - * @param int $start - * @param int $end - * @param bool $withscore - * @return array Array containing the values in specified range. + * @param string $key + * @param int $start + * @param int $end + * @param bool $withscore + * + * @return array Array containing the values in specified range. + * * @link https://redis.io/commands/zrevrange * @example *
@@ -2751,13 +3053,15 @@ public function zRevRange($key, $start, $end, $withscore = null)
      *
      * zRevRangeByScore returns the same items in reverse order, when the start and end parameters are swapped.
      *
-     * @param   string  $key
-     * @param   int     $start
-     * @param   int     $end
-     * @param   array   $options Two options are available:
-     *                      - withscores => TRUE,
-     *                      - and limit => array($offset, $count)
-     * @return  array   Array containing the values in specified range.
+     * @param string $key
+     * @param int    $start
+     * @param int    $end
+     * @param array  $options Two options are available:
+     *  - withscores => TRUE,
+     *  - and limit => array($offset, $count)
+     *
+     * @return array Array containing the values in specified range.
+     *
      * @link    https://redis.io/commands/zrangebyscore
      * @example
      * 
@@ -2766,7 +3070,6 @@ public function zRevRange($key, $start, $end, $withscore = null)
      * $redis->zAdd('key', 10, 'val10');
      * $redis->zRangeByScore('key', 0, 3);                                          // array('val0', 'val2')
      * $redis->zRangeByScore('key', 0, 3, array('withscores' => TRUE);              // array('val0' => 0, 'val2' => 2)
-     * $redis->zRangeByScore('key', 0, 3, array('limit' => array(1, 1));                        // array('val2' => 2)
      * $redis->zRangeByScore('key', 0, 3, array('limit' => array(1, 1));                        // array('val2')
      * $redis->zRangeByScore('key', 0, 3, array('withscores' => TRUE, 'limit' => array(1, 1));  // array('val2' => 2)
      * 
@@ -2777,12 +3080,12 @@ public function zRangeByScore($key, $start, $end, array $options = array()) /** * @see zRangeByScore() - * @param string $key - * @param int $start - * @param int $end - * @param array $options + * @param string $key + * @param int $start + * @param int $end + * @param array $options * - * @return array + * @return array */ public function zRevRangeByScore($key, $start, $end, array $options = array()) { @@ -2793,12 +3096,15 @@ public function zRevRangeByScore($key, $start, $end, array $options = array()) * min and max values are required to start with '(' (exclusive), '[' (inclusive), or be exactly the values * '-' (negative inf) or '+' (positive inf). The command must be called with either three *or* five * arguments or will return FALSE. - * @param string $key The ZSET you wish to run against. - * @param int $min The minimum alphanumeric value you wish to get. - * @param int $max The maximum alphanumeric value you wish to get. - * @param int $offset Optional argument if you wish to start somewhere other than the first element. - * @param int $limit Optional argument if you wish to limit the number of elements returned. - * @return array Array containing the values in the specified range. + * + * @param string $key The ZSET you wish to run against. + * @param int $min The minimum alphanumeric value you wish to get. + * @param int $max The maximum alphanumeric value you wish to get. + * @param int $offset Optional argument if you wish to start somewhere other than the first element. + * @param int $limit Optional argument if you wish to limit the number of elements returned. + * + * @return array|bool Array containing the values in the specified range. + * * @link https://redis.io/commands/zrangebylex * @example *
@@ -2817,12 +3123,14 @@ public function zRangeByLex($key, $min, $max, $offset = null, $limit = null)
 
     /**
      * @see zRangeByLex()
-     * @param   string  $key
-     * @param   int     $min
-     * @param   int     $max
-     * @param   int     $offset
-     * @param   int     $limit
-     * @return  array
+     * @param string $key
+     * @param int    $min
+     * @param int    $max
+     * @param int    $offset
+     * @param int    $limit
+     *
+     * @return array
+     *
      * @link    https://redis.io/commands/zrevrangebylex
      */
     public function zRevRangeByLex($key, $min, $max, $offset = null, $limit = null)
@@ -2834,10 +3142,12 @@ public function zRevRangeByLex($key, $min, $max, $offset = null, $limit = null)
      * scores in the range [start,end]. Adding a parenthesis before start or end excludes it
      * from the range. +inf and -inf are also valid limits.
      *
-     * @param   string  $key
-     * @param   string  $start
-     * @param   string  $end
-     * @return  int     the size of a corresponding zRangeByScore.
+     * @param string $key
+     * @param string $start
+     * @param string $end
+     *
+     * @return int the size of a corresponding zRangeByScore
+     *
      * @link    https://redis.io/commands/zcount
      * @example
      * 
@@ -2854,10 +3164,12 @@ public function zCount($key, $start, $end)
     /**
      * Deletes the elements of the sorted set stored at the specified key which have scores in the range [start,end].
      *
-     * @param   string          $key
-     * @param   float|string    $start double or "+inf" or "-inf" string
-     * @param   float|string    $end double or "+inf" or "-inf" string
-     * @return  int             The number of values deleted from the sorted set
+     * @param string       $key
+     * @param float|string $start double or "+inf" or "-inf" string
+     * @param float|string $end double or "+inf" or "-inf" string
+     *
+     * @return int The number of values deleted from the sorted set
+     *
      * @link    https://redis.io/commands/zremrangebyscore
      * @example
      * 
@@ -2875,9 +3187,9 @@ public function zRemRangeByScore($key, $start, $end)
      * @see zRemRangeByScore()
      * @deprecated use Redis::zRemRangeByScore()
      *
-     * @param string    $key
-     * @param float     $start
-     * @param float     $end
+     * @param string $key
+     * @param float  $start
+     * @param float  $end
      */
     public function zDeleteRangeByScore($key, $start, $end)
     {
@@ -2886,10 +3198,12 @@ public function zDeleteRangeByScore($key, $start, $end)
     /**
      * Deletes the elements of the sorted set stored at the specified key which have rank in the range [start,end].
      *
-     * @param   string  $key
-     * @param   int     $start
-     * @param   int     $end
-     * @return  int     The number of values deleted from the sorted set
+     * @param string $key
+     * @param int    $start
+     * @param int    $end
+     *
+     * @return int The number of values deleted from the sorted set
+     *
      * @link    https://redis.io/commands/zremrangebyrank
      * @example
      * 
@@ -2909,9 +3223,9 @@ public function zRemRangeByRank($key, $start, $end)
      * @link    https://redis.io/commands/zremrangebyscore
      * @deprecated use Redis::zRemRangeByRank()
      *
-     * @param   string  $key
-     * @param   int     $start
-     * @param   int     $end
+     * @param string $key
+     * @param int    $start
+     * @param int    $end
      */
     public function zDeleteRangeByRank($key, $start, $end)
     {
@@ -2920,8 +3234,9 @@ public function zDeleteRangeByRank($key, $start, $end)
     /**
      * Returns the cardinality of an ordered set.
      *
-     * @param   string  $key
-     * @return  int     the set's cardinality
+     * @param string $key
+     *
+     * @return int the set's cardinality
      *
      * @link    https://redis.io/commands/zsize
      * @example
@@ -2941,6 +3256,7 @@ public function zCard($key)
      * @deprecated use Redis::zCard()
      *
      * @param string $key
+     * @return int
      */
     public function zSize($key)
     {
@@ -2949,9 +3265,11 @@ public function zSize($key)
     /**
      * Returns the score of a given member in the specified sorted set.
      *
-     * @param   string  $key
-     * @param   string  $member
-     * @return  float
+     * @param string       $key
+     * @param string|mixed $member
+     *
+     * @return float|bool false if member or key not exists
+     *
      * @link    https://redis.io/commands/zscore
      * @example
      * 
@@ -2967,9 +3285,11 @@ public function zScore($key, $member)
      * Returns the rank of a given member in the specified sorted set, starting at 0 for the item
      * with the smallest score. zRevRank starts at 0 for the item with the largest score.
      *
-     * @param   string  $key
-     * @param   string  $member
-     * @return  int     the item's score.
+     * @param string       $key
+     * @param string|mixed $member
+     *
+     * @return int|bool the item's score, or false if key or member is not exists
+     *
      * @link    https://redis.io/commands/zrank
      * @example
      * 
@@ -2988,9 +3308,11 @@ public function zRank($key, $member)
 
     /**
      * @see zRank()
-     * @param  string $key
-     * @param  string $member
-     * @return int    the item's score
+     * @param string       $key
+     * @param string|mixed $member
+     *
+     * @return int|bool the item's score, false - if key or member is not exists
+     *
      * @link   https://redis.io/commands/zrevrank
      */
     public function zRevRank($key, $member)
@@ -3000,10 +3322,12 @@ public function zRevRank($key, $member)
     /**
      * Increments the score of a member from a sorted set by a given amount.
      *
-     * @param   string  $key
-     * @param   float   $value (double) value that will be added to the member's score
-     * @param   string  $member
-     * @return  float   the new value
+     * @param string $key
+     * @param float  $value (double) value that will be added to the member's score
+     * @param string $member
+     *
+     * @return float the new value
+     *
      * @link    https://redis.io/commands/zincrby
      * @example
      * 
@@ -3025,12 +3349,14 @@ public function zIncrBy($key, $value, $member)
      * before applying the aggregation. The forth argument defines the AGGREGATE option which
      * specify how the results of the union are aggregated.
      *
-     * @param string    $Output
-     * @param array     $ZSetKeys
-     * @param array     $Weights
-     * @param string    $aggregateFunction  Either "SUM", "MIN", or "MAX": defines the behaviour to use on
+     * @param string $output
+     * @param array  $zSetKeys
+     * @param array  $weights
+     * @param string $aggregateFunction  Either "SUM", "MIN", or "MAX": defines the behaviour to use on
      * duplicate entries during the zUnionStore
-     * @return int The number of values in the new sorted set.
+     *
+     * @return int The number of values in the new sorted set
+     *
      * @link    https://redis.io/commands/zunionstore
      * @example
      * 
@@ -3054,7 +3380,7 @@ public function zIncrBy($key, $value, $member)
      * $redis->zUnionStore('ko3', array('k1', 'k2'), array(5, 1)); // 4, 'ko3' => array('val0', 'val2', 'val3', 'val1')
      * 
*/ - public function zUnionStore($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM') + public function zUnionStore($output, $zSetKeys, array $weights = null, $aggregateFunction = 'SUM') { } @@ -3079,12 +3405,14 @@ public function zUnion($Output, $ZSetKeys, array $Weights = null, $aggregateFunc * before applying the aggregation. The forth argument defines the AGGREGATE option which * specify how the results of the union are aggregated. * - * @param string $Output - * @param array $ZSetKeys - * @param array $Weights - * @param string $aggregateFunction Either "SUM", "MIN", or "MAX": + * @param string $output + * @param array $zSetKeys + * @param array $weights + * @param string $aggregateFunction Either "SUM", "MIN", or "MAX": * defines the behaviour to use on duplicate entries during the zInterStore. - * @return int The number of values in the new sorted set. + * + * @return int The number of values in the new sorted set. + * * @link https://redis.io/commands/zinterstore * @example *
@@ -3112,7 +3440,7 @@ public function zUnion($Output, $ZSetKeys, array $Weights = null, $aggregateFunc
      * $redis->zInterStore('ko4', array('k1', 'k2'), array(1, 5), 'max'); // 2, 'ko4' => array('val3', 'val1')
      * 
*/ - public function zInterStore($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM') + public function zInterStore($output, $zSetKeys, array $weights = null, $aggregateFunction = 'SUM') { } @@ -3130,12 +3458,14 @@ public function zInter($Output, $ZSetKeys, array $Weights = null, $aggregateFunc } /** - * Scan a sorted set for members, with optional pattern and count. - * @param string $key String, the set to scan. - * @param int $iterator Long (reference), initialized to NULL. - * @param string $pattern String (optional), the pattern to match. - * @param int $count How many keys to return per iteration (Redis might return a different number). - * @return array PHPRedis will return matching keys from Redis, or FALSE when iteration is complete. + * Scan a sorted set for members, with optional pattern and count + * + * @param string $key String, the set to scan. + * @param int $iterator Long (reference), initialized to NULL. + * @param string $pattern String (optional), the pattern to match. + * @param int $count How many keys to return per iteration (Redis might return a different number). + * + * @return array|bool PHPRedis will return matching keys from Redis, or FALSE when iteration is complete * * @link https://redis.io/commands/zscan * @example @@ -3159,6 +3489,7 @@ public function zScan($key, &$iterator, $pattern = null, $count = 0) * @param string|array $key1 * @param string|array $key2 ... * @param int $timeout + * * @return array Either an array with the key member and score of the higest or lowest element or an empty array * if the timeout was reached without an element to pop. * @@ -3183,6 +3514,7 @@ public function bzPopMax($key1, $key2, $timeout) * @param string|array $key1 * @param string|array $key2 ... * @param int $timeout + * * @return array Either an array with the key member and score of the higest or lowest element or an empty array * if the timeout was reached without an element to pop. * @@ -3200,7 +3532,8 @@ public function bzPopMin($key1, $key2, $timeout) * @param string $key * @param string $hashKey * @param string $value - * @return int + * + * @return int|bool * - 1 if value didn't exist and was added successfully, * - 0 if the value was already present and was replaced, FALSE if there was an error. * @@ -3222,10 +3555,11 @@ public function hSet($key, $hashKey, $value) /** * Adds a value to the hash stored at key only if this field isn't already in the hash. * - * @param string $key - * @param string $hashKey - * @param string $value - * @return bool TRUE if the field was set, FALSE if it was already present. + * @param string $key + * @param string $hashKey + * @param string $value + * + * @return bool TRUE if the field was set, FALSE if it was already present. * * @link https://redis.io/commands/hsetnx * @example @@ -3244,9 +3578,10 @@ public function hSetNx($key, $hashKey, $value) * Gets a value from the hash stored at key. * If the hash table doesn't exist, or the key doesn't exist, FALSE is returned. * - * @param string $key - * @param string $hashKey - * @return string The value, if the command executed successfully BOOL FALSE in case of failure + * @param string $key + * @param string $hashKey + * + * @return string The value, if the command executed successfully BOOL FALSE in case of failure * * @link https://redis.io/commands/hget */ @@ -3257,8 +3592,9 @@ public function hGet($key, $hashKey) /** * Returns the length of a hash, in number of items * - * @param string $key - * @return int the number of items in a hash, FALSE if the key doesn't exist or isn't a hash. + * @param string $key + * + * @return int the number of items in a hash, FALSE if the key doesn't exist or isn't a hash * * @link https://redis.io/commands/hlen * @example @@ -3277,11 +3613,11 @@ public function hLen($key) * Removes a values from the hash stored at key. * If the hash table doesn't exist, or the key doesn't exist, FALSE is returned. * - * @param string $key - * @param string $hashKey1 - * @param string $hashKey2 - * @param string $hashKeyN - * @return int Number of deleted fields + * @param string $key + * @param string $hashKey1 + * @param string ...$otherHashKeys + * + * @return int Number of deleted fields * * @link https://redis.io/commands/hdel * @example @@ -3304,15 +3640,16 @@ public function hLen($key) * // } *
*/ - public function hDel($key, $hashKey1, $hashKey2 = null, $hashKeyN = null) + public function hDel($key, $hashKey1, ...$otherHashKeys) { } /** * Returns the keys in a hash, as an array of strings. * - * @param string $key - * @return array An array of elements, the keys of the hash. This works like PHP's array_keys(). + * @param string $key + * + * @return array An array of elements, the keys of the hash. This works like PHP's array_keys(). * * @link https://redis.io/commands/hkeys * @example @@ -3345,8 +3682,9 @@ public function hKeys($key) /** * Returns the values in a hash, as an array of strings. * - * @param string $key - * @return array An array of elements, the values of the hash. This works like PHP's array_values(). + * @param string $key + * + * @return array An array of elements, the values of the hash. This works like PHP's array_values(). * * @link https://redis.io/commands/hvals * @example @@ -3379,8 +3717,9 @@ public function hVals($key) /** * Returns the whole hash, as an array of strings indexed by strings. * - * @param string $key - * @return array An array of elements, the contents of the hash. + * @param string $key + * + * @return array An array of elements, the contents of the hash. * * @link https://redis.io/commands/hgetall * @example @@ -3413,9 +3752,10 @@ public function hGetAll($key) /** * Verify if the specified member exists in a key. * - * @param string $key - * @param string $hashKey - * @return bool: If the member exists in the hash table, return TRUE, otherwise return FALSE. + * @param string $key + * @param string $hashKey + * + * @return bool If the member exists in the hash table, return TRUE, otherwise return FALSE. * * @link https://redis.io/commands/hexists * @example @@ -3432,10 +3772,11 @@ public function hExists($key, $hashKey) /** * Increments the value of a member from a hash by a given amount. * - * @param string $key - * @param string $hashKey - * @param int $value (integer) value that will be added to the member's value - * @return int the new value + * @param string $key + * @param string $hashKey + * @param int $value (integer) value that will be added to the member's value + * + * @return int the new value * * @link https://redis.io/commands/hincrby * @example @@ -3452,10 +3793,11 @@ public function hIncrBy($key, $hashKey, $value) /** * Increment the float value of a hash field by the given amount * - * @param string $key - * @param string $field - * @param float $increment - * @return float + * @param string $key + * @param string $field + * @param float $increment + * + * @return float * * @link https://redis.io/commands/hincrbyfloat * @example @@ -3485,9 +3827,10 @@ public function hIncrByFloat($key, $field, $increment) * Fills in a whole hash. Non-string values are converted to string, using the standard (string) cast. * NULL values are stored as empty strings * - * @param string $key - * @param array $hashKeys key → value array - * @return bool + * @param string $key + * @param array $hashKeys key → value array + * + * @return bool * * @link https://redis.io/commands/hmset * @example @@ -3504,9 +3847,10 @@ public function hMSet($key, $hashKeys) /** * Retirieve the values associated to the specified fields in the hash. * - * @param string $key - * @param array $hashKeys - * @return array Array An array of elements, the values of the specified fields in the hash, + * @param string $key + * @param array $hashKeys + * + * @return array Array An array of elements, the values of the specified fields in the hash, * with the hash keys as array keys. * * @link https://redis.io/commands/hmget @@ -3525,11 +3869,12 @@ public function hMGet($key, $hashKeys) /** * Scan a HASH value for members, with an optional pattern and count. * - * @param string $key - * @param int $iterator - * @param string $pattern Optional pattern to match against. - * @param int $count How many keys to return in a go (only a sugestion to Redis). - * @return array An array of members that match our pattern. + * @param string $key + * @param int $iterator + * @param string $pattern Optional pattern to match against. + * @param int $count How many keys to return in a go (only a sugestion to Redis). + * + * @return array An array of members that match our pattern. * * @link https://redis.io/commands/hscan * @example @@ -3551,6 +3896,7 @@ public function hScan($key, &$iterator, $pattern = null, $count = 0) * * @param string $key * @param string $field + * * @return int the string length of the value associated with field, or zero when field is not present in the hash * or key does not exist at all. * @@ -3566,9 +3912,10 @@ public function hStrLen(string $key, string $field) * This function must be called with at least one longitude, latitude, member triplet. * * @param string $key - * @param float $longitude - * @param float $latitude - * @param string string $member + * @param float $longitude + * @param float $latitude + * @param string $member + * * @return int The number of elements added to the geospatial key * * @link https://redis.io/commands/geoadd @@ -3594,7 +3941,8 @@ public function geoadd($key, $longitude, $latitude, $member) * Retrieve Geohash strings for one or more elements of a geospatial index. * @param string $key - * @param string $member ... + * @param string ...$member variadic list of members + * * @return array One or more Redis Geohash encoded strings * * @link https://redis.io/commands/geohash @@ -3663,6 +4011,7 @@ public function geopos(string $key, string $member) * @param string $member1 * @param string $member2 * @param string|null $unit + * * @return float The distance between the two passed members in the units requested (meters by default) * * @link https://redis.io/commands/geodist @@ -3704,23 +4053,25 @@ public function geodist($key, $member1, $member2, $unit = null) /** * Return members of a set with geospatial information that are within the radius specified by the caller. - * + * * @param $key * @param $longitude * @param $latitude * @param $radius * @param $unit * @param array|null $options - * |Key |Value |Description | + *
+     * |Key         |Value          |Description                                        |
      * |------------|---------------|---------------------------------------------------|
-     * |COUNT	    |integer > 0	|Limit how many results are returned                |
-     * |            |WITHCOORD	    |Return longitude and latitude of matching members  |
-     * |            |WITHDIST	    |Return the distance from the center                |
-     * |            |WITHHASH	    |Return the raw geohash-encoded score               |
-     * |            |ASC	        |Sort results in ascending order                    |
-     * |            |DESC	        |Sort results in descending order                   |
-     * |STORE	    |key	        |Store results in key                               |
-     * |STOREDIST	|key	        |Store the results as distances in key              |
+     * |COUNT       |integer > 0    |Limit how many results are returned                |
+     * |            |WITHCOORD      |Return longitude and latitude of matching members  |
+     * |            |WITHDIST       |Return the distance from the center                |
+     * |            |WITHHASH       |Return the raw geohash-encoded score               |
+     * |            |ASC            |Sort results in ascending order                    |
+     * |            |DESC           |Sort results in descending order                   |
+     * |STORE       |key            |Store results in key                               |
+     * |STOREDIST   |key            |Store the results as distances in key              |
+     * 
* Note: It doesn't make sense to pass both ASC and DESC options but if both are passed * the last one passed will be used. * Note: When using STORE[DIST] in Redis Cluster, the store key must has to the same slot as @@ -3804,12 +4155,14 @@ public function georadius($key, $longitude, $latitude, $radius, $unit, array $op /** * This method is identical to geoRadius except that instead of passing a longitude and latitude as the "source" - * you pass an existing member in the geospatial set. + * you pass an existing member in the geospatial set + * * @param string $key * @param string $member * @param $radius * @param $units * @param array|null $options see georadius + * * @return array The zero or more entries that are close enough to the member given the distance and radius specified * * @link https://redis.io/commands/georadiusbymember @@ -3845,12 +4198,13 @@ public function georadiusbymember($key, $member, $radius, $units, array $options /** * Get or Set the redis config keys. * - * @param string $operation either `GET` or `SET` - * @param string $key for `SET`, glob-pattern for `GET`. See https://redis.io/commands/config-get for examples. - * @param string $value optional string (only for `SET`) - * @return array Associative array for `GET`, key -> value + * @param string $operation either `GET` or `SET` + * @param string $key for `SET`, glob-pattern for `GET` + * @param string|mixed $value optional string (only for `SET`) + * + * @return array Associative array for `GET`, key -> value + * * @link https://redis.io/commands/config-get - * @link https://redis.io/commands/config-set * @example *
      * $redis->config("GET", "*max-*-entries*");
@@ -3862,25 +4216,28 @@ public function config($operation, $key, $value)
     }
 
     /**
-     *  Evaluate a LUA script serverside
-     *  @param  string  $script
-     *  @param  array   $args
-     *  @param  int     $numKeys
-     *  @return mixed   What is returned depends on what the LUA script itself returns, which could be a scalar value
-     *  (int/string), or an array. Arrays that are returned can also contain other arrays, if that's how it was set up in
-     *  your LUA script.  If there is an error executing the LUA script, the getLastError() function can tell you the
-     *  message that came back from Redis (e.g. compile error).
-     *  @link   https://redis.io/commands/eval
-     *  @example
-     *  
-     *  $redis->eval("return 1"); // Returns an integer: 1
-     *  $redis->eval("return {1,2,3}"); // Returns Array(1,2,3)
-     *  $redis->del('mylist');
-     *  $redis->rpush('mylist','a');
-     *  $redis->rpush('mylist','b');
-     *  $redis->rpush('mylist','c');
-     *  // Nested response:  Array(1,2,3,Array('a','b','c'));
-     *  $redis->eval("return {1,2,3,redis.call('lrange','mylist',0,-1)}}");
+     * Evaluate a LUA script serverside
+     *
+     * @param string $script
+     * @param array  $args
+     * @param int    $numKeys
+     *
+     * @return mixed What is returned depends on what the LUA script itself returns, which could be a scalar value
+     * (int/string), or an array. Arrays that are returned can also contain other arrays, if that's how it was set up in
+     * your LUA script.  If there is an error executing the LUA script, the getLastError() function can tell you the
+     * message that came back from Redis (e.g. compile error).
+     *
+     * @link   https://redis.io/commands/eval
+     * @example
+     * 
+     * $redis->eval("return 1"); // Returns an integer: 1
+     * $redis->eval("return {1,2,3}"); // Returns Array(1,2,3)
+     * $redis->del('mylist');
+     * $redis->rpush('mylist','a');
+     * $redis->rpush('mylist','b');
+     * $redis->rpush('mylist','c');
+     * // Nested response:  Array(1,2,3,Array('a','b','c'));
+     * $redis->eval("return {1,2,3,redis.call('lrange','mylist',0,-1)}}");
      * 
*/ public function eval($script, $args = array(), $numKeys = 0) @@ -3904,10 +4261,13 @@ public function evaluate($script, $args = array(), $numKeys = 0) * Evaluate a LUA script serverside, from the SHA1 hash of the script instead of the script itself. * In order to run this command Redis will have to have already loaded the script, either by running it or via * the SCRIPT LOAD command. - * @param string $scriptSha - * @param array $args - * @param int $numKeys - * @return mixed @see eval() + * + * @param string $scriptSha + * @param array $args + * @param int $numKeys + * + * @return mixed @see eval() + * * @see eval() * @link https://redis.io/commands/evalsha * @example @@ -3935,8 +4295,9 @@ public function evaluateSha($scriptSha, $args = array(), $numKeys = 0) /** * Execute the Redis SCRIPT command to perform various operations on the scripting subsystem. - * @param string $command load | flush | kill | exists - * @param string $script + * @param string $command load | flush | kill | exists + * @param string $script + * * @return mixed * * @link https://redis.io/commands/script-load @@ -3962,7 +4323,8 @@ public function script($command, $script) /** * The last error message (if any) - * @return string A string with the last returned script based error message, or NULL if there is no error + * + * @return string|null A string with the last returned script based error message, or NULL if there is no error * * @example *
@@ -4032,8 +4394,12 @@ public function client($command, $value)
 
     /**
      * A utility method to prefix the value with the prefix setting for phpredis.
-     * @param   mixed   $value  The value you wish to prefix
-     * @return  string  If a prefix is set up, the value now prefixed.  If there is no prefix, the value will be returned unchanged.
+     *
+     * @param mixed $value The value you wish to prefix
+     *
+     * @return string If a prefix is set up, the value now prefixed.
+     * If there is no prefix, the value will be returned unchanged.
+     *
      * @example
      * 
      * $redis->setOption(Redis::OPT_PREFIX, 'my-prefix:');
@@ -4049,7 +4415,9 @@ public function _prefix($value)
      * value will be returned unchanged.  If there is a serializer set up, and the data passed in is malformed, an
      * exception will be thrown. This can be useful if phpredis is serializing values, and you return something from
      * redis in a LUA script that is serialized.
-     * @param   string  $value  The value to be unserialized
+     *
+     * @param string $value The value to be unserialized
+     *
      * @return mixed
      * @example
      * 
@@ -4066,7 +4434,9 @@ public function _unserialize($value)
      * serializer is configured, manually. This can be useful for serialization/unserialization of data going in
      * and out of EVAL commands as phpredis can't automatically do this itself.  Note that if no serializer is
      * set, phpredis will change Array values to 'Array', and Objects to 'Object'.
-     * @param   mixed   $value  The value to be serialized.
+     *
+     * @param mixed $value The value to be serialized.
+     *
      * @return  mixed
      * @example
      * 
@@ -4086,8 +4456,10 @@ public function _serialize($value)
     /**
      * Dump a key out of a redis database, the value of which can later be passed into redis using the RESTORE command.
      * The data that comes out of DUMP is a binary representation of the key as Redis stores it.
-     * @param   string  $key
-     * @return  string  The Redis encoded value of the key, or FALSE if the key doesn't exist
+     * @param string $key
+     *
+     * @return string|bool The Redis encoded value of the key, or FALSE if the key doesn't exist
+     *
      * @link    https://redis.io/commands/dump
      * @example
      * 
@@ -4102,10 +4474,12 @@ public function dump($key)
     /**
      * Restore a key from the result of a DUMP operation.
      *
-     * @param   string  $key    The key name
-     * @param   int     $ttl    How long the key should live (if zero, no expire will be set on the key)
-     * @param   string  $value  (binary).  The Redis encoded key value (from DUMP)
-     * @return  bool
+     * @param string $key   The key name
+     * @param int    $ttl   How long the key should live (if zero, no expire will be set on the key)
+     * @param string $value (binary).  The Redis encoded key value (from DUMP)
+     *
+     * @return bool
+     *
      * @link    https://redis.io/commands/restore
      * @example
      * 
@@ -4121,14 +4495,16 @@ public function restore($key, $ttl, $value)
     /**
      * Migrates a key to a different Redis instance.
      *
-     * @param   string  $host       The destination host
-     * @param   int     $port       The TCP port to connect to.
-     * @param   string  $key        The key to migrate.
-     * @param   int     $db         The target DB.
-     * @param   int     $timeout    The maximum amount of time given to this transfer.
-     * @param   bool    $copy       Should we send the COPY flag to redis.
-     * @param   bool    $replace    Should we send the REPLACE flag to redis.
-     * @return  bool
+     * @param string $host    The destination host
+     * @param int    $port    The TCP port to connect to.
+     * @param string $key     The key to migrate.
+     * @param int    $db      The target DB.
+     * @param int    $timeout The maximum amount of time given to this transfer.
+     * @param bool   $copy    Should we send the COPY flag to redis.
+     * @param bool   $replace Should we send the REPLACE flag to redis.
+     *
+     * @return bool
+     *
      * @link    https://redis.io/commands/migrate
      * @example
      * 
@@ -4141,8 +4517,10 @@ public function migrate($host, $port, $key, $db, $timeout, $copy = false, $repla
 
     /**
      * Return the current Redis server time.
-     * @return  array If successfull, the time will come back as an associative array with element zero being the
+     *
+     * @return array If successfull, the time will come back as an associative array with element zero being the
      * unix timestamp, and element one being microseconds.
+     *
      * @link    https://redis.io/commands/time
      * @example
      * 
@@ -4158,11 +4536,14 @@ public function time()
     }
 
     /**
-     * Scan the keyspace for keys.
-     * @param  int    $iterator Iterator, initialized to NULL.
-     * @param  string $pattern  Pattern to match.
-     * @param  int    $count    Count of keys per iteration (only a suggestion to Redis).
-     * @return array            This function will return an array of keys or FALSE if there are no more keys.
+     * Scan the keyspace for keys
+     *
+     * @param int    $iterator Iterator, initialized to NULL.
+     * @param string $pattern  Pattern to match.
+     * @param int    $count    Count of keys per iteration (only a suggestion to Redis).
+     *
+     * @return array|bool This function will return an array of keys or FALSE if there are no more keys.
+     *
      * @link   https://redis.io/commands/scan
      * @example
      * 
@@ -4180,9 +4561,12 @@ public function scan(&$iterator, $pattern = null, $count = 0)
 
     /**
      * Adds all the element arguments to the HyperLogLog data structure stored at the key.
-     * @param   string  $key
-     * @param   array   $elements
-     * @return  bool
+     *
+     * @param string $key
+     * @param array  $elements
+     *
+     * @return bool
+     *
      * @link    https://redis.io/commands/pfadd
      * @example $redis->pfAdd('key', array('elem1', 'elem2'))
      */
@@ -4193,8 +4577,11 @@ public function pfAdd($key, array $elements)
     /**
      * When called with a single key, returns the approximated cardinality computed by the HyperLogLog data
      * structure stored at the specified variable, which is 0 if the variable does not exist.
-     * @param   string|array    $key
-     * @return  int
+     *
+     * @param string|array $key
+     *
+     * @return int
+     * 
      * @link    https://redis.io/commands/pfcount
      * @example
      * 
@@ -4210,9 +4597,12 @@ public function pfCount($key)
     /**
      * Merge multiple HyperLogLog values into an unique value that will approximate the cardinality
      * of the union of the observed Sets of the source HyperLogLog structures.
-     * @param   string  $destkey
-     * @param   array   $sourcekeys
-     * @return  bool
+     *
+     * @param string $destKey
+     * @param array  $sourceKeys
+     *
+     * @return bool
+     *
      * @link    https://redis.io/commands/pfmerge
      * @example
      * 
@@ -4221,15 +4611,18 @@ public function pfCount($key)
      * $redis->pfMerge('key3', array('key1', 'key2'));
      * $redis->pfCount('key3'); // int(3)
      */
-    public function pfMerge($destkey, array $sourcekeys)
+    public function pfMerge($destKey, array $sourceKeys)
     {
     }
 
     /**
      * Send arbitrary things to the redis server.
-     * @param   string      $command    Required command to send to the server.
-     * @param   mixed,...   $arguments  Optional variable amount of arguments to send to the server.
-     * @return  mixed
+     *
+     * @param string $command   Required command to send to the server.
+     * @param mixed  $arguments Optional variable amount of arguments to send to the server.
+     *
+     * @return mixed
+     *
      * @example
      * 
      * $redis->rawCommand('SET', 'key', 'value'); // bool(true)
@@ -4242,7 +4635,9 @@ public function rawCommand($command, $arguments)
 
     /**
      * Detect whether we're in ATOMIC/MULTI/PIPELINE mode.
-     * @return  int     Either Redis::ATOMIC, Redis::MULTI or Redis::PIPELINE
+     *
+     * @return int Either Redis::ATOMIC, Redis::MULTI or Redis::PIPELINE
+     *
      * @example $redis->getMode();
      */
     public function getMode()
@@ -4251,59 +4646,69 @@ public function getMode()
 
     /**
      * Acknowledge one or more messages on behalf of a consumer group.
-     * @param   string  $stream
-     * @param   string  $group
-     * @param   array   $arr_messages
-     * @return  int     The number of messages Redis reports as acknowledged.
+     *
+     * @param string $stream
+     * @param string $group
+     * @param array  $messages
+     *
+     * @return int The number of messages Redis reports as acknowledged.
+     *
      * @link    https://redis.io/commands/xack
      * @example
      * 
-     * $obj_redis->xAck('stream', 'group1', ['1530063064286-0', '1530063064286-1']);
+     * $redis->xAck('stream', 'group1', ['1530063064286-0', '1530063064286-1']);
      * 
*/ - public function xAck($stream, $group, $arr_messages) + public function xAck($stream, $group, $messages) { } /** - * Add a message to a stream. - * @param string $str_key - * @param string $str_id - * @param array $arr_message - * @param int $i_maxlen - * @param bool $boo_approximate - * @return string The added message ID. + * Add a message to a stream + * + * @param string $key + * @param string $id + * @param array $messages + * @param int $maxLen + * @param bool $isApproximate + * + * @return string The added message ID. + * * @link https://redis.io/commands/xadd * @example *
-     * $obj_redis->xAdd('mystream', "*", ['field' => 'value']);
-     * $obj_redis->xAdd('mystream', "*", ['field' => 'value'], 10);
-     * $obj_redis->xAdd('mystream', "*", ['field' => 'value'], 10, true);
+     * $redis->xAdd('mystream', "*", ['field' => 'value']);
+     * $redis->xAdd('mystream', "*", ['field' => 'value'], 10);
+     * $redis->xAdd('mystream', "*", ['field' => 'value'], 10, true);
      * 
*/ - public function xAdd($str_key, $str_id, $arr_message, $i_maxlen = 0, $boo_approximate = false) + public function xAdd($key, $id, $messages, $maxLen = 0, $isApproximate = false) { } /** - * Claim ownership of one or more pending messages. - * @param string $str_key - * @param string $str_group - * @param string $str_consumer - * @param int $min_idle_time - * @param array $arr_ids - * @param array $arr_options ['IDLE' => $value, 'TIME' => $value, 'RETRYCOUNT' => $value, 'FORCE', 'JUSTID'] - * @return array Either an array of message IDs along with corresponding data, or just an array of IDs (if the 'JUSTID' option was passed). + * Claim ownership of one or more pending messages + * + * @param string $key + * @param string $group + * @param string $consumer + * @param int $minIdleTime + * @param array $ids + * @param array $options ['IDLE' => $value, 'TIME' => $value, 'RETRYCOUNT' => $value, 'FORCE', 'JUSTID'] + * + * @return array Either an array of message IDs along with corresponding data, or just an array of IDs + * (if the 'JUSTID' option was passed). + * * @link https://redis.io/commands/xclaim * @example *
      * $ids = ['1530113681011-0', '1530113681011-1', '1530113681011-2'];
      *
      * // Without any options
-     * $obj_redis->xClaim('mystream', 'group1', 'myconsumer1', 0, $ids);
+     * $redis->xClaim('mystream', 'group1', 'myconsumer1', 0, $ids);
      *
      * // With options
-     * $obj_redis->xClaim(
+     * $redis->xClaim(
      *     'mystream', 'group1', 'myconsumer2', 0, $ids,
      *     [
      *         'IDLE' => time() * 1000,
@@ -4314,200 +4719,236 @@ public function xAdd($str_key, $str_id, $arr_message, $i_maxlen = 0, $boo_approx
      * );
      * 
*/ - public function xClaim($str_key, $str_group, $str_consumer, $min_idle_time, $arr_ids, $arr_options = []) + public function xClaim($key, $group, $consumer, $minIdleTime, $ids, $options = []) { } /** - * Delete one or more messages from a stream. - * @param string $str_key - * @param array $arr_ids - * @return int The number of messages removed. + * Delete one or more messages from a stream + * + * @param string $key + * @param array $ids + * + * @return int The number of messages removed + * * @link https://redis.io/commands/xdel * @example *
-     * $obj_redis->xDel('mystream', ['1530115304877-0', '1530115305731-0']);
+     * $redis->xDel('mystream', ['1530115304877-0', '1530115305731-0']);
      * 
*/ - public function xDel($str_key, $arr_ids) + public function xDel($key, $ids) { } /** - * @param string $operation e.g.: 'HELP', 'SETID', 'DELGROUP', 'CREATE', 'DELCONSUMER' - * @param string $str_key - * @param string $str_group - * @param string $str_msg_id - * @param bool $boo_mkstream - * @return mixed This command returns different types depending on the specific XGROUP command executed. + * @param string $operation e.g.: 'HELP', 'SETID', 'DELGROUP', 'CREATE', 'DELCONSUMER' + * @param string $key + * @param string $group + * @param string $msgId + * @param bool $mkStream + * + * @return mixed This command returns different types depending on the specific XGROUP command executed. + * * @link https://redis.io/commands/xgroup * @example *
-     * $obj_redis->xGroup('CREATE', 'mystream', 'mygroup', 0);
-     * $obj_redis->xGroup('CREATE', 'mystream', 'mygroup', 0, true); // create stream
-     * $obj_redis->xGroup('DESTROY', 'mystream', 'mygroup');
+     * $redis->xGroup('CREATE', 'mystream', 'mygroup', 0);
+     * $redis->xGroup('CREATE', 'mystream', 'mygroup', 0, true); // create stream
+     * $redis->xGroup('DESTROY', 'mystream', 'mygroup');
      * 
*/ - public function xGroup($operation, $str_key, $str_group, $str_msg_id = '', $boo_mkstream = false) + public function xGroup($operation, $key, $group, $msgId = '', $mkStream = false) { } /** - * Get information about a stream or consumer groups. - * @param string $operation e.g.: 'CONSUMERS', 'GROUPS', 'STREAM', 'HELP' - * @param string $str_stream - * @param string $str_group - * @return mixed This command returns different types depending on which subcommand is used. + * Get information about a stream or consumer groups + * + * @param string $operation e.g.: 'CONSUMERS', 'GROUPS', 'STREAM', 'HELP' + * @param string $stream + * @param string $group + * + * @return mixed This command returns different types depending on which subcommand is used. + * * @link https://redis.io/commands/xinfo * @example *
-     * $obj_redis->xInfo('STREAM', 'mystream');
+     * $redis->xInfo('STREAM', 'mystream');
      * 
*/ - public function xInfo($operation, $str_stream, $str_group) + public function xInfo($operation, $stream, $group) { } /** * Get the length of a given stream. - * @param string $str_stream - * @return int The number of messages in the stream. + * + * @param string $stream + * + * @return int The number of messages in the stream. + * * @link https://redis.io/commands/xlen * @example *
-     * $obj_redis->xLen('mystream');
+     * $redis->xLen('mystream');
      * 
*/ - public function xLen($str_stream) + public function xLen($stream) { } /** - * Get information about pending messages in a given stream. - * @param string $str_stream - * @param string $str_group - * @param string $str_start - * @param string $str_end - * @param int $i_count - * @param string $str_consumer - * @return array Information about the pending messages, in various forms depending on the specific invocation of XPENDING. - * @link https://redis.io/commands/xpending + * Get information about pending messages in a given stream + * + * @param string $stream + * @param string $group + * @param string $start + * @param string $end + * @param int $count + * @param string $consumer + * + * @return array Information about the pending messages, in various forms depending on + * the specific invocation of XPENDING. + * + * @link https://redis.io/commands/xpending * @example *
-     * $obj_redis->xPending('mystream', 'mygroup');
-     * $obj_redis->xPending('mystream', 'mygroup', '-', '+', 1, 'consumer-1');
+     * $redis->xPending('mystream', 'mygroup');
+     * $redis->xPending('mystream', 'mygroup', '-', '+', 1, 'consumer-1');
      * 
*/ - public function xPending($str_stream, $str_group, $str_start = null, $str_end = null, $i_count = null, $str_consumer = null) + public function xPending($stream, $group, $start = null, $end = null, $count = null, $consumer = null) { } /** - * Get a range of messages from a given stream. - * @param string $str_stream - * @param string $str_start - * @param string $str_end - * @param int $i_count - * @return array The messages in the stream within the requested range. + * Get a range of messages from a given stream + * + * @param string $stream + * @param string $start + * @param string $end + * @param int $count + * + * @return array The messages in the stream within the requested range. + * * @link https://redis.io/commands/xrange * @example *
      * // Get everything in this stream
-     * $obj_redis->xRange('mystream', '-', '+');
+     * $redis->xRange('mystream', '-', '+');
      * // Only the first two messages
-     * $obj_redis->xRange('mystream', '-', '+', 2);
+     * $redis->xRange('mystream', '-', '+', 2);
      * 
*/ - public function xRange($str_stream, $str_start, $str_end, $i_count = null) + public function xRange($stream, $start, $end, $count = null) { } /** * Read data from one or more streams and only return IDs greater than sent in the command. - * @param array $arr_streams - * @param int|string $i_count - * @param int|string $i_block - * @return array The messages in the stream newer than the IDs passed to Redis (if any). + * + * @param array $streams + * @param int|string $count + * @param int|string $block + * + * @return array The messages in the stream newer than the IDs passed to Redis (if any) + * * @link https://redis.io/commands/xread * @example *
-     * $obj_redis->xRead(['stream1' => '1535222584555-0', 'stream2' => '1535222584555-0']);
+     * $redis->xRead(['stream1' => '1535222584555-0', 'stream2' => '1535222584555-0']);
      * 
*/ - public function xRead($arr_streams, $i_count = null, $i_block = null) + public function xRead($streams, $count = null, $block = null) { } /** * This method is similar to xRead except that it supports reading messages for a specific consumer group. - * @param string $str_group - * @param string $str_consumer - * @param array $arr_streams - * @param int|null $i_count - * @param int|null $i_block - * @return array The messages delivered to this consumer group (if any). + * + * @param string $group + * @param string $consumer + * @param array $streams + * @param int|null $count + * @param int|null $block + * + * @return array The messages delivered to this consumer group (if any). + * * @link https://redis.io/commands/xreadgroup * @example *
      * // Consume messages for 'mygroup', 'consumer1'
-     * $obj_redis->xReadGroup('mygroup', 'consumer1', ['s1' => 0, 's2' => 0]);
+     * $redis->xReadGroup('mygroup', 'consumer1', ['s1' => 0, 's2' => 0]);
      * // Read a single message as 'consumer2' for up to a second until a message arrives.
-     * $obj_redis->xReadGroup('mygroup', 'consumer2', ['s1' => 0, 's2' => 0], 1, 1000);
+     * $redis->xReadGroup('mygroup', 'consumer2', ['s1' => 0, 's2' => 0], 1, 1000);
      * 
*/ - public function xReadGroup($str_group, $str_consumer, $arr_streams, $i_count = null, $i_block = null) + public function xReadGroup($group, $consumer, $streams, $count = null, $block = null) { } /** - * This is identical to xRange except the results come back in reverse order. Also note that Redis reverses the order of "start" and "end". - * @param string $str_stream - * @param string $str_end - * @param string $str_start - * @param int $i_count - * @return array The messages in the range specified. + * This is identical to xRange except the results come back in reverse order. + * Also note that Redis reverses the order of "start" and "end". + * + * @param string $stream + * @param string $end + * @param string $start + * @param int $count + * + * @return array The messages in the range specified + * * @link https://redis.io/commands/xrevrange * @example *
-     * $obj_redis->xRevRange('mystream', '+', '-');
+     * $redis->xRevRange('mystream', '+', '-');
      * 
*/ - public function xRevRange($str_stream, $str_end, $str_start, $i_count = null) + public function xRevRange($stream, $end, $start, $count = null) { } /** - * Trim the stream length to a given maximum. If the "approximate" flag is pasesed, Redis will use your size as a hint but only trim trees in whole nodes (this is more efficient).. - * @param string $str_stream - * @param int $i_max_len - * @param bool $boo_approximate - * @return int The number of messages trimed from the stream. + * Trim the stream length to a given maximum. + * If the "approximate" flag is pasesed, Redis will use your size as a hint but only trim trees in whole nodes + * (this is more efficient) + * + * @param string $stream + * @param int $maxLen + * @param bool $isApproximate + * + * @return int The number of messages trimed from the stream. + * * @link https://redis.io/commands/xtrim * @example *
      * // Trim to exactly 100 messages
-     * $obj_redis->xTrim('mystream', 100);
+     * $redis->xTrim('mystream', 100);
      * // Let Redis approximate the trimming
-     * $obj_redis->xTrim('mystream', 100, true);
+     * $redis->xTrim('mystream', 100, true);
      * 
*/ - public function xTrim($str_stream, $i_max_len, $boo_approximate) + public function xTrim($stream, $maxLen, $isApproximate) { } - } class RedisException extends Exception { } +/** + * @mixin \Redis + */ class RedisArray { /** * Constructor * - * @param string|array $hosts Name of the redis array from redis.ini or array of hosts to construct the array with - * @param array $opts Array of options + * @param string|array $hosts Name of the redis array from redis.ini or array of hosts to construct the array with + * @param array $opts Array of options + * * @link https://github.com/nicolasff/phpredis/blob/master/arrays.markdown */ public function __construct($hosts, array $opts = null) @@ -4515,21 +4956,22 @@ public function __construct($hosts, array $opts = null) } /** - * @return array list of hosts for the selected array + * @return array list of hosts for the selected array */ public function _hosts() { } /** - * @return string the name of the function used to extract key parts during consistent hashing + * @return string the name of the function used to extract key parts during consistent hashing */ public function _function() { } /** - * @param string $key The key for which you want to lookup the host + * @param string $key The key for which you want to lookup the host + * * @return string the host to be used for a certain key */ public function _target($key) From aa0e0222b96f035d5589b4d973c255c2bad624d0 Mon Sep 17 00:00:00 2001 From: Shaverdova Elena Date: Mon, 5 Aug 2019 18:54:16 +0200 Subject: [PATCH 79/97] Add Redis.sAddArray method --- src/Redis.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/Redis.php b/src/Redis.php index b60dc8e..c04c9cc 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -4932,6 +4932,28 @@ public function xRevRange($stream, $end, $start, $count = null) public function xTrim($stream, $maxLen, $isApproximate) { } + + /** + * Adds a values to the set value stored at key. + * + * @param string $key Required key + * @param array $values Required values + * + * @return int|bool The number of elements added to the set. + * If this value is already in the set, FALSE is returned + * + * @link https://redis.io/commands/sadd + * @link https://github.com/phpredis/phpredis/commit/3491b188e0022f75b938738f7542603c7aae9077 + * @since phpredis 2.2.8 + * @example + *
+     * $redis->sAddArray('k', array('v1'));                // boolean
+     * $redis->sAddArray('k', array('v1', 'v2', 'v3'));    // boolean
+     * 
+ */ + public function sAddArray($key, array $values) + { + } } class RedisException extends Exception From 983b1ed57c5d6437da157f163a9052b7f4d88c7b Mon Sep 17 00:00:00 2001 From: Maksim Kamashev Date: Tue, 6 Aug 2019 00:10:27 +0300 Subject: [PATCH 80/97] Fix invalid tag --- src/Redis.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Redis.php b/src/Redis.php index c04c9cc..55a0e20 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -3518,7 +3518,7 @@ public function bzPopMax($key1, $key2, $timeout) * @return array Either an array with the key member and score of the higest or lowest element or an empty array * if the timeout was reached without an element to pop. * - * @see @bzPopMax + * @see bzPopMax * @since >= 5.0 * @link https://redis.io/commands/bzpopmin */ From 446678dadff5ea4493fb8b36f22471ffe6658a24 Mon Sep 17 00:00:00 2001 From: Shaverdova Elena Date: Tue, 6 Aug 2019 15:03:16 +0200 Subject: [PATCH 81/97] In Redis.client second parameter is optional, see $redis->client('list') --- src/Redis.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Redis.php b/src/Redis.php index c04c9cc..440dda5 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -4388,7 +4388,7 @@ public function clearLastError() * $redis->client('kill', ); // Kill the process at ip:port *
*/ - public function client($command, $value) + public function client($command, $value = '') { } From a6523cdd3f18aeabb30a42d1448ea9fdfeacb437 Mon Sep 17 00:00:00 2001 From: Shaverdova Elena Date: Tue, 6 Aug 2019 15:28:42 +0200 Subject: [PATCH 82/97] Since Redis.exists may return both bool and int, it's safer to provide both --- src/Redis.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Redis.php b/src/Redis.php index b60dc8e..2a8578c 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -777,7 +777,7 @@ public function punsubscribe($patterns = null) * * @param string|string[] $key * - * @return bool The number of keys tested that do exist + * @return int|bool The number of keys tested that do exist * * @link https://redis.io/commands/exists * @link https://github.com/phpredis/phpredis#exists From 4db233605ae2f95d9b350c500525e10af77c2fc9 Mon Sep 17 00:00:00 2001 From: Shaverdova Elena Date: Tue, 6 Aug 2019 15:32:02 +0200 Subject: [PATCH 83/97] Redis.hDel may return false if the hash table doesn't exist, or the key doesn't exist --- src/Redis.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Redis.php b/src/Redis.php index b60dc8e..a14f9ff 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -3617,7 +3617,7 @@ public function hLen($key) * @param string $hashKey1 * @param string ...$otherHashKeys * - * @return int Number of deleted fields + * @return int|false Number of deleted fields * * @link https://redis.io/commands/hdel * @example From 4f8ff0f15e592cdfe3724fb5f412f273fad913c1 Mon Sep 17 00:00:00 2001 From: Shaverdova Elena Date: Tue, 6 Aug 2019 15:35:48 +0200 Subject: [PATCH 84/97] Redis.hLen may return false if the key doesn't exist or isn't a hash --- src/Redis.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Redis.php b/src/Redis.php index b60dc8e..15beb43 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -3594,7 +3594,7 @@ public function hGet($key, $hashKey) * * @param string $key * - * @return int the number of items in a hash, FALSE if the key doesn't exist or isn't a hash + * @return int|false the number of items in a hash, FALSE if the key doesn't exist or isn't a hash * * @link https://redis.io/commands/hlen * @example From d548931de416c8e4d5cc8c69a0d5f87324a4d765 Mon Sep 17 00:00:00 2001 From: Shaverdova Elena Date: Tue, 6 Aug 2019 16:34:09 +0200 Subject: [PATCH 85/97] Redis.sscan has string $pattern parameter --- src/Redis.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Redis.php b/src/Redis.php index b60dc8e..ea36f97 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -1855,7 +1855,7 @@ public function sGetMembers($key) * * @param string $key The set to search. * @param int $iterator LONG (reference) to the iterator as we go. - * @param null $pattern String, optional pattern to match against. + * @param string $pattern String, optional pattern to match against. * @param int $count How many members to return at a time (Redis might return a different amount) * * @return array|bool PHPRedis will return an array of keys or FALSE when we're done iterating From b6cc293e9f5235d14c879e3d7e1459aa24c90c2e Mon Sep 17 00:00:00 2001 From: Shaverdova Elena Date: Tue, 6 Aug 2019 16:46:36 +0200 Subject: [PATCH 86/97] Provide parameter types for Redis.zUnion --- src/Redis.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Redis.php b/src/Redis.php index b60dc8e..4561e23 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -3388,10 +3388,10 @@ public function zUnionStore($output, $zSetKeys, array $weights = null, $aggregat * @see zUnionStore * @deprecated use Redis::zUnionStore() * - * @param $Output - * @param $ZSetKeys + * @param string $Output + * @param array $ZSetKeys * @param array|null $Weights - * @param string $aggregateFunction + * @param string $aggregateFunction */ public function zUnion($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM') { From 6e9f6d8ce029cd8bf6e19b2e81da87d785d731b9 Mon Sep 17 00:00:00 2001 From: Natsimhan <5631475+natsimhan@users.noreply.github.com> Date: Wed, 7 Aug 2019 06:56:41 +0200 Subject: [PATCH 87/97] Fixed in the example the use of SCAN function The example of using SCAN did not work properly if $pattern was used. If we do not test the return is FALSE (end of scan) and we used $pattern (Redis MATCH option) the scan function can return empty lists because of the way it works, but we still have to keep going through the list until the function returns FALSE. More information on this feature of Redis in the doc with the MATCH option: https://redis.io/commands/scan#the-match-option --- src/Redis.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Redis.php b/src/Redis.php index 4226975..8e5a778 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -4548,7 +4548,7 @@ public function time() * @example *
      * $iterator = null;
-     * while($keys = $redis->scan($iterator)) {
+     * while(false !== ($keys = $redis->scan($iterator))) {
      *     foreach($keys as $key) {
      *         echo $key . PHP_EOL;
      *     }

From ad0be299ff9c014a49fb702d77d97e693e147c35 Mon Sep 17 00:00:00 2001
From: Shaverdova Elena 
Date: Thu, 8 Aug 2019 16:09:52 +0200
Subject: [PATCH 88/97] Redis.multi returns Redis

---
 src/Redis.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Redis.php b/src/Redis.php
index 4561e23..dbb380f 100644
--- a/src/Redis.php
+++ b/src/Redis.php
@@ -571,7 +571,7 @@ public function unlink($key1, $key2 = null, $key3 = null)
      * a Redis::PIPELINE block is simply transmitted faster to the server, but without any guarantee of atomicity.
      * discard cancels a transaction.
      *
-     * @return resource Redis returns the Redis instance and enters multi-mode.
+     * @return Redis returns the Redis instance and enters multi-mode.
      * Once in multi-mode, all subsequent method calls return the same object until exec() is called.
      *
      * @link    https://redis.io/commands/multi

From 5c1b39e0ef98f0f6b059404cc3c8bbc42a93816a Mon Sep 17 00:00:00 2001
From: Maksim Kamashev 
Date: Sat, 10 Aug 2019 00:21:12 +0300
Subject: [PATCH 89/97] Change false to bool

---
 src/Redis.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Redis.php b/src/Redis.php
index bfb384d..55eab0a 100644
--- a/src/Redis.php
+++ b/src/Redis.php
@@ -3594,7 +3594,7 @@ public function hGet($key, $hashKey)
      *
      * @param string $key
      *
-     * @return int|false the number of items in a hash, FALSE if the key doesn't exist or isn't a hash
+     * @return int|bool the number of items in a hash, FALSE if the key doesn't exist or isn't a hash
      *
      * @link    https://redis.io/commands/hlen
      * @example
@@ -3617,7 +3617,7 @@ public function hLen($key)
      * @param string $hashKey1
      * @param string ...$otherHashKeys
      *
-     * @return int|false Number of deleted fields
+     * @return int|bool Number of deleted fields
      *
      * @link    https://redis.io/commands/hdel
      * @example

From 6f8a208474f13edca19188d57dc249714b400e2b Mon Sep 17 00:00:00 2001
From: Jeff Standen 
Date: Fri, 13 Sep 2019 13:23:35 -0700
Subject: [PATCH 90/97] Fixed a typo in the Redis.sRandMember var_dump() output

---
 src/Redis.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Redis.php b/src/Redis.php
index 55eab0a..e68e820 100644
--- a/src/Redis.php
+++ b/src/Redis.php
@@ -1569,7 +1569,7 @@ public function sPop($key)
      *
      * // array(2) {
      * //   [0]=> string(2) "one"
-     * //   [1]=> string(2) "three"
+     * //   [1]=> string(5) "three"
      * // }
      * 
*/ From 9768f40a5a06f9b9125ffd1fd5f341d7dfcedb9b Mon Sep 17 00:00:00 2001 From: Jeff Standen Date: Fri, 13 Sep 2019 13:19:30 -0700 Subject: [PATCH 91/97] Redis.sPop may include an optional $count parameter --- src/Redis.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Redis.php b/src/Redis.php index 55eab0a..38a25a6 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -1527,8 +1527,9 @@ public function sCard($key) * Removes and returns a random element from the set value at Key. * * @param string $key + * @param int $count [optional] * - * @return string|mixed|bool "popped" value + * @return string|mixed|array|bool "popped" values * bool FALSE if set identified by key is empty or doesn't exist. * * @link https://redis.io/commands/spop @@ -1539,9 +1540,19 @@ public function sCard($key) * $redis->sAdd('key1' , 'set3'); // 'key1' => {'set3', 'set1', 'set2'} * $redis->sPop('key1'); // 'set1', 'key1' => {'set3', 'set2'} * $redis->sPop('key1'); // 'set3', 'key1' => {'set2'} + * + * // With count + * $redis->sAdd('key2', 'set1', 'set2', 'set3'); + * var_dump( $redis->sPop('key2', 3) ); // Will return all members but in no particular order + * + * // array(3) { + * // [0]=> string(4) "set2" + * // [1]=> string(4) "set3" + * // [2]=> string(4) "set1" + * // } *
*/ - public function sPop($key) + public function sPop($key, $count = 1) { } From 2779cfc9a1037b2a46b014e3fb0dbd040b951885 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Mon, 14 Oct 2019 22:42:49 +0200 Subject: [PATCH 92/97] Update Docs --- src/Redis.php | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/src/Redis.php b/src/Redis.php index 8b7b3e2..3b3f72d 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -3537,6 +3537,52 @@ public function bzPopMin($key1, $key2, $timeout) { } + /** + * Can pop the highest scoring members from one ZSET. + * + * @param string $key + * @param int $count + * + * @return array Either an array with the key member and score of the highest element or an empty array + * if there is no element to pop. + * + * @since >= 5.0 + * @link https://redis.io/commands/zpopmax + * @example + *
+     * // Pop the *lowest* scoring member from set `zs1`.
+     * $redis->zPopMax('zs1');
+     * // Pop the *lowest* 3 scoring member from set `zs1`.
+     * $redis->zPopMax('zs1', 3);
+     * 
+ */ + public function zPopMax($key, $count = 1) + { + } + + /** + * Can pop the lowest scoring members from one ZSET. + * + * @param string $key + * @param int $count + * + * @return array Either an array with the key member and score of the lowest element or an empty array + * if there is no element to pop. + * + * @since >= 5.0 + * @link https://redis.io/commands/zpopmin + * @example + *
+     * // Pop the *lowest* scoring member from set `zs1`.
+     * $redis->zPopMin('zs1');
+     * // Pop the *lowest* 3 scoring member from set `zs1`.
+     * $redis->zPopMin('zs1', 3);
+     * 
+ */ + public function zPopMin($key, $count = 1) + { + } + /** * Adds a value to the hash stored at key. If this value is already in the hash, FALSE is returned. * From 06407d351046c2bbf2268310d2ed746b5beca2aa Mon Sep 17 00:00:00 2001 From: Aleksandr Fedotov Date: Sun, 24 May 2020 23:19:01 +0300 Subject: [PATCH 93/97] Add new constants --- src/Redis.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/Redis.php b/src/Redis.php index 3b3f72d..a46dab4 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -19,6 +19,10 @@ class Redis const OPT_READ_TIMEOUT = 3; const OPT_SCAN = 4; const OPT_SLAVE_FAILOVER = 5; + const OPT_TCP_KEEPALIVE = 6; + const OPT_COMPRESSION = 7; + const OPT_REPLY_LITERAL = 8; + const OPT_COMPRESSION_LEVEL = 9; /** * Cluster options @@ -42,6 +46,20 @@ class Redis const SERIALIZER_MSGPACK = 3; const SERIALIZER_JSON = 4; + /** + * Compressions + */ + const COMPRESSION_NONE = 0; + const COMPRESSION_LZF = 1; + const COMPRESSION_ZSTD = 2; + + /** + * Compression ZSTD levels + */ + const COMPRESSION_ZSTD_MIN = 1; + const COMPRESSION_ZSTD_DEFAULT = 3; + const COMPRESSION_ZSTD_MAX = 22; + /** * Multi */ @@ -58,6 +76,7 @@ class Redis const REDIS_LIST = 3; const REDIS_ZSET = 4; const REDIS_HASH = 5; + const REDIS_STREAM = 6; /** * Creates a Redis client From 73979d40731b9927f7b7ccf55eeb33cfc6ffadf0 Mon Sep 17 00:00:00 2001 From: Maximilian Schirmer Date: Tue, 13 Oct 2020 13:57:10 +0200 Subject: [PATCH 94/97] Add COMPRESSION_LZ4 constant Available as of 5.3.0 (https://github.com/phpredis/phpredis/releases/tag/5.3.0) --- src/Redis.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Redis.php b/src/Redis.php index a46dab4..7fd34c7 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -52,6 +52,7 @@ class Redis const COMPRESSION_NONE = 0; const COMPRESSION_LZF = 1; const COMPRESSION_ZSTD = 2; + const COMPRESSION_LZ4 = 3; /** * Compression ZSTD levels From 08a92fa98fc61378c0cf026fb0bd63c8412c6c24 Mon Sep 17 00:00:00 2001 From: Serhii Zarva Date: Fri, 22 Jan 2021 10:36:52 +0100 Subject: [PATCH 95/97] Add SCAN_PREFIX and SCAN_NOPREFIX Since version 5.3.0RC1 the new parameters are supported. https://github.com/phpredis/phpredis/commit/e80600e244b8442cb7c86e99b067966cd59bf2ee --- src/Redis.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Redis.php b/src/Redis.php index 7fd34c7..1405338 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -36,6 +36,8 @@ class Redis */ const SCAN_NORETRY = 0; const SCAN_RETRY = 1; + const SCAN_PREFIX = 2; + const SCAN_NOPREFIX = 3; /** * Serializers From 35ac1e31db3967bdf65fd88abac717772d13f361 Mon Sep 17 00:00:00 2001 From: Adrien Cantepie Date: Sat, 20 Feb 2021 15:56:25 +0100 Subject: [PATCH 96/97] Update auth phpDoc --- src/Redis.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Redis.php b/src/Redis.php index 1405338..dd0016d 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -2188,15 +2188,19 @@ public function dbSize() } /** - * Authenticate the connection using a password. + * Authenticate the connection using a password or a username and password.. * Warning: The password is sent in plain-text over the network. * - * @param string $password + * @param mixed $password * * @return bool TRUE if the connection is authenticated, FALSE otherwise * * @link https://redis.io/commands/auth - * @example $redis->auth('foobared'); + * @example + *
+     * $redis->auth('bar'); // Authenticate with the password 'bar'
+     * $redis->auth(['user' => 'foo', 'pass' => 'bar]); // Authenticate with the username 'foo', and password 'bar' 
+     * 
*/ public function auth($password) { From cdf07b55dca57a5f149a26aa0a51cc2f80a01b27 Mon Sep 17 00:00:00 2001 From: gongwen Date: Fri, 7 May 2021 22:12:18 +0800 Subject: [PATCH 97/97] Fixed in the example the use of Redis.zAdd --- src/Redis.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Redis.php b/src/Redis.php index dd0016d..145d673 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -2951,7 +2951,7 @@ public function brpoplpush($srcKey, $dstKey, $timeout) * @example *
      * 
-     * $redis->zAdd('z', 1, 'v1', 2, 'v2', 3, 'v3', 4, 'v4' );  // int(2)
+     * $redis->zAdd('z', 1, 'v1', 2, 'v2', 3, 'v3', 4, 'v4' );  // int(4)
      * $redis->zRem('z', 'v2', 'v3');                           // int(2)
      * $redis->zAdd('z', ['NX'], 5, 'v5');                      // int(1)
      * $redis->zAdd('z', ['NX'], 6, 'v5');                      // int(0)