Skip to content

Commit 8cf7fda

Browse files
committed
[Mailer] fix PR tests
1 parent 8937020 commit 8cf7fda

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

src/Symfony/Component/Mailer/Bridge/Brevo/Tests/Transport/BrevoApiTransportTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class BrevoApiTransportTest extends TestCase
3131
*/
3232
public function testToString(BrevoApiTransport $transport, string $expected)
3333
{
34-
$this->assertSame($expected, (string)$transport);
34+
$this->assertSame($expected, (string) $transport);
3535
}
3636

3737
public static function getTransportData()

src/Symfony/Component/Mailer/Bridge/Brevo/Transport/BrevoApiTransport.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ public function __toString(): string
4848

4949
protected function doSendApi(SentMessage $sentMessage, Email $email, Envelope $envelope): ResponseInterface
5050
{
51-
// TODO check this
52-
$response = $this->client->request('POST', 'https://' . $this->getEndpoint() . '/v3/smtp/email', [
51+
$response = $this->client->request('POST', 'https://'.$this->getEndpoint().'/v3/smtp/email', [
5352
'json' => $this->getPayload($email, $envelope),
5453
'headers' => [
5554
'api-key' => $this->key,
@@ -60,13 +59,13 @@ protected function doSendApi(SentMessage $sentMessage, Email $email, Envelope $e
6059
$statusCode = $response->getStatusCode();
6160
$result = $response->toArray(false);
6261
} catch (DecodingExceptionInterface) {
63-
throw new HttpTransportException('Unable to send an email: ' . $response->getContent(false) . sprintf(' (code %d).', $statusCode), $response);
62+
throw new HttpTransportException('Unable to send an email: '.$response->getContent(false).sprintf(' (code %d).', $statusCode), $response);
6463
} catch (TransportExceptionInterface $e) {
6564
throw new HttpTransportException('Could not reach the remote Brevo server.', $response, 0, $e);
6665
}
6766

6867
if (201 !== $statusCode) {
69-
throw new HttpTransportException('Unable to send an email: ' . $result['message'] . sprintf(' (code %d).', $statusCode), $response);
68+
throw new HttpTransportException('Unable to send an email: '.$result['message'].sprintf(' (code %d).', $statusCode), $response);
7069
}
7170

7271
$sentMessage->setMessageId($result['messageId']);
@@ -153,7 +152,7 @@ private function prepareHeadersAndTags(Headers $headers): array
153152
continue;
154153
}
155154
if ('templateid' === $name) {
156-
$headersAndTags[$header->getName()] = (int)$header->getValue();
155+
$headersAndTags[$header->getName()] = (int) $header->getValue();
157156

158157
continue;
159158
}
@@ -181,7 +180,6 @@ private function stringifyAddress(Address $address): array
181180

182181
private function getEndpoint(): ?string
183182
{
184-
// TODO check this
185-
return ($this->host ?: 'api.brevo.com') . ($this->port ? ':' . $this->port : '');
183+
return ($this->host ?: 'api.brevo.com').($this->port ? ':'.$this->port : '');
186184
}
187185
}

src/Symfony/Component/Mailer/Bridge/Brevo/Transport/BrevoTransportFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function create(Dsn $dsn): TransportInterface
3737
return (new BrevoApiTransport($this->getUser($dsn), $this->client, $this->dispatcher, $this->logger))
3838
->setHost('default' === $dsn->getHost() ? null : $dsn->getHost())
3939
->setPort($dsn->getPort())
40-
;
40+
;
4141
}
4242

4343
return new $transport($this->getUser($dsn), $this->getPassword($dsn), $this->dispatcher, $this->logger);

src/Symfony/Component/Mailer/Bridge/Sendinblue/Transport/SendinblueTransportFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class SendinblueTransportFactory extends AbstractTransportFactory
2626
{
2727
public function create(Dsn $dsn): TransportInterface
2828
{
29-
trigger_deprecation('symfony/sendinblue-mailer', '6.3', 'The "%s" class is deprecated, use "%s" instead.', SendinblueTransportFactory::class, BrevoTransportFactory::class);
29+
trigger_deprecation('symfony/sendinblue-mailer', '6.3', 'The "%s" class is deprecated, use "%s" instead.', self::class, BrevoTransportFactory::class);
3030

3131
if (!\in_array($dsn->getScheme(), $this->getSupportedSchemes(), true)) {
3232
throw new UnsupportedSchemeException($dsn, 'sendinblue', $this->getSupportedSchemes());

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy