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
+50-9Lines changed: 50 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -221,16 +221,35 @@ public function getRequestFactory()
221
221
publicfunctionsetHttpClient($client)
222
222
{
223
223
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);
224
+
trigger_error(
225
+
sprintf(
226
+
'Passing a "%s" to "%s::setHttpClient" is deprecated. Please use a "Http\Client\HttpClient" instead.',
227
+
GuzzleClientInterface::class,
228
+
static::class
229
+
),
230
+
E_USER_DEPRECATED
231
+
);
225
232
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));
233
+
thrownew \RuntimeException(
234
+
sprintf(
235
+
'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));
246
+
thrownew \RuntimeException(
247
+
sprintf(
248
+
'First parameter to "%s::setHttpClient" was expected to be a "Http\Client\HttpClient", you provided a "%s"',
249
+
static::class,
250
+
$type
251
+
)
252
+
);
234
253
}
235
254
236
255
$this->httpClient = $client;
@@ -255,14 +274,23 @@ public function getHttplugClient()
255
274
*/
256
275
publicfunctiongetHttpClient()
257
276
{
258
-
trigger_error(sprintf('Using "%s::getHttpClient" is deprecated in favor for "%s::getHttplugClient".', static::class, static::class), E_USER_DEPRECATED);
277
+
trigger_error(
278
+
sprintf(
279
+
'Using "%s::getHttpClient" is deprecated in favor for "%s::getHttplugClient".',
280
+
static::class,
281
+
static::class
282
+
),
283
+
E_USER_DEPRECATED
284
+
);
259
285
260
286
if ($this->guzzleClient !== null) {
261
287
return$this->guzzleClient;
262
288
}
263
289
264
290
if (!class_exists(GuzzleClient::class)) {
265
-
thrownew \RuntimeException('You must install "php-http/guzzle6-adapter" to be able to use "%s::getHttplugClient".', static::class);
291
+
thrownew \RuntimeException(
292
+
'You must install "php-http/guzzle6-adapter" to be able to use "%s::getHttplugClient".', static::class
293
+
);
266
294
}
267
295
268
296
returnnewGuzzleClient($this->guzzle6Options);
@@ -899,23 +927,36 @@ private function getHttpClientFromOptions(array $options, array $collaborators)
899
927
if (empty($guzzle6Options)) {
900
928
return HttpClientDiscovery::find();
901
929
} else {
902
-
trigger_error('Passing options to Guzzle6 client is deprecated. Use "httplugClient" instead', E_USER_DEPRECATED);
930
+
trigger_error(
931
+
'Passing options to Guzzle6 client is deprecated. Use "httplugClient" instead',
932
+
E_USER_DEPRECATED
933
+
);
903
934
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.');
935
+
thrownew \RuntimeException(
936
+
'You must install "php-http/guzzle6-adapter" to be able to pass options to the Guzzle6 client.'
0 commit comments