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'])));
110
+
thrownewInvalidArgumentException(sprintf('Option "auth_basic" must be string or an array, "%s" given.', \gettype($options['auth_basic'])));
111
111
}
112
112
113
113
if (isset($options['auth_bearer']) && (!\is_string($options['auth_bearer']) || !preg_match('{^[-._=~+/0-9a-zA-Z]++$}', $options['auth_bearer']))) {
114
-
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'])));
114
+
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
115
}
116
116
117
117
if (isset($options['auth_basic'], $options['auth_bearer'])) {
thrownewInvalidArgumentException(sprintf('Option "auth_ntlm" is not supported by %s, try using CurlHttpClient instead.', __CLASS__));
209
+
thrownewInvalidArgumentException(sprintf('Option "auth_ntlm" is not supported by "%s", try using CurlHttpClient instead.', __CLASS__));
210
210
}
211
211
212
-
thrownewInvalidArgumentException(sprintf('Unsupported option "%s" passed to %s, did you mean "%s"?', $name, __CLASS__, implode('", "', $alternatives ?: array_keys($defaultOptions))));
212
+
thrownewInvalidArgumentException(sprintf('Unsupported option "%s" passed to "%s", did you mean "%s"?', $name, __CLASS__, implode('", "', $alternatives ?: array_keys($defaultOptions))));
213
213
}
214
214
215
215
return$options;
@@ -231,13 +231,13 @@ private static function normalizeHeaders(array $headers): array
231
231
232
232
if (\is_int($name)) {
233
233
if (!\is_string($values)) {
234
-
thrownewInvalidArgumentException(sprintf('Invalid value for header "%s": expected string, %s given.', $name, \gettype($values)));
234
+
thrownewInvalidArgumentException(sprintf('Invalid value for header "%s": expected string, "%s" given.', $name, \gettype($values)));
235
235
}
236
236
[$name, $values] = explode(':', $values, 2);
237
237
$values = [ltrim($values)];
238
238
} elseif (!is_iterable($values)) {
239
239
if (\is_object($values)) {
240
-
thrownewInvalidArgumentException(sprintf('Invalid value for header "%s": expected string, %s given.', $name, \get_class($values)));
240
+
thrownewInvalidArgumentException(sprintf('Invalid value for header "%s": expected string, "%s" given.', $name, \get_class($values)));
241
241
}
242
242
243
243
$values = (array) $values;
@@ -299,7 +299,7 @@ private static function normalizeBody($body)
299
299
}
300
300
301
301
if (!\is_string($body) && !\is_array(@stream_get_meta_data($body))) {
302
-
thrownewInvalidArgumentException(sprintf('Option "body" must be string, stream resource, iterable or callable, %s given.', \is_resource($body) ? get_resource_type($body) : \gettype($body)));
302
+
thrownewInvalidArgumentException(sprintf('Option "body" must be string, stream resource, iterable or callable, "%s" given.', \is_resource($body) ? get_resource_type($body) : \gettype($body)));
303
303
}
304
304
305
305
return$body;
@@ -325,7 +325,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
@@ -79,7 +79,7 @@ public function stream($responses, float $timeout = null): ResponseStreamInterfa
79
79
if ($responsesinstanceof ResponseInterface) {
80
80
$responses = [$responses];
81
81
} elseif (!is_iterable($responses)) {
82
-
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)));
82
+
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
@@ -238,7 +238,7 @@ public function stream($responses, float $timeout = null): ResponseStreamInterfa
238
238
if ($responsesinstanceof NativeResponse) {
239
239
$responses = [$responses];
240
240
} elseif (!is_iterable($responses)) {
241
-
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)));
241
+
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