Skip to content

Commit 466e92f

Browse files
[HttpFoundation] Fix type of properties in Request class
1 parent 1313f17 commit 466e92f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Response/MockResponse.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class MockResponse implements ResponseInterface, StreamableInterface
2828
use CommonResponseTrait;
2929
use TransportResponseTrait;
3030

31-
private string|iterable $body;
31+
private string|iterable|null $body;
3232
private array $requestOptions = [];
3333
private string $requestUrl;
3434
private string $requestMethod;
@@ -98,7 +98,7 @@ public function cancel(): void
9898
$this->info['canceled'] = true;
9999
$this->info['error'] = 'Response has been canceled.';
100100
try {
101-
unset($this->body);
101+
$this->body = null;
102102
} catch (TransportException $e) {
103103
// ignore errors when canceling
104104
}
@@ -172,7 +172,7 @@ protected static function perform(ClientState $multi, array &$responses): void
172172
foreach ($responses as $response) {
173173
$id = $response->id;
174174

175-
if (!isset($response->body)) {
175+
if (null === $response->body) {
176176
// Canceled response
177177
$response->body = [];
178178
} elseif ([] === $response->body) {

0 commit comments

Comments
 (0)