From 1fefffdadb0bc96e502fad5a430ba6760c2c3e5f Mon Sep 17 00:00:00 2001 From: David Supplee Date: Tue, 1 Mar 2016 14:34:19 -0500 Subject: [PATCH] only build default http handler if none is supplied --- src/HttpRequestWrapper.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/HttpRequestWrapper.php b/src/HttpRequestWrapper.php index 6a1fad3216d9..49cd1c136312 100644 --- a/src/HttpRequestWrapper.php +++ b/src/HttpRequestWrapper.php @@ -22,6 +22,7 @@ use Google\Auth\HttpHandler\HttpHandlerFactory; use GuzzleHttp\Psr7; use Psr\Http\Message\RequestInterface; +use Psr\Http\Message\ResponseInterface; /** * The HttpRequestWrapper is responsible for delivering and signing requests. @@ -73,9 +74,8 @@ public function __construct( callable $httpHandler = null, callable $authHttpHandler = null ) { - $handler = HttpHandlerFactory::build(); - $this->httpHandler = $httpHandler ?: $handler; - $this->authHttpHandler = $authHttpHandler ?: $handler; + $this->httpHandler = $httpHandler ?: HttpHandlerFactory::build(); + $this->authHttpHandler = $authHttpHandler ?: $this->httpHandler; $this->scopes = $scopes; if ($keyFile || $keyFilePath) { @@ -88,7 +88,7 @@ public function __construct( * * @param RequestInterface $request Psr7 request. * @param array $options HTTP specific configuration options. - * @return RequestInterface + * @return ResponseInterface */ public function send(RequestInterface $request, array $options = []) {