Code Duplication    Length = 8-8 lines in 2 locations

src/Client.php 2 locations

@@ 953-960 (lines=8) @@
950
            curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
951
        }
952
953
        if ($username && $password) {
954
            curl_setopt($curl, CURLOPT_USERPWD, $username . ':' . $password);
955
            if (defined('CURLOPT_HTTPAUTH')) {
956
                curl_setopt($curl, CURLOPT_HTTPAUTH, $authType);
957
            } elseif ($authType != 1) {
958
                error_log('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth is supported by the current PHP/curl install');
959
            }
960
        }
961
962
        if ($method == 'https') {
963
            // set cert file
@@ 1000-1007 (lines=8) @@
997
                $proxyPort = 8080; // NB: even for HTTPS, local connection is on port 8080
998
            }
999
            curl_setopt($curl, CURLOPT_PROXY, $proxyHost . ':' . $proxyPort);
1000
            if ($proxyUsername) {
1001
                curl_setopt($curl, CURLOPT_PROXYUSERPWD, $proxyUsername . ':' . $proxyPassword);
1002
                if (defined('CURLOPT_PROXYAUTH')) {
1003
                    curl_setopt($curl, CURLOPT_PROXYAUTH, $proxyAuthType);
1004
                } elseif ($proxyAuthType != 1) {
1005
                    error_log('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth to proxy is supported by the current PHP/curl install');
1006
                }
1007
            }
1008
        }
1009
1010
        // NB: should we build cookie http headers by hand rather than let CURL do it?