diff options
Diffstat (limited to 'vendor/sabre/http/lib/Client.php')
-rw-r--r-- | vendor/sabre/http/lib/Client.php | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/vendor/sabre/http/lib/Client.php b/vendor/sabre/http/lib/Client.php index 2bc7483a7..c00f9e1b1 100644 --- a/vendor/sabre/http/lib/Client.php +++ b/vendor/sabre/http/lib/Client.php @@ -175,7 +175,7 @@ class Client extends EventEmitter * After calling sendAsync, you must therefore occasionally call the poll() * method, or wait(). */ - public function sendAsync(RequestInterface $request, callable $success = null, callable $error = null) + public function sendAsync(RequestInterface $request, ?callable $success = null, ?callable $error = null) { $this->emit('beforeRequest', [$request]); $this->sendAsyncInternal($request, $success, $error); @@ -299,8 +299,6 @@ class Client extends EventEmitter * Adds a CURL setting. * * These settings will be included in every HTTP request. - * - * @param mixed $value */ public function addCurlSetting(int $name, $value) { @@ -402,7 +400,10 @@ class Client extends EventEmitter $nHeaders[] = $key.': '.$value; } } - $settings[CURLOPT_HTTPHEADER] = $nHeaders; + + if ([] !== $nHeaders) { + $settings[CURLOPT_HTTPHEADER] = $nHeaders; + } $settings[CURLOPT_URL] = $request->getUrl(); // FIXME: CURLOPT_PROTOCOLS is currently unsupported by HHVM if (defined('CURLOPT_PROTOCOLS')) { @@ -416,9 +417,9 @@ class Client extends EventEmitter return $settings; } - const STATUS_SUCCESS = 0; - const STATUS_CURLERROR = 1; - const STATUS_HTTPERROR = 2; + public const STATUS_SUCCESS = 0; + public const STATUS_CURLERROR = 1; + public const STATUS_HTTPERROR = 2; private function parseResponse(string $response, $curlHandle): array { |