Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Symfony/Component/HttpClient/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ CHANGELOG

* Make `HttplugClient` implement `Psr\Http\Message\RequestFactoryInterface`, `StreamFactoryInterface` and `UriFactoryInterface`
* Deprecate implementing `Http\Message\RequestFactory`, `StreamFactory` and `UriFactory` on `HttplugClient`
* Add `withOptions()` to `HttplugClient` and `Psr18Client`

6.1
---
Expand Down
8 changes: 8 additions & 0 deletions src/Symfony/Component/HttpClient/HttplugClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ public function __construct(HttpClientInterface $client = null, ResponseFactoryI
$this->waitLoop = new HttplugWaitLoop($this->client, $this->promisePool, $this->responseFactory, $this->streamFactory);
}

public function withOptions(array $options): static
{
$clone = clone $this;
$clone->client = $clone->client->withOptions($options);

return $clone;
}

public function sendRequest(RequestInterface $request): Psr7ResponseInterface
{
try {
Expand Down
8 changes: 8 additions & 0 deletions src/Symfony/Component/HttpClient/Psr18Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ public function __construct(HttpClientInterface $client = null, ResponseFactoryI
$this->streamFactory = $streamFactory;
}

public function withOptions(array $options): static
{
$clone = clone $this;
$clone->client = $clone->client->withOptions($options);

return $clone;
}

public function sendRequest(RequestInterface $request): ResponseInterface
{
try {
Expand Down