Skip to content

Commit

Permalink
correct Redis types for php 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
astarostin authored and LolGleb committed Apr 23, 2024
1 parent f590834 commit dc69854
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions redis/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ public function echo($message) {}
* }
* </pre>
*/
public function get($key) {}
public function get(string $key): mixed {}

/**
* Set the string value in argument as value of the key.
Expand Down Expand Up @@ -3124,7 +3124,7 @@ public function getMultiple(array $keys) {}
* // }
* </pre>
*/
public function mGet(array $array) {}
public function mGet(array $array): Redis|array {}

/**
* Set one ore more string keys but only if none of the key exist.
Expand Down Expand Up @@ -4013,7 +4013,7 @@ public function bzPopMin($key_or_keys, $timeout_or_key, ...$extra_args) {}
* $redis->hGet('h', 'key1'); // returns "plop"
* </pre>
*/
public function hSet($key, $hashKey, $value) {}
public function hSet(string $key, string $hashKey, mixed $value): Redis|int|false {}

/**
* Adds a value to the hash stored at key only if this field isn't already in the hash.
Expand Down Expand Up @@ -4050,7 +4050,7 @@ public function hSetNx($key, $hashKey, $value) {}
*
* @link https://redis.io/commands/hget
*/
public function hGet($key, $hashKey) {}
public function hGet(string $key, string $hashKey): mixed {}

/**
* Returns the length of a hash, in number of items
Expand Down Expand Up @@ -4305,7 +4305,7 @@ public function hIncrByFloat($key, $field, $increment) {}
* $redis->hIncrBy('user:1', 'salary', 100); // Joe earns 100 more now.
* </pre>
*/
public function hMSet($key, $hashKeys) {}
public function hMSet(string $key, array $hashKeys): Redis|bool {}

/**
* Retrieve the values associated to the specified fields in the hash.
Expand Down Expand Up @@ -4803,7 +4803,7 @@ public function evaluate($script, $args = [], $numKeys = 0) {}
* $redis->evalSha($sha); // Returns 1
* </pre>
*/
public function evalSha($scriptSha, $args = [], $numKeys = 0) {}
public function evalSha(string $scriptSha, array $args = [], int $numKeys = 0): mixed {}

/**
* @param string $scriptSha
Expand Down Expand Up @@ -5541,7 +5541,7 @@ public function xRevRange($stream, $end, $start, $count = -1) {}
* @example $redis->xTrim('stream', 3);
* @example $redis->xTrim('stream', '2-1', false, true);
*/
public function xtrim(string $key, string $threshold, bool $approx = false, bool $minid = false, int $limit = -1): Redis|int|false;
public function xtrim(string $key, string $threshold, bool $approx = false, bool $minid = false, int $limit = -1): Redis|int|false {}

/**
* Adds a values to the set value stored at key.
Expand Down

0 comments on commit dc69854

Please sign in to comment.