@@ -299,7 +299,7 @@ public function asMultipart()
299
299
*/
300
300
public function bodyFormat (string $ format )
301
301
{
302
- return tap ($ this , function ($ request ) use ($ format ) {
302
+ return tap ($ this , function () use ($ format ) {
303
303
$ this ->bodyFormat = $ format ;
304
304
});
305
305
}
@@ -344,8 +344,8 @@ public function accept($contentType)
344
344
*/
345
345
public function withHeaders (array $ headers )
346
346
{
347
- return tap ($ this , function ($ request ) use ($ headers ) {
348
- return $ this ->options = array_merge_recursive ($ this ->options , [
347
+ return tap ($ this , function () use ($ headers ) {
348
+ $ this ->options = array_merge_recursive ($ this ->options , [
349
349
'headers ' => $ headers ,
350
350
]);
351
351
});
@@ -360,8 +360,8 @@ public function withHeaders(array $headers)
360
360
*/
361
361
public function withBasicAuth (string $ username , string $ password )
362
362
{
363
- return tap ($ this , function ($ request ) use ($ username , $ password ) {
364
- return $ this ->options ['auth ' ] = [$ username , $ password ];
363
+ return tap ($ this , function () use ($ username , $ password ) {
364
+ $ this ->options ['auth ' ] = [$ username , $ password ];
365
365
});
366
366
}
367
367
@@ -374,8 +374,8 @@ public function withBasicAuth(string $username, string $password)
374
374
*/
375
375
public function withDigestAuth ($ username , $ password )
376
376
{
377
- return tap ($ this , function ($ request ) use ($ username , $ password ) {
378
- return $ this ->options ['auth ' ] = [$ username , $ password , 'digest ' ];
377
+ return tap ($ this , function () use ($ username , $ password ) {
378
+ $ this ->options ['auth ' ] = [$ username , $ password , 'digest ' ];
379
379
});
380
380
}
381
381
@@ -388,8 +388,8 @@ public function withDigestAuth($username, $password)
388
388
*/
389
389
public function withToken ($ token , $ type = 'Bearer ' )
390
390
{
391
- return tap ($ this , function ($ request ) use ($ token , $ type ) {
392
- return $ this ->options ['headers ' ]['Authorization ' ] = trim ($ type .' ' .$ token );
391
+ return tap ($ this , function () use ($ token , $ type ) {
392
+ $ this ->options ['headers ' ]['Authorization ' ] = trim ($ type .' ' .$ token );
393
393
});
394
394
}
395
395
@@ -401,8 +401,8 @@ public function withToken($token, $type = 'Bearer')
401
401
*/
402
402
public function withUserAgent ($ userAgent )
403
403
{
404
- return tap ($ this , function ($ request ) use ($ userAgent ) {
405
- return $ this ->options ['headers ' ]['User-Agent ' ] = trim ($ userAgent );
404
+ return tap ($ this , function () use ($ userAgent ) {
405
+ $ this ->options ['headers ' ]['User-Agent ' ] = trim ($ userAgent );
406
406
});
407
407
}
408
408
@@ -415,8 +415,8 @@ public function withUserAgent($userAgent)
415
415
*/
416
416
public function withCookies (array $ cookies , string $ domain )
417
417
{
418
- return tap ($ this , function ($ request ) use ($ cookies , $ domain ) {
419
- return $ this ->options = array_merge_recursive ($ this ->options , [
418
+ return tap ($ this , function () use ($ cookies , $ domain ) {
419
+ $ this ->options = array_merge_recursive ($ this ->options , [
420
420
'cookies ' => CookieJar::fromArray ($ cookies , $ domain ),
421
421
]);
422
422
});
@@ -429,8 +429,8 @@ public function withCookies(array $cookies, string $domain)
429
429
*/
430
430
public function withoutRedirecting ()
431
431
{
432
- return tap ($ this , function ($ request ) {
433
- return $ this ->options ['allow_redirects ' ] = false ;
432
+ return tap ($ this , function () {
433
+ $ this ->options ['allow_redirects ' ] = false ;
434
434
});
435
435
}
436
436
@@ -441,8 +441,8 @@ public function withoutRedirecting()
441
441
*/
442
442
public function withoutVerifying ()
443
443
{
444
- return tap ($ this , function ($ request ) {
445
- return $ this ->options ['verify ' ] = false ;
444
+ return tap ($ this , function () {
445
+ $ this ->options ['verify ' ] = false ;
446
446
});
447
447
}
448
448
@@ -454,8 +454,8 @@ public function withoutVerifying()
454
454
*/
455
455
public function sink ($ to )
456
456
{
457
- return tap ($ this , function ($ request ) use ($ to ) {
458
- return $ this ->options ['sink ' ] = $ to ;
457
+ return tap ($ this , function () use ($ to ) {
458
+ $ this ->options ['sink ' ] = $ to ;
459
459
});
460
460
}
461
461
@@ -512,8 +512,8 @@ public function retry(int $times, int $sleep = 0, ?callable $when = null, bool $
512
512
*/
513
513
public function withOptions (array $ options )
514
514
{
515
- return tap ($ this , function ($ request ) use ($ options ) {
516
- return $ this ->options = array_replace_recursive (
515
+ return tap ($ this , function () use ($ options ) {
516
+ $ this ->options = array_replace_recursive (
517
517
array_merge_recursive ($ this ->options , Arr::only ($ options , $ this ->mergableOptions )),
518
518
$ options
519
519
);
0 commit comments