diff options
author | michael-grunder <michael.grunder@gmail.com> | 2022-10-27 19:26:59 +0300 |
---|---|---|
committer | Michael Grunder <michael.grunder@gmail.com> | 2022-10-27 19:37:09 +0300 |
commit | b9de0b9724090f6ebb81b7f6d1ec1697500a5ec8 (patch) | |
tree | dc28f2f20380db11ae0c02b01ba01ddc142bd259 | |
parent | af13f951aacda7e8fc0597827812ad4eb194e318 (diff) |
Documentation: Add docblocks for PF* commands and ping.
-rw-r--r-- | redis.stub.php | 52 | ||||
-rw-r--r-- | redis_arginfo.h | 14 | ||||
-rw-r--r-- | redis_cluster.stub.php | 23 | ||||
-rw-r--r-- | redis_cluster_arginfo.h | 2 | ||||
-rw-r--r-- | redis_cluster_legacy_arginfo.h | 2 | ||||
-rw-r--r-- | redis_legacy_arginfo.h | 6 |
6 files changed, 81 insertions, 18 deletions
diff --git a/redis.stub.php b/redis.stub.php index 5cad4c3a..5d7bcc32 100644 --- a/redis.stub.php +++ b/redis.stub.php @@ -700,7 +700,7 @@ class Redis { public function pexpire(string $key, int $timeout, ?string $mode = NULL): bool; /** - * Set a key's expiration to a specific Unix timestamp in milliseconds. If connected to + * Set a key's expiration to a specific Unix Timestamp in milliseconds. If connected to * Redis >= 7.0.0 you can pass an optional 'mode' argument. * * @see Redis::expire() For a description of the mode argument. @@ -713,14 +713,54 @@ class Redis { */ public function pexpireAt(string $key, int $timestamp, ?string $mode = NULL): Redis|bool; - public function pfadd(string $key, array $elements): int; + /** + * Add one or more elements to a Redis HyperLogLog key + * + * @see https://redis.io/commands/pfadd + * + * @param string $key The key in question. + * + * @param array $elements One or more elements to add. + * + * @return Redis|int Returns 1 if the set was altered, and zero if not. + */ + public function pfadd(string $key, array $elements): Redis|int; - public function pfcount(string $key): int; + /** + * Retrieve the cardinality of a Redis HyperLogLog key. + * + * @see https://redis.io/commands/pfcount + * + * @param string $key The key name we wish to query. + * + * @return Redis|int The estimated cardinality of the set. + */ + public function pfcount(string $key): Redis|int; - public function pfmerge(string $dst, array $keys): bool; + /** + * Merge one or more source HyperLogLog sets into a destination set. + * + * @see https://redis.io/commands/pfmerge + * + * @param string $dst The destination key. + * @param array $srckeys One or more source keys. + * + * @return Redis|bool Always returns true. + */ + public function pfmerge(string $dst, array $srckeys): Redis|bool; - /** @return string|Redis */ - public function ping(string $key = NULL); + /** + * PING the redis server with an optional string argument. + * + * @see https://redis.io/commands/ping + * + * @param string $message An optional string message that Redis will reply with, if passed. + * + * @return Redis|string|false If passed no message, this command will simply return `true`. + * If a message is passed, it will return the message. + * + */ + public function ping(string $message = NULL): Redis|string|bool; public function pipeline(): bool|Redis; diff --git a/redis_arginfo.h b/redis_arginfo.h index 0d2ed4ae..30605343 100644 --- a/redis_arginfo.h +++ b/redis_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 823ee9deddd36d3783eb469ce504984b11ac9a50 */ + * Stub hash: 891f2eb4099e73c6d7d47f8d673bfa8800db6994 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis___construct, 0, 0, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "null") @@ -595,22 +595,22 @@ ZEND_END_ARG_INFO() #define arginfo_class_Redis_pexpireAt arginfo_class_Redis_expireAt -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Redis_pfadd, 0, 2, IS_LONG, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_Redis_pfadd, 0, 2, Redis, MAY_BE_LONG) ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, elements, IS_ARRAY, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Redis_pfcount, 0, 1, IS_LONG, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_Redis_pfcount, 0, 1, Redis, MAY_BE_LONG) ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Redis_pfmerge, 0, 2, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_Redis_pfmerge, 0, 2, Redis, MAY_BE_BOOL) ZEND_ARG_TYPE_INFO(0, dst, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, keys, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, srckeys, IS_ARRAY, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_ping, 0, 0, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, key, IS_STRING, 0, "NULL") +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_Redis_ping, 0, 0, Redis, MAY_BE_STRING|MAY_BE_BOOL) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, message, IS_STRING, 0, "NULL") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_Redis_pipeline, 0, 0, Redis, MAY_BE_BOOL) diff --git a/redis_cluster.stub.php b/redis_cluster.stub.php index eaf0eac8..8a705a16 100644 --- a/redis_cluster.stub.php +++ b/redis_cluster.stub.php @@ -292,12 +292,35 @@ class RedisCluster { public function pexpireat(string $key, int $timestamp, ?string $mode = NULL): RedisCluster|bool; + + /** + * @see Redis::pfadd() + */ public function pfadd(string $key, array $elements): RedisCluster|bool; + /** + * @see Redis::pfcount() + */ public function pfcount(string $key): RedisCluster|int|false; + /** + * @see Redis::pfmerge() + */ public function pfmerge(string $key, array $keys): RedisCluster|bool; + /** + * PING an instance in the redis cluster. + * + * @see Redis::ping() + * + * @param string|array $key_or_address Either a key name or a two element array with host and + * address, informing RedisCluster which node to ping. + * + * @param string $message An optional message to send. + * + * @return mixed This method always returns `true` if no message was sent, and the message itself + * if one was. + */ public function ping(string|array $key_or_address, ?string $message = NULL): mixed; public function psetex(string $key, int $timeout, string $value): RedisCluster|bool; diff --git a/redis_cluster_arginfo.h b/redis_cluster_arginfo.h index 3f782955..7a0f7164 100644 --- a/redis_cluster_arginfo.h +++ b/redis_cluster_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 5bf2e824a39d4139e1d7b21be429995826802994 */ + * Stub hash: 2b379c65c90f7e5e8958bab1b13b3f607fa33c37 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster___construct, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 1) diff --git a/redis_cluster_legacy_arginfo.h b/redis_cluster_legacy_arginfo.h index a4d8c052..f8318b61 100644 --- a/redis_cluster_legacy_arginfo.h +++ b/redis_cluster_legacy_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 5bf2e824a39d4139e1d7b21be429995826802994 */ + * Stub hash: 2b379c65c90f7e5e8958bab1b13b3f607fa33c37 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster___construct, 0, 0, 1) ZEND_ARG_INFO(0, name) diff --git a/redis_legacy_arginfo.h b/redis_legacy_arginfo.h index d11645af..89539d1d 100644 --- a/redis_legacy_arginfo.h +++ b/redis_legacy_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 823ee9deddd36d3783eb469ce504984b11ac9a50 */ + * Stub hash: 891f2eb4099e73c6d7d47f8d673bfa8800db6994 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis___construct, 0, 0, 0) ZEND_ARG_INFO(0, options) @@ -510,11 +510,11 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_pfmerge, 0, 0, 2) ZEND_ARG_INFO(0, dst) - ZEND_ARG_INFO(0, keys) + ZEND_ARG_INFO(0, srckeys) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_ping, 0, 0, 0) - ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, message) ZEND_END_ARG_INFO() #define arginfo_class_Redis_pipeline arginfo_class_Redis___destruct |