Skip to content

Commit b7a1b92

Browse files
authored
[9.x] Made Http::sequence()->push() consistent with Http::response() (#42659)
* Made Http::sequence()->push() consistent with Http::response() by allowing null as the body. This will also fix an error in PHPStan. * changed type
1 parent a7d1814 commit b7a1b92

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Illuminate/Http/Client/Factory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function __construct(Dispatcher $dispatcher = null)
119119
/**
120120
* Create a new response instance for use during stubbing.
121121
*
122-
* @param array|string $body
122+
* @param array|string|null $body
123123
* @param int $status
124124
* @param array $headers
125125
* @return \GuzzleHttp\Promise\PromiseInterface

src/Illuminate/Http/Client/ResponseSequence.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ public function __construct(array $responses)
4444
/**
4545
* Push a response to the sequence.
4646
*
47-
* @param string|array $body
47+
* @param string|array|null $body
4848
* @param int $status
4949
* @param array $headers
5050
* @return $this
5151
*/
52-
public function push($body = '', int $status = 200, array $headers = [])
52+
public function push($body = null, int $status = 200, array $headers = [])
5353
{
5454
$body = is_array($body) ? json_encode($body) : $body;
5555

0 commit comments

Comments
 (0)