Skip to content

Commit abb899f

Browse files
committed
Style fix
1 parent 1cd588c commit abb899f

File tree

8 files changed

+51
-51
lines changed

8 files changed

+51
-51
lines changed

src/Domain/Messaging/Exception/InvalidContextTypeException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ class InvalidContextTypeException extends LogicException
1010
{
1111
public function __construct(string $type)
1212
{
13-
parent::__construct("Invalid context type: $type");
13+
parent::__construct('Invalid context type: ' . $type);
1414
}
1515
}

src/Domain/Messaging/Exception/InvalidDtoTypeException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ class InvalidDtoTypeException extends LogicException
1010
{
1111
public function __construct(string $type)
1212
{
13-
parent::__construct("Invalid dto type: $type");
13+
parent::__construct('Invalid dto type: ' . $type);
1414
}
1515
}

src/Domain/Messaging/MessageHandler/PasswordResetMessageHandler.php

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,36 +32,30 @@ public function __invoke(PasswordResetMessage $message): void
3232
$confirmationLink = $this->generateLink($message->getToken());
3333

3434
$subject = $this->translator->trans('Password Reset Request');
35+
3536
$textContent = $this->translator->trans(
36-
<<<TXT
37-
Hello,
38-
39-
A password reset has been requested for your account.
40-
Please use the following token to reset your password:
41-
42-
%token%
43-
44-
If you did not request this password reset, please ignore this email.
45-
46-
Thank you.
47-
TXT,
37+
"Hello,\n\n" .
38+
"A password reset has been requested for your account.\n" .
39+
"Please use the following token to reset your password:\n\n" .
40+
"%token%\n\n" .
41+
"If you did not request this password reset, please ignore this email.\n\n" .
42+
'Thank you.',
4843
['%token%' => $message->getToken()]
4944
);
5045

5146
$htmlContent = $this->translator->trans(
52-
<<<HTML
53-
<p>Password Reset Request!</p>
54-
<p>Hello! A password reset has been requested for your account.</p>
55-
<p>Please use the following token to reset your password:</p>
56-
<p><a href="%confirmation_link%">Reset Password</a></p>
57-
<p>If you did not request this password reset, please ignore this email.</p>
58-
<p>Thank you.</p>
59-
HTML,
47+
'<p>Password Reset Request!</p>' .
48+
'<p>Hello! A password reset has been requested for your account.</p>' .
49+
'<p>Please use the following token to reset your password:</p>' .
50+
'<p><a href="%confirmation_link%">Reset Password</a></p>' .
51+
'<p>If you did not request this password reset, please ignore this email.</p>' .
52+
'<p>Thank you.</p>',
6053
[
6154
'%confirmation_link%' => $confirmationLink,
6255
]
6356
);
6457

58+
6559
$email = (new Email())
6660
->to($message->getEmail())
6761
->subject($subject)

src/Domain/Messaging/MessageHandler/SubscriberConfirmationMessageHandler.php

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,10 @@ public function __invoke(SubscriberConfirmationMessage $message): void
3737
$subject = $this->translator->trans('Please confirm your subscription');
3838

