Skip to content

Commit 6d2521f

Browse files
committed
Do not override HttpClient DI
1 parent 3c0de4a commit 6d2521f

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-
}
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-
);
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+
}
8686
}
8787
$this->httpClient = $httpClient;
8888
$this->configuration = $configuration;

0 commit comments

Comments
 (0)