Skip to content

Commit

Permalink
Merge pull request #713 from iulyanp/revert-guzzle-6-support
Browse files Browse the repository at this point in the history
Revert f310a6c to add Guzzle 6 Support
  • Loading branch information
thangduo authored Jun 24, 2021
2 parents be46b83 + 779d0e0 commit e97487e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"ext-openssl": "*",
"ext-soap": "*",
"google/auth": "^1.0.0",
"guzzlehttp/guzzle": "^7.0",
"guzzlehttp/guzzle": "^6.0 || ^7.0",
"guzzlehttp/psr7": "^1.2",
"monolog/monolog": "^2.2.0",
"phpdocumentor/reflection-docblock": "^3.0.3 || ^4.0 || ^5.0",
Expand Down
11 changes: 10 additions & 1 deletion src/Google/AdsApi/Common/AdsHeaderFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,20 @@ private function formatUtilUsages($adsUtilities, $includeUtilityUsage)

private function formatGuzzleInfo()
{
$guzzleInfoTokens = ['GuzzleHttp/' . ClientInterface::MAJOR_VERSION];
$guzzleInfoTokens = ['GuzzleHttp/' . $this->getGuzzleVersion()];
if (extension_loaded('curl') && function_exists('curl_version')) {
$guzzleInfoTokens[] = 'curl/' . \curl_version()['version'];
}

return implode(', ', $guzzleInfoTokens);
}

private function getGuzzleVersion()
{
if (defined('GuzzleHttp\ClientInterface::MAJOR_VERSION')) {
return ClientInterface::MAJOR_VERSION;
}

return ClientInterface::VERSION;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -418,11 +418,20 @@ private function getFormattedUserAgent()

private function formatGuzzleInfo()
{
$guzzleInfoTokens = ['GuzzleHttp/' . ClientInterface::MAJOR_VERSION];
$guzzleInfoTokens = ['GuzzleHttp/' . $this->getGuzzleVersion()];
if (extension_loaded('curl') && function_exists('curl_version')) {
$guzzleInfoTokens[] = 'curl/' . \curl_version()['version'];
}

return implode(', ', $guzzleInfoTokens);
}

private function getGuzzleVersion()
{
if (defined('GuzzleHttp\ClientInterface::MAJOR_VERSION')) {
return ClientInterface::MAJOR_VERSION;
}

return ClientInterface::VERSION;
}
}

0 comments on commit e97487e

Please sign in to comment.