You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
trigger_error(sprintf('Passing a "%s" to "%s::setHttpClient" is deprecated. Please use a "Http\Client\HttpClient" instead.', GuzzleClientInterface::class, static::class), E_USER_DEPRECATED);
225
+
if (!class_exists(HttplugGuzzle6::class)) {
226
+
thrownew \RuntimeException(sprintf('You must install "php-http/guzzle6-adapter" to be able to pass a "%s" to "%s::setHttpClient".', GuzzleClientInterface::class, static::class));
thrownew \RuntimeException(sprintf('First parameter to "%s::setHttpClient" was expected to be a "Http\Client\HttpClient", you provided a "%s"', static::class, $type));
234
+
}
235
+
215
236
$this->httpClient = $client;
216
237
217
238
return$this;
@@ -220,13 +241,33 @@ public function setHttpClient(HttpClientInterface $client)
220
241
/**
221
242
* Returns the HTTP client instance.
222
243
*
223
-
* @return HttpClientInterface
244
+
* @return HttpClient
224
245
*/
225
-
publicfunctiongetHttpClient()
246
+
publicfunctiongetHttplugClient()
226
247
{
227
248
return$this->httpClient;
228
249
}
229
250
251
+
/**
252
+
* Returns the HTTP client instance.
253
+
*
254
+
* @return GuzzleClientInterface
255
+
*/
256
+
publicfunctiongetHttpClient()
257
+
{
258
+
trigger_error(sprintf('Using "%s::getHttpClient" is deprecated in favor for "%s::getHttplugClient".', static::class, static::class), E_USER_DEPRECATED);
259
+
260
+
if ($this->guzzleClient !== null) {
261
+
return$this->guzzleClient;
262
+
}
263
+
264
+
if (!class_exists(GuzzleClient::class)) {
265
+
thrownew \RuntimeException('You must install "php-http/guzzle6-adapter" to be able to use "%s::getHttplugClient".', static::class);
266
+
}
267
+
268
+
returnnewGuzzleClient($this->guzzle6Options);
269
+
}
270
+
230
271
/**
231
272
* Sets the instance of the CSPRNG random generator factory.
0 commit comments