Skip to content
This repository was archived by the owner on Jan 8, 2021. It is now read-only.

Commit ce3b2a9

Browse files
committed
Allow for replacing HttpClient #VIT-2506
1 parent c9206ef commit ce3b2a9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Client.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Contentful\Log\NullLogger;
1010
use Contentful\Log\StandardTimer;
1111
use GuzzleHttp\Client as GuzzleClient;
12+
use GuzzleHttp\ClientInterface;
1213
use GuzzleHttp\HandlerStack;
1314
use GuzzleHttp\Exception\ClientException;
1415
use Contentful\Log\LoggerInterface;
@@ -185,4 +186,14 @@ protected function decodeJson($json)
185186

186187
return $result;
187188
}
189+
190+
/**
191+
* Changed Http Client need have added BearerToken to HandlerStack.
192+
*
193+
* @param ClientInterface $httpClient
194+
*/
195+
public function setHttpClient(ClientInterface $httpClient)
196+
{
197+
$this->httpClient = $httpClient;
198+
}
188199
}

0 commit comments

Comments
 (0)