Skip to content

Commit e7e2261

Browse files
[HttpClient] add $response->cancel()
1 parent 5572012 commit e7e2261

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Response/ResponseTrait.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,15 @@ public function toArray(bool $throw = true): array
169169
return $content;
170170
}
171171

172+
/**
173+
* {@inheritdoc}
174+
*/
175+
public function cancel(): void
176+
{
177+
$this->info['error'] = 'Response has been canceled.';
178+
$this->close();
179+
}
180+
172181
/**
173182
* Closes the response and all its network handles.
174183
*/

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"require": {
2222
"php": "^7.1.3",
2323
"psr/log": "^1.0",
24-
"symfony/http-client-contracts": "^1.1",
24+
"symfony/http-client-contracts": "^1.1.3",
2525
"symfony/polyfill-php73": "^1.11"
2626
},
2727
"require-dev": {

0 commit comments

Comments
 (0)