From 7b78a7e64c97c80d00d203546b75194a0b1ae283 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Ostroluck=C3=BD?= Date: Tue, 30 Nov 2021 20:46:34 +0100 Subject: [PATCH] Fix RedisCluster::getOption() and RedisCluster::setOption argument types See https://github.com/phpredis/phpredis/blob/aac42cd33510030bb62973f8886f4cd98b9b8003/redis_cluster.stub.php#L122 Related https://github.com/vimeo/psalm/pull/6853 --- dictionaries/CallMap.php | 4 ++-- dictionaries/CallMap_74_delta.php | 4 ---- dictionaries/CallMap_historical.php | 4 ++-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/dictionaries/CallMap.php b/dictionaries/CallMap.php index ed850ac64..a6439f97b 100644 --- a/dictionaries/CallMap.php +++ b/dictionaries/CallMap.php @@ -11175,7 +11175,7 @@ return [ 'RedisCluster::getBit' => ['int', 'key'=>'string', 'offset'=>'int'], 'RedisCluster::getLastError' => ['?string'], 'RedisCluster::getMode' => ['int'], -'RedisCluster::getOption' => ['int', 'name'=>'string'], +'RedisCluster::getOption' => ['int', 'option'=>'int'], 'RedisCluster::getRange' => ['string', 'key'=>'string', 'start'=>'int', 'end'=>'int'], 'RedisCluster::getSet' => ['string', 'key'=>'string', 'value'=>'string'], 'RedisCluster::hDel' => ['int|false', 'key'=>'string', 'hashKey'=>'string', '...other_hashKeys='=>'string[]'], @@ -11250,7 +11250,7 @@ return [ 'RedisCluster::setBit' => ['int', 'key'=>'string', 'offset'=>'int', 'value'=>'bool|int'], 'RedisCluster::setex' => ['bool', 'key'=>'string', 'ttl'=>'int', 'value'=>'string'], 'RedisCluster::setnx' => ['bool', 'key'=>'string', 'value'=>'string'], -'RedisCluster::setOption' => ['bool', 'name'=>'string|int', 'value'=>'string|int'], +'RedisCluster::setOption' => ['bool', 'option'=>'int', 'value'=>'string|int'], 'RedisCluster::setRange' => ['string', 'key'=>'string', 'offset'=>'int', 'value'=>'string'], 'RedisCluster::sInter' => ['list', 'key'=>'string', '...other_keys='=>'string'], 'RedisCluster::sInterStore' => ['int', 'dstKey'=>'string', 'key'=>'string', '...other_keys='=>'string'], diff --git a/dictionaries/CallMap_74_delta.php b/dictionaries/CallMap_74_delta.php index 6e3e73824..c4d7a9e9e 100644 --- a/dictionaries/CallMap_74_delta.php +++ b/dictionaries/CallMap_74_delta.php @@ -36,10 +36,6 @@ return [ 'old' => ['resource|false', 'command'=>'string', 'descriptorspec'=>'array', '&w_pipes'=>'resource[]', 'cwd='=>'?string', 'env='=>'?array', 'other_options='=>'array'], 'new' => ['resource|false', 'cmd'=>'string|array', 'descriptorspec'=>'array', '&w_pipes'=>'resource[]', 'cwd='=>'?string', 'env='=>'?array', 'other_options='=>'array'], ], - 'RedisCluster::setOption' => [ - 'old' => ['bool', 'name'=>'string', 'value'=>'string'], - 'new' => ['bool', 'name'=>'string|int', 'value'=>'string|int'], - ] ], 'removed' => [ ], diff --git a/dictionaries/CallMap_historical.php b/dictionaries/CallMap_historical.php index 8495d7530..d49486836 100644 --- a/dictionaries/CallMap_historical.php +++ b/dictionaries/CallMap_historical.php @@ -5776,7 +5776,7 @@ return [ 'RedisCluster::getBit' => ['int', 'key'=>'string', 'offset'=>'int'], 'RedisCluster::getLastError' => ['?string'], 'RedisCluster::getMode' => ['int'], - 'RedisCluster::getOption' => ['int', 'name'=>'string'], + 'RedisCluster::getOption' => ['int', 'option'=>'int'], 'RedisCluster::getRange' => ['string', 'key'=>'string', 'start'=>'int', 'end'=>'int'], 'RedisCluster::getSet' => ['string', 'key'=>'string', 'value'=>'string'], 'RedisCluster::hDel' => ['int|false', 'key'=>'string', 'hashKey'=>'string', '...other_hashKeys='=>'string[]'], @@ -5861,7 +5861,7 @@ return [ 'RedisCluster::script' => ['string|bool|array', 'nodeParams'=>'string|array{0:string,1:int}', 'command'=>'string', 'script='=>'string', '...other_scripts='=>'string[]'], 'RedisCluster::set' => ['bool', 'key'=>'string', 'value'=>'string', 'timeout='=>'array|int'], 'RedisCluster::setBit' => ['int', 'key'=>'string', 'offset'=>'int', 'value'=>'bool|int'], - 'RedisCluster::setOption' => ['bool', 'name'=>'string', 'value'=>'string'], + 'RedisCluster::setOption' => ['bool', 'option'=>'int', 'value'=>'string|int'], 'RedisCluster::setRange' => ['string', 'key'=>'string', 'offset'=>'int', 'value'=>'string'], 'RedisCluster::setex' => ['bool', 'key'=>'string', 'ttl'=>'int', 'value'=>'string'], 'RedisCluster::setnx' => ['bool', 'key'=>'string', 'value'=>'string'],