Skip to content

Commit f699dfc

Browse files
committed
Revert "Do not override HttpClient DI"
This reverts commit 70b7f42c48e6386674827077cd53c64a9d2884e5.
1 parent 6d2521f commit f699dfc

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/AbstractApi.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ public function __construct($configuration = [], ?CredentialProvider $credential
7474
$this->awsErrorFactory = $this->getAwsErrorFactory();
7575
if (!isset($httpClient)) {
7676
$httpClient = HttpClient::create();
77-
if (class_exists(RetryableHttpClient::class)) {
78-
/** @psalm-suppress MissingDependency */
79-
$httpClient = new RetryableHttpClient(
80-
$httpClient,
81-
new AwsRetryStrategy(AwsRetryStrategy::DEFAULT_RETRY_STATUS_CODES, 1000, 2.0, 0, 0.1, $this->awsErrorFactory),
82-
3,
83-
$this->logger
84-
);
85-
}
77+
}
78+
if (class_exists(RetryableHttpClient::class) && !$httpClient instanceof RetryableHttpClient) {
79+
/** @psalm-suppress MissingDependency */
80+
$httpClient = new RetryableHttpClient(
81+
$httpClient,
82+
new AwsRetryStrategy(AwsRetryStrategy::DEFAULT_RETRY_STATUS_CODES, 1000, 2.0, 0, 0.1, $this->awsErrorFactory),
83+
3,
84+
$this->logger
85+
);
8686
}
8787
$this->httpClient = $httpClient;
8888
$this->configuration = $configuration;

0 commit comments

Comments
 (0)