3939
$textContent = $this->translator->trans(
40-
<<<TXT
41-
Thank you for subscribing!
42-
43-
Please confirm your subscription by clicking the link below:
44-
45-
%confirmation_link%
46-
47-
If you did not request this subscription, please ignore this email.
48-
TXT,
40+
"Thank you for subscribing!\n\n" .
41+
"Please confirm your subscription by clicking the link below:\n\n" .
42+
"%confirmation_link%\n\n" .
43+
'If you did not request this subscription, please ignore this email.',
4944
[
5045
'%confirmation_link%' => $confirmationLink
5146
]
@@ -54,12 +49,10 @@ public function __invoke(SubscriberConfirmationMessage $message): void
5449
$htmlContent = '';
5550
if ($message->hasHtmlEmail()) {
5651
$htmlContent = $this->translator->trans(
57-
<<<HTML
58-
<p>Thank you for subscribing!</p>
59-
<p>Please confirm your subscription by clicking the link below:</p>
60-
<p><a href="%confirmation_link%">Confirm Subscription</a></p>
61-
<p>If you did not request this subscription, please ignore this email.</p>
62-
HTML,
52+
'<p>Thank you for subscribing!</p>' .
53+
'<p>Please confirm your subscription by clicking the link below:</p>' .
54+
'<p><a href="%confirmation_link%">Confirm Subscription</a></p>' .
55+
'<p>If you did not request this subscription, please ignore this email.</p>',
6356
[
6457
'%confirmation_link%' => $confirmationLink,
6558
]

src/Domain/Messaging/Service/Processor/AdvancedBounceRulesProcessor.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,18 @@ public function process(SymfonyStyle $io, int $batchSize): void
7373
}
7474

7575
$io->writeln($this->translator->trans(
76-
'Processed %processed% out of %total% bounces for advanced bounce rules', [
77-
'%processed%' => min($processed, $total),
78-
'%total%' => $total,
79-
]
76+
'Processed %processed% out of %total% bounces for advanced bounce rules',
77+
['%processed%' => min($processed, $total), '%total%' => $total]
8078
));
8179
}
8280

8381
$io->writeln($this->translator->trans(
84-
'%processed% bounces processed by advanced processing', ['%processed%' => $matched]
82+
'%processed% bounces processed by advanced processing',
83+
['%processed%' => $matched]
8584
));
8685
$io->writeln($this->translator->trans(
87-
'%not_processed% bounces were not matched by advanced processing rules', ['%not_processed%' => $notMatched]
86+
'%not_processed% bounces were not matched by advanced processing rules',
87+
['%not_processed%' => $notMatched]
8888
));
8989
}
9090

src/Domain/Messaging/Service/Processor/BounceDataProcessor.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ public function process(Bounce $bounce, ?string $msgId, ?int $userId, DateTimeIm
5353
}
5454

5555
if ($msgId && $userId) {
56-
return $this->handleKnownMessageAndUser(bounce: $bounce, date: $bounceDate, msgId: (int)$msgId, userId: $userId);
56+
return $this->handleKnownMessageAndUser(
57+
bounce: $bounce,
58+
date: $bounceDate,
59+
msgId: (int)$msgId,
60+
userId: $userId
61+
);
5762
}
5863

5964
if ($userId) {
@@ -64,7 +69,11 @@ public function process(Bounce $bounce, ?string $msgId, ?int $userId, DateTimeIm
6469
return $this->handleMessageOnly(bounce: $bounce, msgId: (int)$msgId);
6570
}
6671

67-
$this->bounceManager->update(bounce: $bounce, status: BounceStatus::UnidentifiedBounce->value, comment: 'not processed');
72+
$this->bounceManager->update(
73+
bounce: $bounce,
74+
status: BounceStatus::UnidentifiedBounce->value,
75+
comment: 'not processed'
76+
);
6877

6978
return false;
7079
}

src/Domain/Messaging/Service/Processor/UnidentifiedBounceReprocessor.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,8 @@ public function process(SymfonyStyle $inputOutput): void
7272
'%total%' => $total
7373
]));
7474
$inputOutput->writeln($this->translator->trans(
75-
'%reparsed% bounces were re-processed and %reidentified% bounces were re-identified', [
76-
'%reparsed%' => $reparsed,
77-
'%reidentified%' => $reidentified,
78-
]
75+
'%reparsed% bounces were re-processed and %reidentified% bounces were re-identified',
76+
['%reparsed%' => $reparsed, '%reidentified%' => $reidentified]
7977
));
8078
}
8179
}

tests/Unit/Domain/Messaging/Service/Processor/MboxBounceProcessorTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,14 @@ public function testProcessSuccess(): void
6565
['mailbox', '/var/mail/bounce.mbox'],
6666
]);
6767

68-
$this->io->expects($this->once())->method('section')->with($translator->trans('Opening mbox %file%', ['%file%' => '/var/mail/bounce.mbox']));
69-
$this->io->expects($this->once())->method('writeln')->with($translator->trans('Please do not interrupt this process'));
68+
$this->io
69+
->expects($this->once())
70+
->method('section')
71+
->with($translator->trans('Opening mbox %file%', ['%file%' => '/var/mail/bounce.mbox']));
72+
$this->io
73+
->expects($this->once())
74+
->method('writeln')
75+
->with($translator->trans('Please do not interrupt this process'));
7076

7177
$this->service->expects($this->once())
7278
->method('processMailbox')

0 commit comments

Comments
 (0)