Closed jaikdean closed 3 years ago
I found these snippets:
Could you try to dump the value of \RedisCluster::FAILOVER_NONE
to see if it's a string that has been flagged as an int or if it's indeed an int and we should change the method signature?
Looks like it's an int.
$ php -v
PHP 7.4.12 (cli) (built: Oct 29 2020 18:37:21) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Xdebug v2.9.6, Copyright (c) 2002-2020, by Derick Rethans
with Zend OPcache v7.4.12, Copyright (c), by Zend Technologies
$ php -i | grep "Redis Version"
Redis Version => 5.3.1
$ php -r 'var_dump(\RedisCluster::FAILOVER_NONE);'
Command line code:1:
int(0)
Thanks :)
Then it should be a simple change in this file:
https://github.com/vimeo/psalm/blob/master/dictionaries/CallMap.php on the line with Rediscluster::setOption
We should add int to the types accepted for param value.
Do you want to try pushing a PR?
This example has been written as per the documentation for
RedisCluster::setOption()
. It may be that the constants or method signatures in the Redis extension have changed over time, but it's certainly throwing errors on the latest version.