@@ -158,23 +158,41 @@ public function bgSave(): Redis|bool;
158158
159159 public function bgrewriteaof (): Redis |bool ;
160160
161-
161+ /**
162+ * Count the number of set bits in a Redis string.
163+ *
164+ * @see https://https://redis.io/commands/bitcount/
165+ *
166+ * @param string $key The key in question (must be a string key)
167+ * @param int $start The index where Redis should start counting. If ommitted it
168+ * defaults to zero, which means the start of the string.
169+ * @param int $end The index where Redis should stop counting. If ommitted it
170+ * defaults to -1, meaning the very end of the string.
171+ *
172+ * @param bool $bybit Whether or not Redis should treat $start and $end as bit
173+ * positions, rather than bytes.
174+ *
175+ * @return Redis|int|false The number of bits set in the requested range.
176+ *
177+ */
162178 public function bitcount (string $ key , int $ start = 0 , int $ end = -1 , bool $ bybit = false ): Redis |int |false ;
163179
164180 public function bitop (string $ operation , string $ deskey , string $ srckey , string ...$ other_keys ): Redis |int |false ;
165181
166182 /**
167- Return the position of the first bit set to 0 or 1 in a string.
168-
169- @see https://https://redis.io/commands/bitpos/
170-
171- @param string $key The key to check (must be a string)
172- @param bool $bit Whether to look for an unset (0) or set (1) bit.
173- @param int $start Where in the string to start looking.
174- @param int $end Where in the string to stop looking.
175- @param bool $bybit If true, Redis will treat $start and $end as BIT values and not bytes, so if start
176- was 0 and end was 2, Redis would only search the first two bits.
177- */
183+ * Return the position of the first bit set to 0 or 1 in a string.
184+ *
185+ * @see https://https://redis.io/commands/bitpos/
186+ *
187+ * @param string $key The key to check (must be a string)
188+ * @param bool $bit Whether to look for an unset (0) or set (1) bit.
189+ * @param int $start Where in the string to start looking.
190+ * @param int $end Where in the string to stop looking.
191+ * @param bool $bybit If true, Redis will treat $start and $end as BIT values and not bytes, so if start
192+ * was 0 and end was 2, Redis would only search the first two bits.
193+ *
194+ * @return Redis|int|false The position of the first set or unset bit.
195+ **/
178196 public function bitpos (string $ key , bool $ bit , int $ start = 0 , int $ end = -1 , bool $ bybit = false ): Redis |int |false ;
179197
180198 public function blPop (string |array $ key , string |float |int $ timeout_or_key , mixed ...$ extra_args ): Redis |array |null |false ;
0 commit comments