Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b9de0b9

Browse files
Documentation: Add docblocks for PF* commands and ping.
1 parent af13f95 commit b9de0b9

6 files changed

Lines changed: 81 additions & 18 deletions

redis.stub.php

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ public function persist(string $key): bool;
700700
public function pexpire(string $key, int $timeout, ?string $mode = NULL): bool;
701701

702702
/**
703-
* Set a key's expiration to a specific Unix timestamp in milliseconds. If connected to
703+
* Set a key's expiration to a specific Unix Timestamp in milliseconds. If connected to
704704
* Redis >= 7.0.0 you can pass an optional 'mode' argument.
705705
*
706706
* @see Redis::expire() For a description of the mode argument.
@@ -713,14 +713,54 @@ public function pexpire(string $key, int $timeout, ?string $mode = NULL): bool;
713713
*/
714714
public function pexpireAt(string $key, int $timestamp, ?string $mode = NULL): Redis|bool;
715715

716-
public function pfadd(string $key, array $elements): int;
716+
/**
717+
* Add one or more elements to a Redis HyperLogLog key
718+
*
719+
* @see https://redis.io/commands/pfadd
720+
*
721+
* @param string $key The key in question.
722+
*
723+
* @param array $elements One or more elements to add.
724+
*
725+
* @return Redis|int Returns 1 if the set was altered, and zero if not.
726+
*/
727+
public function pfadd(string $key, array $elements): Redis|int;
717728

718-
public function pfcount(string $key): int;
729+
/**
730+
* Retrieve the cardinality of a Redis HyperLogLog key.
731+
*
732+
* @see https://redis.io/commands/pfcount
733+
*
734+
* @param string $key The key name we wish to query.
735+
*
736+
* @return Redis|int The estimated cardinality of the set.
737+
*/
738+
public function pfcount(string $key): Redis|int;
719739

720-
public function pfmerge(string $dst, array $keys): bool;
740+
/**
741+
* Merge one or more source HyperLogLog sets into a destination set.
742+
*
743+
* @see https://redis.io/commands/pfmerge
744+
*
745+
* @param string $dst The destination key.
746+
* @param array $srckeys One or more source keys.
747+
*
748+
* @return Redis|bool Always returns true.
749+
*/
750+
public function pfmerge(string $dst, array $srckeys): Redis|bool;
721751

722-
/** @return string|Redis */
723-
public function ping(string $key = NULL);
752+
/**
753+
* PING the redis server with an optional string argument.
754+
*
755+
* @see https://redis.io/commands/ping
756+
*
757+
* @param string $message An optional string message that Redis will reply with, if passed.
758+
*
759+
* @return Redis|string|false If passed no message, this command will simply return `true`.
760+
* If a message is passed, it will return the message.
761+
*
762+
*/
763+
public function ping(string $message = NULL): Redis|string|bool;
724764

725765
public function pipeline(): bool|Redis;
726766

redis_arginfo.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 823ee9deddd36d3783eb469ce504984b11ac9a50 */
2+
* Stub hash: 891f2eb4099e73c6d7d47f8d673bfa8800db6994 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis___construct, 0, 0, 0)
55
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "null")
@@ -595,22 +595,22 @@ ZEND_END_ARG_INFO()
595595

596596
#define arginfo_class_Redis_pexpireAt arginfo_class_Redis_expireAt
597597

598-
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Redis_pfadd, 0, 2, IS_LONG, 0)
598+
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_Redis_pfadd, 0, 2, Redis, MAY_BE_LONG)
599599
ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
600600
ZEND_ARG_TYPE_INFO(0, elements, IS_ARRAY, 0)
601601
ZEND_END_ARG_INFO()
602602

603-
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Redis_pfcount, 0, 1, IS_LONG, 0)
603+
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_Redis_pfcount, 0, 1, Redis, MAY_BE_LONG)
604604
ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
605605
ZEND_END_ARG_INFO()
606606

