public function setConfig()

in src/Transport/Adapter/Symfony.php [23:45]


    public function setConfig(ClientInterface $client, array $config, array $clientOptions): ClientInterface
    {
        $symfonyConfig = [];
        foreach ($config as $key => $value) {
            switch ($key) {
                case RequestOptions::SSL_CERT:
                    $symfonyConfig['local_cert'] = $value;
                    break;
                case RequestOptions::SSL_KEY:
                    $symfonyConfig['local_pk'] = $value;
                    break;
                case RequestOptions::SSL_VERIFY:
                    $symfonyConfig['verify_host'] = $value;
                    $symfonyConfig['verify_peer'] = $value;
                    break;
                case RequestOptions::SSL_CA:
                    $symfonyConfig['cafile'] = $value;
            }
        }
        $class = get_class($client);
        $httpClient = HttpClient::create(array_merge($clientOptions, $symfonyConfig));
        return new $class($httpClient);
    }