Skip to content
This repository was archived by the owner on Jan 31, 2025. It is now read-only.
Open
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
7 changes: 5 additions & 2 deletions src/ClientBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ class ClientBuilder
public function __construct(
?HttpClient $httpClient = null,
?RequestFactory $requestFactory = null,
?UriFactoryInterface $uriFactory = null
?UriFactoryInterface $uriFactory = null,
?StreamFactoryInterface $streamFactory = null
) {
$this->httpClient = $httpClient ?? Psr18ClientDiscovery::find();
$this->requestFactory = $requestFactory ?? Psr17FactoryDiscovery::findRequestFactory();
$this->uriFactory = $uriFactory ?? Psr17FactoryDiscovery::findUriFactory();
$this->streamFactory = Psr17FactoryDiscovery::findStreamFactory();
}

public function createClientV1(string $token): Client
Expand Down Expand Up @@ -89,7 +91,8 @@ public function create(string $url, string $token): Client

$http = new HttpMethodsClient(
new PluginClient($this->httpClient, $plugins),
$this->requestFactory
$this->requestFactory,
$this->streamFactory
);

return new Client($http);
Expand Down