@@ -152,14 +152,14 @@ public function request(string $method, string $url, array $options = []): Respo
152
152
if (\is_array ($ options ['auth_ntlm ' ])) {
153
153
$ count = \count ($ options ['auth_ntlm ' ]);
154
154
if ($ count <= 0 || $ count > 2 ) {
155
- throw new InvalidArgumentException (sprintf ('Option "auth_ntlm" must contain 1 or 2 elements, %d given. ' , $ count ));
155
+ throw new InvalidArgumentException (\ sprintf ('Option "auth_ntlm" must contain 1 or 2 elements, %d given. ' , $ count ));
156
156
}
157
157
158
158
$ options ['auth_ntlm ' ] = implode (': ' , $ options ['auth_ntlm ' ]);
159
159
}
160
160
161
161
if (!\is_string ($ options ['auth_ntlm ' ])) {
162
- throw new InvalidArgumentException (sprintf ('Option "auth_ntlm" must be a string or an array, "%s" given. ' , get_debug_type ($ options ['auth_ntlm ' ])));
162
+ throw new InvalidArgumentException (\ sprintf ('Option "auth_ntlm" must be a string or an array, "%s" given. ' , get_debug_type ($ options ['auth_ntlm ' ])));
163
163
}
164
164
165
165
$ curlopts [\CURLOPT_USERPWD ] = $ options ['auth_ntlm ' ];
@@ -297,21 +297,21 @@ public function request(string $method, string $url, array $options = []): Respo
297
297
unset($ multi ->pushedResponses [$ url ]);
298
298
299
299
if (self ::acceptPushForRequest ($ method , $ options , $ pushedResponse )) {
300
- $ this ->logger ?->debug(sprintf ('Accepting pushed response: "%s %s" ' , $ method , $ url ));
300
+ $ this ->logger ?->debug(\ sprintf ('Accepting pushed response: "%s %s" ' , $ method , $ url ));
301
301
302
302
// Reinitialize the pushed response with request's options
303
303
$ ch = $ pushedResponse ->handle ;
304
304
$ pushedResponse = $ pushedResponse ->response ;
305
305
$ pushedResponse ->__construct ($ multi , $ url , $ options , $ this ->logger );
306
306
} else {
307
- $ this ->logger ?->debug(sprintf ('Rejecting pushed response: "%s" ' , $ url ));
307
+ $ this ->logger ?->debug(\ sprintf ('Rejecting pushed response: "%s" ' , $ url ));
308
308
$ pushedResponse = null ;
309
309
}
310
310
}
311
311
312
312
if (!$ pushedResponse ) {
313
313
$ ch = curl_init ();
314
- $ this ->logger ?->info(sprintf ('Request: "%s %s" ' , $ method , $ url ));
314
+ $ this ->logger ?->info(\ sprintf ('Request: "%s %s" ' , $ method , $ url ));
315
315
$ curlopts += [\CURLOPT_SHARE => $ multi ->share ];
316
316
}
317
317
@@ -321,7 +321,7 @@ public function request(string $method, string $url, array $options = []): Respo
321
321
}
322
322
if (null !== $ value && !curl_setopt ($ ch , $ opt , $ value ) && \CURLOPT_CERTINFO !== $ opt && (!\defined ('CURLOPT_HEADEROPT ' ) || \CURLOPT_HEADEROPT !== $ opt )) {
323
323
$ constantName = $ this ->findConstantName ($ opt );
324
- throw new TransportException (sprintf ('Curl option "%s" is not supported. ' , $ constantName ?? $ opt ));
324
+ throw new TransportException (\ sprintf ('Curl option "%s" is not supported. ' , $ constantName ?? $ opt ));
325
325
}
326
326
}
327
327
@@ -388,7 +388,7 @@ private static function readRequestBody(int $length, \Closure $body, string &$bu
388
388
{
389
389
if (!$ eof && \strlen ($ buffer ) < $ length ) {
390
390
if (!\is_string ($ data = $ body ($ length ))) {
391
- throw new TransportException (sprintf ('The return value of the "body" option callback must be a string, "%s" returned. ' , get_debug_type ($ data )));
391
+ throw new TransportException (\ sprintf ('The return value of the "body" option callback must be a string, "%s" returned. ' , get_debug_type ($ data )));
392
392
}
393
393
394
394
$ buffer .= $ data ;
@@ -551,7 +551,7 @@ private function validateExtraCurlOptions(array $options): void
551
551
foreach ($ options as $ opt => $ optValue ) {
552
552
if (isset ($ curloptsToConfig [$ opt ])) {
553
553
$ constName = $ this ->findConstantName ($ opt ) ?? $ opt ;
554
- throw new InvalidArgumentException (sprintf ('Cannot set "%s" with "extra.curl", use option "%s" instead. ' , $ constName , $ curloptsToConfig [$ opt ]));
554
+ throw new InvalidArgumentException (\ sprintf ('Cannot set "%s" with "extra.curl", use option "%s" instead. ' , $ constName , $ curloptsToConfig [$ opt ]));
555
555
}
556
556
557
557
if (\in_array ($ opt , $ methodOpts )) {
@@ -560,7 +560,7 @@ private function validateExtraCurlOptions(array $options): void
560
560
561
561
if (\in_array ($ opt , $ curloptsToCheck )) {
562
562
$ constName = $ this ->findConstantName ($ opt ) ?? $ opt ;
563
- throw new InvalidArgumentException (sprintf ('Cannot set "%s" with "extra.curl". ' , $ constName ));
563
+ throw new InvalidArgumentException (\ sprintf ('Cannot set "%s" with "extra.curl". ' , $ constName ));
564
564
}
565
565
}
566
566
}
0 commit comments