src/Configuration/Option/Cluster.php
protected function getConnectionInitializerByDescription(OptionsInterface $options, $description)
    {
        if ($description === 'predis') {
            $callback = $this->getDefault($options);
        } elseif ($description === 'redis') {
            $callback = function ($options) {
                return new RedisCluster($options->connections, new RedisStrategy($options->crc16));
            };
        } else {
            throw new \InvalidArgumentException(
                'String value for the cluster option must be either `predis` or `redis`'
            );
        }

        return $this->getConnectionInitializer($options, $callback);
    }
protected function getConnectionInitializerByDescription(OptionsInterface $options, $description)
    {
        if ($description === 'predis') {
            $callback = $this->getDefault($options);
        } elseif ($description === 'redis') {
            $callback = function ($options) {
                return new RedisCluster($options->connections, new RedisStrategy($options->crc16));
            };
        } else {
            throw new \InvalidArgumentException(
                'String value for the cluster option must be either `predis` or `redis`'
            );
        }

        return $this->getConnectionInitializer($options, $callback);
    }
protected function getConnectionInitializerByDescription ( OptionsInterface $ options , $ description ) { if ( $ description === 'predis' ) { $ callback = $ this -> getDefault ( $ options ) ; } elseif ( $ description === 'redis' ) { $ callback = function ( $ options ) { return new RedisCluster ( $ options -> connections , new RedisStrategy ( $ options -> crc16 ) ) ; } ; } else { throw new \ InvalidArgumentException ( 'String value for the cluster option must be either `predis` or `redis`' ) ; } return $ this -> getConnectionInitializer ( $ options , $ callback ) ; }
Returns a connection initializer from a descriptive name.

@param OptionsInterface $options     Client options.
@param string           $description Identifier of a cluster backend (`predis`, `redis`)

@return callable
Returns a connection initializer from a descriptive name .