private function appendUserAgent(array $options): array
    {
        $defaultAgent = 'GuzzleHttp/' . Client::VERSION;
        if (extension_loaded('curl') && function_exists('curl_version')) {
            $defaultAgent .= ' curl/' . \curl_version()['version'];
        }
        $defaultAgent .= ' PHP/' . PHP_VERSION;

        if (!isset($options['headers']['User-Agent'])) {
            $options['headers']['User-Agent'] = $defaultAgent;
        }

        $options['headers']['User-Agent'] .= ' ' . $defaultAgent;

        return $options;
    }