Skip to content

Commit

Permalink
[Notifier] fix PR checks
Browse files Browse the repository at this point in the history
  • Loading branch information
PEtanguy committed May 10, 2023
1 parent 85520f2 commit 9622d22
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected function doSend(MessageInterface $message): SentMessage

$sender = $message->getFrom() ?: $this->sender;

$response = $this->client->request('POST', 'https://' . $this->getEndpoint() . '/v3/transactionalSMS/sms', [
$response = $this->client->request('POST', 'https://'.$this->getEndpoint().'/v3/transactionalSMS/sms', [
'json' => [
'sender' => $sender,
'recipient' => $message->getPhone(),
Expand All @@ -77,12 +77,12 @@ protected function doSend(MessageInterface $message): SentMessage
if (201 !== $statusCode) {
$error = $response->toArray(false);

throw new TransportException('Unable to send the SMS: ' . $error['message'], $response);
throw new TransportException('Unable to send the SMS: '.$error['message'], $response);
}

$success = $response->toArray(false);

$sentMessage = new SentMessage($message, (string)$this);
$sentMessage = new SentMessage($message, (string) $this);
$sentMessage->setMessageId($success['messageId']);

return $sentMessage;
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Notifier/Bridge/Brevo/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2022-present Fabien Potencier
Copyright (c) 2023-present Fabien Potencier

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function testSendWithErrorResponseThrowsTransportException()
->method('getContent')
->willReturn(json_encode(['code' => 400, 'message' => 'bad request']));

$client = new MockHttpClient(static fn(): ResponseInterface => $response);
$client = new MockHttpClient(static fn (): ResponseInterface => $response);

$transport = self::createTransport($client);

Expand Down
64 changes: 31 additions & 33 deletions src/Symfony/Component/Notifier/Bridge/Brevo/composer.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,34 @@
{
"name": "symfony/brevo-notifier",
"type": "symfony-notifier-bridge",
"description": "Symfony Brevo Notifier Bridge",
"keywords": [
"brevo",
"notifier"
],
"homepage": "https://symfony.com",
"license": "MIT",
"authors": [
{
"name": "Pierre Tanguy",
"homepage": "https://github.com/petanguy"
"name": "symfony/brevo-notifier",
"type": "symfony-notifier-bridge",
"description": "Symfony Brevo Notifier Bridge",
"keywords": ["brevo", "notifier"],
"homepage": "https://symfony.com",
"license": "MIT",
"authors": [
{
"name": "Pierre Tanguy",
"homepage": "https://github.com/petanguy"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"require": {
"php": ">=8.1",
"symfony/http-client": "^5.4|^6.0",
"symfony/notifier": "^6.3"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"require": {
"php": ">=8.1",
"symfony/http-client": "^5.4|^6.0",
"symfony/notifier": "^6.3"
},
"require-dev": {
"symfony/event-dispatcher": "^5.4|^6.0"
},
"autoload": {
"psr-4": {"Symfony\\Component\\Notifier\\Bridge\\Brevo\\": ""},
"exclude-from-classmap": [
"/Tests/"
]
},
"minimum-stability": "dev"
"require-dev": {
"symfony/event-dispatcher": "^5.4|^6.0"
},
"autoload": {
"psr-4": {"Symfony\\Component\\Notifier\\Bridge\\Brevo\\": ""},
"exclude-from-classmap": [
"/Tests/"
]
},
"minimum-stability": "dev"
}

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
use Symfony\Component\Notifier\Bridge\Sendinblue\SendinblueTransportFactory;
use Symfony\Component\Notifier\Test\TransportFactoryTestCase;

/**
* @group legacy
*/
final class SendinblueTransportFactoryTest extends TransportFactoryTestCase
{
public function createFactory(): SendinblueTransportFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
use Symfony\Contracts\HttpClient\HttpClientInterface;
use Symfony\Contracts\HttpClient\ResponseInterface;

/**
* @group legacy
*/
final class SendinblueTransportTest extends TransportTestCase
{
public static function createTransport(HttpClientInterface $client = null): SendinblueTransport
Expand Down

0 comments on commit 9622d22

Please sign in to comment.