remove('http_errors'); $stack->unshift(Middleware::httpErrors($bodySummarizer), 'http_errors'); $config['handler'] = $stack; } $client = new Client($config); } $logger = ($logger === false) ? null : $logger ?? ApplicationDefaultCredentials::getDefaultLogger(); switch (ClientInterface::MAJOR_VERSION) { case 7: case 8: return new Guzzle7HttpHandler($client, $logger); default: throw new \Exception('Version not supported'); } } }