607-
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Redis_pfmerge, 0, 2, _IS_BOOL, 0)
607+
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_Redis_pfmerge, 0, 2, Redis, MAY_BE_BOOL)
608608
ZEND_ARG_TYPE_INFO(0, dst, IS_STRING, 0)
609-
ZEND_ARG_TYPE_INFO(0, keys, IS_ARRAY, 0)
609+
ZEND_ARG_TYPE_INFO(0, srckeys, IS_ARRAY, 0)
610610
ZEND_END_ARG_INFO()
611611

612-
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_ping, 0, 0, 0)
613-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, key, IS_STRING, 0, "NULL")
612+
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_Redis_ping, 0, 0, Redis, MAY_BE_STRING|MAY_BE_BOOL)
613+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, message, IS_STRING, 0, "NULL")
614614
ZEND_END_ARG_INFO()
615615

616616
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_Redis_pipeline, 0, 0, Redis, MAY_BE_BOOL)

redis_cluster.stub.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,12 +292,35 @@ public function pexpire(string $key, int $timeout, ?string $mode = NULL): RedisC
292292

293293
public function pexpireat(string $key, int $timestamp, ?string $mode = NULL): RedisCluster|bool;
294294

295+
296+
/**
297+
* @see Redis::pfadd()
298+
*/
295299
public function pfadd(string $key, array $elements): RedisCluster|bool;
296300

301+
/**
302+
* @see Redis::pfcount()
303+
*/
297304
public function pfcount(string $key): RedisCluster|int|false;
298305

306+
/**
307+
* @see Redis::pfmerge()
308+
*/
299309
public function pfmerge(string $key, array $keys): RedisCluster|bool;
300310

311+
/**
312+
* PING an instance in the redis cluster.
313+
*
314+
* @see Redis::ping()
315+
*
316+
* @param string|array $key_or_address Either a key name or a two element array with host and
317+
* address, informing RedisCluster which node to ping.
318+
*
319+
* @param string $message An optional message to send.
320+
*
321+
* @return mixed This method always returns `true` if no message was sent, and the message itself
322+
* if one was.
323+
*/
301324
public function ping(string|array $key_or_address, ?string $message = NULL): mixed;
302325

303326
public function psetex(string $key, int $timeout, string $value): RedisCluster|bool;

redis_cluster_arginfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 5bf2e824a39d4139e1d7b21be429995826802994 */
2+
* Stub hash: 2b379c65c90f7e5e8958bab1b13b3f607fa33c37 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster___construct, 0, 0, 1)
55
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 1)

redis_cluster_legacy_arginfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 5bf2e824a39d4139e1d7b21be429995826802994 */
2+
* Stub hash: 2b379c65c90f7e5e8958bab1b13b3f607fa33c37 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster___construct, 0, 0, 1)
55
ZEND_ARG_INFO(0, name)

redis_legacy_arginfo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 823ee9deddd36d3783eb469ce504984b11ac9a50 */
2+
* Stub hash: 891f2eb4099e73c6d7d47f8d673bfa8800db6994 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis___construct, 0, 0, 0)
55
ZEND_ARG_INFO(0, options)
@@ -510,11 +510,11 @@ ZEND_END_ARG_INFO()
510510

511511
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_pfmerge, 0, 0, 2)
512512
ZEND_ARG_INFO(0, dst)
513-
ZEND_ARG_INFO(0, keys)
513+
ZEND_ARG_INFO(0, srckeys)
514514
ZEND_END_ARG_INFO()
515515

516516
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_ping, 0, 0, 0)
517-
ZEND_ARG_INFO(0, key)
517+
ZEND_ARG_INFO(0, message)
518518
ZEND_END_ARG_INFO()
519519

520520
#define arginfo_class_Redis_pipeline arginfo_class_Redis___destruct

0 commit comments

Comments
 (0)