Skip to content

Update signature for RedisCluster::__construct #3593

@codegain

Description

@codegain

Hi,

I'm getting this error:

PhanParamTooManyInternal Call with 6 arg(s) to \RedisCluster::__construct(string $name, array $seeds, float $timeout = default, float $readTimeout = default, bool $persistent = default) which only takes 5 arg(s)

but RedisCluster now has 6 parameters:

    /**
     * Creates a Redis Cluster client
     *
     * @param string | null mixed $name
     * @param array         $seeds
     * @param float         $timeout
     * @param float         $readTimeout
     * @param bool          $persistent
     * @param string | null $auth
     * @throws RedisClusterException
     *
     * @example
     * <pre>
     * // Declaring a cluster with an array of seeds
     * $redisCluster = new RedisCluster(null,['127.0.0.1:6379']);
     *
     * // Loading a cluster configuration by name
     * // In order to load a named array, one must first define the seed nodes in redis.ini.
     * // The following lines would define the cluster 'mycluster', and be loaded automatically by phpredis.
     *
     * // # In redis.ini
     * // redis.clusters.seeds = "mycluster[]=localhost:7000&test[]=localhost:7001"
     * // redis.clusters.timeout = "mycluster=5"
     * // redis.clusters.read_timeout = "mycluster=10"
     * // redis.clusters.auth = "mycluster=password"
     *
     * //Then, this cluster can be loaded by doing the following
     *
     * $redisClusterPro = new RedisCluster('mycluster');
     * $redisClusterDev = new RedisCluster('test');
     * </pre>
     */
    public function __construct($name, $seeds, $timeout = null, $readTimeout = null, $persistent = false, $auth = null) { }

See also:
https://github.com/zgb7mtr/phpredis_cluster_phpdoc/blob/master/src/RedisCluster.php#L96
phpredis/phpredis#1355

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions