protected function loadClient(array $client, ContainerBuilder $container)
    {
        $dsnResolver = function ($dsn) use ($container) {
            $usedEnvs = null;
            if (method_exists($container, 'resolveEnvPlaceholders')) {
                $container->resolveEnvPlaceholders($dsn, null, $usedEnvs);
            }

            if ($usedEnvs) {
                return new RedisEnvDsn($dsn);
            }

            $parsedDsn = new RedisDsn($dsn);

            if ($parsedDsn->isValid()) {
                return $parsedDsn;
            }

            throw new \InvalidArgumentException(sprintf('Given Redis DSN "%s" is invalid.', $dsn));
        };

        $client['dsns'] = array_map($dsnResolver, $client['dsns']);

        switch ($client['type']) {
            case 'predis':
                $this->loadPredisClient($client, $container);
                break;
            case 'phpredis':
                $this->loadPhpredisClient($client, $container);
                break;
        }
    }
protected function loadClient(array $client, ContainerBuilder $container)
    {
        $dsnResolver = function ($dsn) use ($container) {
            $usedEnvs = null;
            if (method_exists($container, 'resolveEnvPlaceholders')) {
                $container->resolveEnvPlaceholders($dsn, null, $usedEnvs);
            }

            if ($usedEnvs) {
                return new RedisEnvDsn($dsn);
            }

            $parsedDsn = new RedisDsn($dsn);

            if ($parsedDsn->isValid()) {
                return $parsedDsn;
            }

            throw new \InvalidArgumentException(sprintf('Given Redis DSN "%s" is invalid.', $dsn));
        };

        $client['dsns'] = array_map($dsnResolver, $client['dsns']);

        switch ($client['type']) {
            case 'predis':
                $this->loadPredisClient($client, $container);
                break;
            case 'phpredis':
                $this->loadPhpredisClient($client, $container);
                break;
        }
    }
protected function loadClient ( array $ client , ContainerBuilder $ container ) { $ dsnResolver = function ( $ dsn ) use ( $ container ) { $ usedEnvs = null ; if ( method_exists ( $ container , 'resolveEnvPlaceholders' ) ) { $ container -> resolveEnvPlaceholders ( $ dsn , null , $ usedEnvs ) ; } if ( $ usedEnvs ) { return new RedisEnvDsn ( $ dsn ) ; } $ parsedDsn = new RedisDsn ( $ dsn ) ; if ( $ parsedDsn -> isValid ( ) ) { return $ parsedDsn ; } throw new \ InvalidArgumentException ( sprintf ( 'Given Redis DSN "%s" is invalid.' , $ dsn ) ) ; } ; $ client [ 'dsns' ] = array_map ( $ dsnResolver , $ client [ 'dsns' ] ) ; switch ( $ client [ 'type' ] ) { case 'predis' : $ this -> loadPredisClient ( $ client , $ container ) ; break ; case 'phpredis' : $ this -> loadPhpredisClient ( $ client , $ container ) ; break ; } }
Loads a redis client.

@param array            $client    A client configuration
@param ContainerBuilder $container A ContainerBuilder instance
Loads a redis client .