Skip to content

Commit 82b5e7c

Browse files
committed
Fix compatibility with async-core 0.5
1 parent a5cd6b7 commit 82b5e7c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/Symfony/Component/Mailer/Bridge/Amazon/Transport/SesApiAsyncAwsTransport.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Mailer\Bridge\Amazon\Transport;
1313

14+
use AsyncAws\Core\Configuration;
1415
use AsyncAws\Ses\Input\SendEmailRequest;
1516
use AsyncAws\Ses\ValueObject\Content;
1617
use Symfony\Component\Mailer\Envelope;
@@ -28,8 +29,8 @@ class SesApiAsyncAwsTransport extends SesHttpAsyncAwsTransport
2829
public function __toString(): string
2930
{
3031
$configuration = $this->sesClient->getConfiguration();
31-
if (!$configuration->isDefault('endpoint')) {
32-
$endpoint = parse_url($configuration->get('endpoint'));
32+
if (($endpoint = $configuration->get('endpoint')) === (new Configuration())->get('endpoint')) {
33+
$endpoint = parse_url($endpoint);
3334
$host = $endpoint['host'].($endpoint['port'] ?? null ? ':'.$endpoint['port'] : '');
3435
} else {
3536
$host = $configuration->get('region');

src/Symfony/Component/Mailer/Bridge/Amazon/Transport/SesHttpAsyncAwsTransport.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Mailer\Bridge\Amazon\Transport;
1313

14+
use AsyncAws\Core\Configuration;
1415
use AsyncAws\Core\Exception\Http\HttpException;
1516
use AsyncAws\Ses\Input\SendEmailRequest;
1617
use AsyncAws\Ses\SesClient;
@@ -39,8 +40,8 @@ public function __construct(SesClient $sesClient, EventDispatcherInterface $disp
3940
public function __toString(): string
4041
{
4142
$configuration = $this->sesClient->getConfiguration();
42-
if (!$configuration->isDefault('endpoint')) {
43-
$endpoint = parse_url($configuration->get('endpoint'));
43+
if (($endpoint = $configuration->get('endpoint')) === (new Configuration())->get('endpoint')) {
44+
$endpoint = parse_url($endpoint);
4445
$host = $endpoint['host'].($endpoint['port'] ?? null ? ':'.$endpoint['port'] : '');
4546
} else {
4647
$host = $configuration->get('region');

0 commit comments

Comments
 (0)