Skip to content

Commit d0887a3

Browse files
minor #53230 [Notifier] [Bridges] Use CPP (OskarStark)
This PR was squashed before being merged into the 7.1 branch. Discussion ---------- [Notifier] [Bridges] Use CPP | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT Commits ------- a7deb7a [Notifier] [Bridges] Use CPP
2 parents 13b3f12 + a7deb7a commit d0887a3

File tree

77 files changed

+397
-490
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+397
-490
lines changed

src/Symfony/Component/Notifier/Bridge/AllMySms/AllMySmsTransport.php

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,13 @@ final class AllMySmsTransport extends AbstractTransport
2828
{
2929
protected const HOST = 'api.allmysms.com';
3030

31-
private string $login;
32-
private string $apiKey;
33-
private ?string $from;
34-
35-
public function __construct(string $login, #[\SensitiveParameter] string $apiKey, string $from = null, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)
36-
{
37-
$this->login = $login;
38-
$this->apiKey = $apiKey;
39-
$this->from = $from;
40-
31+
public function __construct(
32+
private string $login,
33+
#[\SensitiveParameter] private string $apiKey,
34+
private ?string $from = null,
35+
HttpClientInterface $client = null,
36+
EventDispatcherInterface $dispatcher = null,
37+
) {
4138
parent::__construct($client, $dispatcher);
4239
}
4340

src/Symfony/Component/Notifier/Bridge/AmazonSns/AmazonSnsTransport.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
*/
2929
final class AmazonSnsTransport extends AbstractTransport
3030
{
31-
private SnsClient $snsClient;
32-
33-
public function __construct(SnsClient $snsClient, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)
34-
{
35-
$this->snsClient = $snsClient;
31+
public function __construct(
32+
private SnsClient $snsClient,
33+
HttpClientInterface $client = null,
34+
EventDispatcherInterface $dispatcher = null,
35+
) {
3636
parent::__construct($client, $dispatcher);
3737
}
3838

src/Symfony/Component/Notifier/Bridge/Bandwidth/BandwidthTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct(
3737
private readonly string $applicationId,
3838
private readonly ?string $priority,
3939
HttpClientInterface $client = null,
40-
EventDispatcherInterface $dispatcher = null
40+
EventDispatcherInterface $dispatcher = null,
4141
) {
4242
parent::__construct($client, $dispatcher);
4343
}

src/Symfony/Component/Notifier/Bridge/Bluesky/BlueskyTransport.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ final class BlueskyTransport extends AbstractTransport
3333
private array $authSession = [];
3434

3535
public function __construct(
36-
#[\SensitiveParameter]
37-
private string $user,
38-
#[\SensitiveParameter]
39-
private string $password,
36+
#[\SensitiveParameter] private string $user,
37+
#[\SensitiveParameter] private string $password,
4038
private LoggerInterface $logger,
4139
HttpClientInterface $client = null,
4240
EventDispatcherInterface $dispatcher = null,

src/Symfony/Component/Notifier/Bridge/Brevo/BrevoTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct(
3232
#[\SensitiveParameter] private readonly string $apiKey,
3333
private readonly string $sender,
3434
HttpClientInterface $client = null,
35-
EventDispatcherInterface $dispatcher = null
35+
EventDispatcherInterface $dispatcher = null,
3636
) {
3737
parent::__construct($client, $dispatcher);
3838
}

src/Symfony/Component/Notifier/Bridge/Chatwork/ChatworkTransport.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,12 @@ class ChatworkTransport extends AbstractTransport
2828
{
2929
protected const HOST = 'api.chatwork.com';
3030

31-
private string $apiToken;
32-
private string $roomId;
33-
34-
public function __construct(#[\SensitiveParameter] string $apiToken, string $roomId, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)
35-
{
36-
$this->apiToken = $apiToken;
37-
$this->roomId = $roomId;
31+
public function __construct(
32+
#[\SensitiveParameter] private string $apiToken,
33+
private string $roomId,
34+
HttpClientInterface $client = null,
35+
EventDispatcherInterface $dispatcher = null,
36+
) {
3837
parent::__construct($client, $dispatcher);
3938
}
4039

src/Symfony/Component/Notifier/Bridge/ClickSend/ClickSendTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct(
3737
private readonly ?string $listId = null,
3838
private readonly ?string $fromEmail = null,
3939
HttpClientInterface $client = null,
40-
EventDispatcherInterface $dispatcher = null
40+
EventDispatcherInterface $dispatcher = null,
4141
) {
4242
parent::__construct($client, $dispatcher);
4343
}

src/Symfony/Component/Notifier/Bridge/Clickatell/ClickatellTransport.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,12 @@ final class ClickatellTransport extends AbstractTransport
2828
{
2929
protected const HOST = 'api.clickatell.com';
3030

31-
private string $authToken;
32-
private ?string $from;
33-
34-
public function __construct(#[\SensitiveParameter] string $authToken, string $from = null, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)
35-
{
36-
$this->authToken = $authToken;
37-
$this->from = $from;
38-
31+
public function __construct(
32+
#[\SensitiveParameter] private string $authToken,
33+
private ?string $from = null,
34+
HttpClientInterface $client = null,
35+
EventDispatcherInterface $dispatcher = null,
36+
) {
3937
parent::__construct($client, $dispatcher);
4038
}
4139

src/Symfony/Component/Notifier/Bridge/ContactEveryone/ContactEveryoneTransport.php

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,13 @@ final class ContactEveryoneTransport extends AbstractTransport
2929
{
3030
protected const HOST = 'contact-everyone.orange-business.com';
3131

32-
private string $token;
33-
private ?string $diffusionName;
34-
private ?string $category;
35-
36-
public function __construct(#[\SensitiveParameter] string $token, ?string $diffusionName, ?string $category, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)
37-
{
38-
$this->token = $token;
39-
$this->diffusionName = $diffusionName;
40-
$this->category = $category;
41-
32+
public function __construct(
33+
#[\SensitiveParameter] private string $token,
34+
private ?string $diffusionName,
35+
private ?string $category,
36+
HttpClientInterface $client = null,
37+
EventDispatcherInterface $dispatcher = null,
38+
) {
4239
parent::__construct($client, $dispatcher);
4340
}
4441

src/Symfony/Component/Notifier/Bridge/Discord/DiscordTransport.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,12 @@ final class DiscordTransport extends AbstractTransport
3131

3232
private const SUBJECT_LIMIT = 2000;
3333

34-
private string $token;
35-
private string $webhookId;
36-
37-
public function __construct(#[\SensitiveParameter] string $token, string $webhookId, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)
38-
{
39-
$this->token = $token;
40-
$this->webhookId = $webhookId;
41-
$this->client = $client;
42-
34+
public function __construct(
35+
#[\SensitiveParameter] private string $token,
36+
private string $webhookId,
37+
HttpClientInterface $client = null,
38+
EventDispatcherInterface $dispatcher = null,
39+
) {
4340
parent::__construct($client, $dispatcher);
4441
}
4542

src/Symfony/Component/Notifier/Bridge/Engagespot/EngagespotTransport.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,12 @@ final class EngagespotTransport extends AbstractTransport
2929
{
3030
protected const HOST = 'api.engagespot.co/2/campaigns';
3131

32-
private string $apiKey;
33-
private string $campaignName;
34-
35-
public function __construct(#[\SensitiveParameter] string $apiKey, string $campaignName, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)
36-
{
37-
$this->apiKey = $apiKey;
38-
$this->campaignName = $campaignName;
39-
$this->client = $client;
40-
32+
public function __construct(
33+
#[\SensitiveParameter] private string $apiKey,
34+
private string $campaignName,
35+
HttpClientInterface $client = null,
36+
EventDispatcherInterface $dispatcher = null,
37+
) {
4138
parent::__construct($client, $dispatcher);
4239
}
4340

src/Symfony/Component/Notifier/Bridge/Esendex/EsendexTransport.php

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,14 @@ final class EsendexTransport extends AbstractTransport
2626
{
2727
protected const HOST = 'api.esendex.com';
2828

29-
private string $email;
30-
private string $password;
31-
private string $accountReference;
32-
private string $from;
33-
34-
public function __construct(string $email, #[\SensitiveParameter] string $password, string $accountReference, string $from, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)
35-
{
36-
$this->email = $email;
37-
$this->password = $password;
38-
$this->accountReference = $accountReference;
39-
$this->from = $from;
40-
29+
public function __construct(
30+
private string $email,
31+
#[\SensitiveParameter] private string $password,
32+
private string $accountReference,
33+
private string $from,
34+
HttpClientInterface $client = null,
35+
EventDispatcherInterface $dispatcher = null,
36+
) {
4137
parent::__construct($client, $dispatcher);
4238
}
4339

src/Symfony/Component/Notifier/Bridge/Expo/ExpoTransport.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,11 @@ final class ExpoTransport extends AbstractTransport
2929
{
3030
protected const HOST = 'exp.host/--/api/v2/push/send';
3131

32-
private ?string $token;
33-
34-
public function __construct(#[\SensitiveParameter] string $token = null, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)
35-
{
36-
$this->token = $token;
37-
$this->client = $client;
38-
32+
public function __construct(
33+
#[\SensitiveParameter] private ?string $token = null,
34+
HttpClientInterface $client = null,
35+
EventDispatcherInterface $dispatcher = null,
36+
) {
3937
parent::__construct($client, $dispatcher);
4038
}
4139

src/Symfony/Component/Notifier/Bridge/Expo/ExpoTransportFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function create(Dsn $dsn): ExpoTransport
2828
throw new UnsupportedSchemeException($dsn, 'expo', $this->getSupportedSchemes());
2929
}
3030

31-
$token = $dsn->getUser($dsn);
31+
$token = $dsn->getUser();
3232
$host = 'default' === $dsn->getHost() ? null : $dsn->getHost();
3333
$port = $dsn->getPort();
3434

src/Symfony/Component/Notifier/Bridge/FakeChat/FakeChatLoggerTransport.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,11 @@ final class FakeChatLoggerTransport extends AbstractTransport
2727
{
2828
protected const HOST = 'default';
2929

30-
private LoggerInterface $logger;
31-
32-
public function __construct(LoggerInterface $logger, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)
33-
{
34-
$this->logger = $logger;
35-
30+
public function __construct(
31+
private LoggerInterface $logger,
32+
HttpClientInterface $client = null,
33+
EventDispatcherInterface $dispatcher = null,
34+
) {
3635
parent::__construct($client, $dispatcher);
3736
}
3837

src/Symfony/Component/Notifier/Bridge/FakeSms/FakeSmsLoggerTransport.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,11 @@ final class FakeSmsLoggerTransport extends AbstractTransport
2727
{
2828
protected const HOST = 'default';
2929

30-
private LoggerInterface $logger;
31-
32-
public function __construct(LoggerInterface $logger, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)
33-
{
34-
$this->logger = $logger;
35-
30+
public function __construct(
31+
private LoggerInterface $logger,
32+
HttpClientInterface $client = null,
33+
EventDispatcherInterface $dispatcher = null,
34+
) {
3635
parent::__construct($client, $dispatcher);
3736
}
3837

src/Symfony/Component/Notifier/Bridge/Firebase/FirebaseTransport.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,11 @@ final class FirebaseTransport extends AbstractTransport
2929
{
3030
protected const HOST = 'fcm.googleapis.com/fcm/send';
3131

32-
private string $token;
33-
34-
public function __construct(#[\SensitiveParameter] string $token, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)
35-
{
36-
$this->token = $token;
37-
$this->client = $client;
38-
32+
public function __construct(
33+
#[\SensitiveParameter] private string $token,
34+
HttpClientInterface $client = null,
35+
EventDispatcherInterface $dispatcher = null,
36+
) {
3937
parent::__construct($client, $dispatcher);
4038
}
4139

src/Symfony/Component/Notifier/Bridge/FortySixElks/FortySixElksTransport.php

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,13 @@ final class FortySixElksTransport extends AbstractTransport
2828
{
2929
protected const HOST = 'api.46elks.com';
3030

31-
private string $apiUsername;
32-
private string $apiPassword;
33-
private string $from;
34-
35-
public function __construct(string $apiUsername, #[\SensitiveParameter] string $apiPassword, string $from, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)
36-
{
37-
$this->apiUsername = $apiUsername;
38-
$this->apiPassword = $apiPassword;
39-
$this->from = $from;
40-
31+
public function __construct(
32+
private string $apiUsername,
33+
#[\SensitiveParameter] private string $apiPassword,
34+
private string $from,
35+
HttpClientInterface $client = null,
36+
EventDispatcherInterface $dispatcher = null,
37+
) {
4138
parent::__construct($client, $dispatcher);
4239
}
4340

src/Symfony/Component/Notifier/Bridge/FreeMobile/FreeMobileTransport.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,13 @@ final class FreeMobileTransport extends AbstractTransport
2929
{
3030
protected const HOST = 'smsapi.free-mobile.fr/sendmsg';
3131

32-
private string $login;
33-
private string $password;
34-
private string $phone;
35-
36-
public function __construct(string $login, #[\SensitiveParameter] string $password, string $phone, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)
37-
{
38-
$this->login = $login;
39-
$this->password = $password;
32+
public function __construct(
33+
private string $login,
34+
#[\SensitiveParameter] private string $password,
35+
private string $phone,
36+
HttpClientInterface $client = null,
37+
EventDispatcherInterface $dispatcher = null,
38+
) {
4039
$this->phone = str_replace('+33', '0', $phone);
4140

4241
parent::__construct($client, $dispatcher);

src/Symfony/Component/Notifier/Bridge/GatewayApi/GatewayApiTransport.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,12 @@ final class GatewayApiTransport extends AbstractTransport
2828
{
2929
protected const HOST = 'gatewayapi.com';
3030

31-
private string $authToken;
32-
private string $from;
33-
34-
public function __construct(#[\SensitiveParameter] string $authToken, string $from, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)
35-
{
36-
$this->authToken = $authToken;
37-
$this->from = $from;
38-
31+
public function __construct(
32+
#[\SensitiveParameter] private string $authToken,
33+
private string $from,
34+
HttpClientInterface $client = null,
35+
EventDispatcherInterface $dispatcher = null,
36+
) {
3937
parent::__construct($client, $dispatcher);
4038
}
4139

src/Symfony/Component/Notifier/Bridge/Gitter/GitterTransport.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,12 @@ final class GitterTransport extends AbstractTransport
2828
{
2929
protected const HOST = 'api.gitter.im';
3030

31-
private string $token;
32-
private string $roomId;
33-
34-
public function __construct(#[\SensitiveParameter] string $token, string $roomId, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)
35-
{
36-
$this->token = $token;
37-
$this->roomId = $roomId;
38-
31+
public function __construct(
32+
#[\SensitiveParameter] private string $token,
33+
private string $roomId,
34+
HttpClientInterface $client = null,
35+
EventDispatcherInterface $dispatcher = null,
36+
) {
3937
parent::__construct($client, $dispatcher);
4038
}
4139

0 commit comments

Comments
 (0)