From 375d093d9482dfd794b5f6fb230b689f0540bbc9 Mon Sep 17 00:00:00 2001 From: michael-grunder Date: Wed, 26 Oct 2022 15:07:42 -0700 Subject: Documentation: BITPOS and BITCOUNT --- redis.stub.php | 42 ++++++++++++++++++++++++++++++------------ redis_arginfo.h | 2 +- redis_legacy_arginfo.h | 2 +- 3 files changed, 32 insertions(+), 14 deletions(-) diff --git a/redis.stub.php b/redis.stub.php index 590ef953..37f3bc8d 100644 --- a/redis.stub.php +++ b/redis.stub.php @@ -158,23 +158,41 @@ class Redis { public function bgrewriteaof(): Redis|bool; - + /** + * Count the number of set bits in a Redis string. + * + * @see https://https://redis.io/commands/bitcount/ + * + * @param string $key The key in question (must be a string key) + * @param int $start The index where Redis should start counting. If ommitted it + * defaults to zero, which means the start of the string. + * @param int $end The index where Redis should stop counting. If ommitted it + * defaults to -1, meaning the very end of the string. + * + * @param bool $bybit Whether or not Redis should treat $start and $end as bit + * positions, rather than bytes. + * + * @return Redis|int|false The number of bits set in the requested range. + * + */ public function bitcount(string $key, int $start = 0, int $end = -1, bool $bybit = false): Redis|int|false; public function bitop(string $operation, string $deskey, string $srckey, string ...$other_keys): Redis|int|false; /** - Return the position of the first bit set to 0 or 1 in a string. - - @see https://https://redis.io/commands/bitpos/ - - @param string $key The key to check (must be a string) - @param bool $bit Whether to look for an unset (0) or set (1) bit. - @param int $start Where in the string to start looking. - @param int $end Where in the string to stop looking. - @param bool $bybit If true, Redis will treat $start and $end as BIT values and not bytes, so if start - was 0 and end was 2, Redis would only search the first two bits. - */ + * Return the position of the first bit set to 0 or 1 in a string. + * + * @see https://https://redis.io/commands/bitpos/ + * + * @param string $key The key to check (must be a string) + * @param bool $bit Whether to look for an unset (0) or set (1) bit. + * @param int $start Where in the string to start looking. + * @param int $end Where in the string to stop looking. + * @param bool $bybit If true, Redis will treat $start and $end as BIT values and not bytes, so if start + * was 0 and end was 2, Redis would only search the first two bits. + * + * @return Redis|int|false The position of the first set or unset bit. + **/ public function bitpos(string $key, bool $bit, int $start = 0, int $end = -1, bool $bybit = false): Redis|int|false; public function blPop(string|array $key, string|float|int $timeout_or_key, mixed ...$extra_args): Redis|array|null|false; diff --git a/redis_arginfo.h b/redis_arginfo.h index 6fd5fef1..4e98b1f5 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: 4e21096b9ab449cbf12dd9c8a85a875786a9836a */ + * Stub hash: 21ca57fa960dd8afd88a830b1628e229e831476d */ 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") diff --git a/redis_legacy_arginfo.h b/redis_legacy_arginfo.h index 718c18da..adda8981 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: 4e21096b9ab449cbf12dd9c8a85a875786a9836a */ + * Stub hash: 21ca57fa960dd8afd88a830b1628e229e831476d */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis___construct, 0, 0, 0) ZEND_ARG_INFO(0, options) -- cgit v1.2.3