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
Copy file name to clipboardExpand all lines: src/Provider/AbstractProvider.php
+55-11Lines changed: 55 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -99,7 +99,8 @@ abstract class AbstractProvider
99
99
/**
100
100
* The options given to the Guzzle6 client
101
101
* @var array
102
-
* @deprecated These are to be removed in the next major release. These options are only used in getHttpClient to keep BC.
102
+
* @deprecated These are to be removed in the next major release.
103
+
* These options are only used in getHttpClient to keep BC.
103
104
*/
104
105
private$guzzle6Options = [];
105
106
@@ -221,16 +222,36 @@ public function getRequestFactory()
221
222
publicfunctionsetHttpClient($client)
222
223
{
223
224
if ($clientinstanceof GuzzleClientInterface) {
224
-
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
+
@trigger_error(
226
+
sprintf(
227
+
'Passing a "%s" to "%s::setHttpClient" is deprecated. Use a "Http\Client\HttpClient" instead.',
228
+
GuzzleClientInterface::class,
229
+
static::class
230
+
),
231
+
E_USER_DEPRECATED
232
+
);
225
233
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));
234
+
thrownew \RuntimeException(
235
+
sprintf(
236
+
'You must install "php-http/guzzle6-adapter" to be able to pass a "%s" to "%s::setHttpClient".',
thrownew \RuntimeException(sprintf('First parameter to "%s::setHttpClient" was expected to be a "Http\Client\HttpClient", you provided a "%s"', static::class, $type));
247
+
thrownew \RuntimeException(
248
+
sprintf(
249
+
'First parameter to "%s::setHttpClient" was expected to be a "%s", you provided a "%s"',
250
+
static::class,
251
+
HttpClient::class,
252
+
$type
253
+
)
254
+
);
234
255
}
235
256
236
257
$this->httpClient = $client;
@@ -255,14 +276,24 @@ public function getHttplugClient()
255
276
*/
256
277
publicfunctiongetHttpClient()
257
278
{
258
-
trigger_error(sprintf('Using "%s::getHttpClient" is deprecated in favor for "%s::getHttplugClient".', static::class, static::class), E_USER_DEPRECATED);
279
+
@trigger_error(
280
+
sprintf(
281
+
'Using "%s::getHttpClient" is deprecated in favor for "%s::getHttplugClient".',
282
+
static::class,
283
+
static::class
284
+
),
285
+
E_USER_DEPRECATED
286
+
);
259
287
260
288
if ($this->guzzleClient !== null) {
261
289
return$this->guzzleClient;
262
290
}
263
291
264
292
if (!class_exists(GuzzleClient::class)) {
265
-
thrownew \RuntimeException('You must install "php-http/guzzle6-adapter" to be able to use "%s::getHttplugClient".', static::class);
293
+
thrownew \RuntimeException(
294
+
'You must install "php-http/guzzle6-adapter" to be able to use "%s::getHttplugClient".',
295
+
static::class
296
+
);
266
297
}
267
298
268
299
returnnewGuzzleClient($this->guzzle6Options);
@@ -899,23 +930,36 @@ private function getHttpClientFromOptions(array $options, array $collaborators)
899
930
if (empty($guzzle6Options)) {
900
931
return HttpClientDiscovery::find();
901
932
} else {
902
-
trigger_error('Passing options to Guzzle6 client is deprecated. Use "httplugClient" instead', E_USER_DEPRECATED);
933
+
@trigger_error(
934
+
'Passing options to Guzzle6 client is deprecated. Use "httplugClient" instead',
935
+
E_USER_DEPRECATED
936
+
);
903
937
if (!class_exists(HttplugGuzzle6::class)) {
904
-
thrownew \RuntimeException('You must install "php-http/guzzle6-adapter" to be able to pass options to the Guzzle6 client.');
938
+
thrownew \RuntimeException(
939
+
'You must install "php-http/guzzle6-adapter" to be able to pass options to the Guzzle6 client.'
0 commit comments