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: CachingHttpClient.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -114,7 +114,7 @@ public function stream($responses, float $timeout = null): ResponseStreamInterfa
114
114
if ($responsesinstanceof ResponseInterface) {
115
115
$responses = [$responses];
116
116
} elseif (!is_iterable($responses)) {
117
-
thrownew \TypeError(sprintf('%s() expects parameter 1 to be an iterable of ResponseInterface objects, %s given.', __METHOD__, \is_object($responses) ? \get_class($responses) : \gettype($responses)));
117
+
thrownew \TypeError(sprintf('"%s()" expects parameter 1 to be an iterable of ResponseInterface objects, "%s" given.', __METHOD__, \is_object($responses) ? \get_class($responses) : \gettype($responses)));
@@ -319,7 +319,7 @@ public function stream($responses, float $timeout = null): ResponseStreamInterfa
319
319
if ($responsesinstanceof CurlResponse) {
320
320
$responses = [$responses];
321
321
} elseif (!is_iterable($responses)) {
322
-
thrownew \TypeError(sprintf('%s() expects parameter 1 to be an iterable of CurlResponse objects, %s given.', __METHOD__, \is_object($responses) ? \get_class($responses) : \gettype($responses)));
322
+
thrownew \TypeError(sprintf('%s() expects parameter 1 to be an iterable of CurlResponse objects, "%s" given.', __METHOD__, \is_object($responses) ? \get_class($responses) : \gettype($responses)));
thrownewInvalidArgumentException(sprintf('Option "auth_basic" must be string or an array, %s given.', \gettype($options['auth_basic'])));
111
+
thrownewInvalidArgumentException(sprintf('Option "auth_basic" must be string or an array, "%s" given.', \gettype($options['auth_basic'])));
112
112
}
113
113
114
114
if (isset($options['auth_bearer']) && (!\is_string($options['auth_bearer']) || !preg_match('{^[-._=~+/0-9a-zA-Z]++$}', $options['auth_bearer']))) {
115
-
thrownewInvalidArgumentException(sprintf('Option "auth_bearer" must be a string containing only characters from the base 64 alphabet, %s given.', \is_string($options['auth_bearer']) ? 'invalid string' : \gettype($options['auth_bearer'])));
115
+
thrownewInvalidArgumentException(sprintf('Option "auth_bearer" must be a string containing only characters from the base 64 alphabet, %s given.', \is_string($options['auth_bearer']) ? 'invalid string' : '"'.\gettype($options['auth_bearer']).'"'));
116
116
}
117
117
118
118
if (isset($options['auth_basic'], $options['auth_bearer'])) {
thrownewInvalidArgumentException(sprintf('Option "auth_ntlm" is not supported by %s, try using CurlHttpClient instead.', __CLASS__));
210
+
thrownewInvalidArgumentException(sprintf('Option "auth_ntlm" is not supported by "%s", try using CurlHttpClient instead.', __CLASS__));
211
211
}
212
212
213
-
thrownewInvalidArgumentException(sprintf('Unsupported option "%s" passed to %s, did you mean "%s"?', $name, __CLASS__, implode('", "', $alternatives ?: array_keys($defaultOptions))));
213
+
thrownewInvalidArgumentException(sprintf('Unsupported option "%s" passed to "%s", did you mean "%s"?', $name, __CLASS__, implode('", "', $alternatives ?: array_keys($defaultOptions))));
214
214
}
215
215
216
216
return$options;
@@ -232,13 +232,13 @@ private static function normalizeHeaders(array $headers): array
232
232
233
233
if (\is_int($name)) {
234
234
if (!\is_string($values)) {
235
-
thrownewInvalidArgumentException(sprintf('Invalid value for header "%s": expected string, %s given.', $name, \gettype($values)));
235
+
thrownewInvalidArgumentException(sprintf('Invalid value for header "%s": expected string, "%s" given.', $name, \gettype($values)));
236
236
}
237
237
[$name, $values] = explode(':', $values, 2);
238
238
$values = [ltrim($values)];
239
239
} elseif (!is_iterable($values)) {
240
240
if (\is_object($values)) {
241
-
thrownewInvalidArgumentException(sprintf('Invalid value for header "%s": expected string, %s given.', $name, \get_class($values)));
241
+
thrownewInvalidArgumentException(sprintf('Invalid value for header "%s": expected string, "%s" given.', $name, \get_class($values)));
242
242
}
243
243
244
244
$values = (array) $values;
@@ -313,7 +313,7 @@ private static function normalizeBody($body)
313
313
}
314
314
315
315
if (!\is_array(@stream_get_meta_data($body))) {
316
-
thrownewInvalidArgumentException(sprintf('Option "body" must be string, stream resource, iterable or callable, %s given.', \is_resource($body) ? get_resource_type($body) : \gettype($body)));
316
+
thrownewInvalidArgumentException(sprintf('Option "body" must be string, stream resource, iterable or callable, "%s" given.', \is_resource($body) ? get_resource_type($body) : \gettype($body)));
317
317
}
318
318
319
319
return$body;
@@ -339,7 +339,7 @@ private static function normalizePeerFingerprint($fingerprint): array
Copy file name to clipboardExpand all lines: MockHttpClient.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -82,7 +82,7 @@ public function stream($responses, float $timeout = null): ResponseStreamInterfa
82
82
if ($responsesinstanceof ResponseInterface) {
83
83
$responses = [$responses];
84
84
} elseif (!is_iterable($responses)) {
85
-
thrownew \TypeError(sprintf('%s() expects parameter 1 to be an iterable of MockResponse objects, %s given.', __METHOD__, \is_object($responses) ? \get_class($responses) : \gettype($responses)));
85
+
thrownew \TypeError(sprintf('%s() expects parameter 1 to be an iterable of MockResponse objects, "%s" given.', __METHOD__, \is_object($responses) ? \get_class($responses) : \gettype($responses)));
Copy file name to clipboardExpand all lines: NativeHttpClient.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -235,7 +235,7 @@ public function stream($responses, float $timeout = null): ResponseStreamInterfa
235
235
if ($responsesinstanceof NativeResponse) {
236
236
$responses = [$responses];
237
237
} elseif (!is_iterable($responses)) {
238
-
thrownew \TypeError(sprintf('%s() expects parameter 1 to be an iterable of NativeResponse objects, %s given.', __METHOD__, \is_object($responses) ? \get_class($responses) : \gettype($responses)));
238
+
thrownew \TypeError(sprintf('%s() expects parameter 1 to be an iterable of NativeResponse objects, "%s" given.', __METHOD__, \is_object($responses) ? \get_class($responses) : \gettype($responses)));
0 commit comments