Skip to content

Commit

Permalink
update phpredis stubs
Browse files Browse the repository at this point in the history
* fixes feedback for setOption of vimeo#7709
* latest WIP stubs with additional changes from upstream phpredis master and other additions

From https://raw.githubusercontent.com/phpredis/phpredis/77334ecbf2c06ea1ff18ea5e3ecc168cb1897a8b/redis.stub.php via phpredis/phpredis#2015
  • Loading branch information
kkmuffme committed Mar 4, 2022
1 parent e1997c9 commit 8fc41e6
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions stubs/phpredis.phpstub
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Redis {

public function config(string $operation, string $key, mixed $value = null): mixed;

public function connect(string $host, int $port = 26379, float $timeout = 0, string $persistent_id = null, int $retry_interval = 0, float $read_timeout = 0, array $context = null): bool;
public function connect(string $host, int $port = 6379, float $timeout = 0, string $persistent_id = null, int $retry_interval = 0, float $read_timeout = 0, array $context = null): bool;

public function copy(string $src, string $dst, array $options = null): bool;

Expand Down Expand Up @@ -137,6 +137,10 @@ class Redis {

public function georadiusbymember_ro(string $key, string $member, float $radius, string $unit, array $options = []): Redis|mixed|false;

public function geosearch(string $key, array|string $position, array|int|float $shape, string $unit, array $options = []): array;

public function geosearchstore(string $dst, string $src, array|string $position, array|int|float $shape, string $unit, array $options = []): array;

/** @return string|Redis */
public function get(string $key);

Expand Down Expand Up @@ -197,7 +201,7 @@ class Redis {

public function hVals(string $key): Redis|array|false;

public function hscan(string $key, int &$iterator, ?string $pattern = null, int $count = 0): bool|array;
public function hscan(string $key, ?int &$iterator, ?string $pattern = null, int $count = 0): bool|array;

/** @return int|Redis */
public function incr(string $key, int $by = 1);
Expand Down Expand Up @@ -281,9 +285,9 @@ class Redis {
* @deprecated
* @alias Redis::connect
*/
public function open(string $host, int $port = 26379, float $timeout = 0, string $persistent_id = NULL, int $retry_interval = 0, float $read_timeout = 0, array $context = NULL): bool;
public function open(string $host, int $port = 6379, float $timeout = 0, string $persistent_id = NULL, int $retry_interval = 0, float $read_timeout = 0, array $context = NULL): bool;

public function pconnect(string $host, int $port = 26379, float $timeout = 0, string $persistent_id = NULL, int $retry_interval = 0, float $read_timeout = 0, array $context = NULL): bool;
public function pconnect(string $host, int $port = 6379, float $timeout = 0, string $persistent_id = NULL, int $retry_interval = 0, float $read_timeout = 0, array $context = NULL): bool;

public function persist(string $key): bool;

Expand All @@ -306,7 +310,7 @@ public function persist(string $key): bool;
* @deprecated
* @alias Redis::pconnect
*/
public function popen(string $host, int $port = 26379, float $timeout = 0, string $persistent_id = NULL, int $retry_interval = 0, float $read_timeout = 0, array $context = NULL): bool;
public function popen(string $host, int $port = 6379, float $timeout = 0, string $persistent_id = NULL, int $retry_interval = 0, float $read_timeout = 0, array $context = NULL): bool;

/** @return bool|Redis */
public function psetex(string $key, int $expire, mixed $value);
Expand Down Expand Up @@ -387,7 +391,7 @@ public function persist(string $key): bool;
public function setRange(string $key, int $start, string $value);


public function setOption(string $option, mixed $value): bool;
public function setOption(int $option, mixed $value): bool;

/** @return bool|Redis */
public function setex(string $key, int $expire, mixed $value);
Expand Down Expand Up @@ -506,6 +510,8 @@ public function persist(string $key): bool;

public function zRangeByScore(string $key, string $start, string $end, array $options = []): Redis|array|false;

public function zRandMember(string $key, array $options = null): string|array;

public function zRank(string $key, mixed $member): Redis|int|false;

public function zRem(mixed $key, mixed $member, mixed ...$other_members): Redis|int|false;
Expand Down Expand Up @@ -534,7 +540,7 @@ public function persist(string $key): bool;

public function zinterstore(string $dst, array $keys, ?array $weights = null, ?string $aggregate = null): Redis|int|false;

public function zscan(string $key, int &$iterator, ?string $pattern = null, int $count = 0): bool|array;
public function zscan(string $key, ?int &$iterator, ?string $pattern = null, int $count = 0): bool|array;

public function zunion(array $keys, ?array $weights = null, ?array $options = null): Redis|array|false;

Expand Down

0 comments on commit 8fc41e6

Please sign in to comment.