Skip to content

Commit d896b3a

Browse files
Resolve PR comments
1 parent e5100cc commit d896b3a

File tree

3 files changed

+5
-21
lines changed

3 files changed

+5
-21
lines changed

src/Symfony/Component/Mailer/Bridge/MicrosoftGraph/Transport/MicrosoftGraphApiTransport.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
class MicrosoftGraphApiTransport extends AbstractApiTransport
2828
{
29-
private const userEndpoint = '/v1.0/users/%s/sendMail';
29+
private const USER_ENDPOINT = '/v1.0/users/%s/sendMail';
3030

3131
/**
3232
* @param string $graphEndpoint Graph API URL to which to POST emails
@@ -50,7 +50,7 @@ public function __toString(): string
5050

5151
protected function doSendApi(SentMessage $sentMessage, Email $email, Envelope $envelope): ResponseInterface
5252
{
53-
$endpoint = "https://$this->graphEndpoint".\sprintf(self::userEndpoint, $envelope->getSender()->getAddress());
53+
$endpoint = "https://$this->graphEndpoint".\sprintf(self::USER_ENDPOINT, $envelope->getSender()->getAddress());
5454
$payload = $this->getPayload($email, $envelope);
5555

5656
$response = $this->client->request('POST', $endpoint, [

src/Symfony/Component/Mailer/Bridge/MicrosoftGraph/Transport/MicrosoftGraphTransportFactory.php

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,9 @@ public function create(Dsn $dsn): TransportInterface
4444
throw new IncompleteDsnException("Transport 'microsoft+graphapi' requires the 'authEndpoint' option when not using the default graph endpoint.");
4545
}
4646

47-
$tokenManager = new TokenManager(
48-
$graphEndpoint,
49-
$authEndpoint,
50-
$tenantId,
51-
$this->getUser($dsn),
52-
$this->getPassword($dsn),
53-
$this->client,
54-
);
47+
$tokenManager = new TokenManager($graphEndpoint, $authEndpoint, $tenantId, $this->getUser($dsn), $this->getPassword($dsn), $this->client);
5548

56-
return new MicrosoftGraphApiTransport(
57-
$graphEndpoint,
58-
$tokenManager,
59-
$dsn->getBooleanOption('noSave'),
60-
$this->client,
61-
$this->dispatcher,
62-
$this->logger,
63-
);
49+
return new MicrosoftGraphApiTransport($graphEndpoint, $tokenManager, $dsn->getBooleanOption('noSave'), $this->client, $this->dispatcher, $this->logger);
6450
}
6551

6652
protected function getSupportedSchemes(): array

src/Symfony/Component/Mailer/Bridge/MicrosoftGraph/composer.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@
2626
"require": {
2727
"php": ">=8.2",
2828
"symfony/clock": "^7.4|^8.0",
29+
"symfony/http-client": "^6.4|^7.0|^8.0",
2930
"symfony/mailer": "^7.4|^8.0"
3031
},
31-
"require-dev": {
32-
"symfony/http-client": "^6.4|^7.0|^8.0"
33-
},
3432
"autoload": {
3533
"psr-4": { "Symfony\\Component\\Mailer\\Bridge\\MicrosoftGraph\\": "" },
3634
"exclude-from-classmap": [

0 commit comments

Comments
 (0)