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;
        }
    }