Passed
Pull Request — master (#1233)
by
unknown
11:10
created
src/SendIt/src/Renderer/ViewRenderer.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     public function __construct(
20 20
         private readonly ViewsInterface $views,
21 21
         private readonly ?EventDispatcherInterface $eventDispatcher = null,
22
-    ) {}
22
+    ){}
23 23
 
24 24
     /**
25 25
      * Copy-pasted form https://stackoverflow.com/a/20806227
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      */
31 31
     public static function escapeSubject(string $subject): string
32 32
     {
33
-        if (!\preg_match('/[^\x20-\x7e]/', $subject)) {
33
+        if (!\preg_match('/[^\x20-\x7e]/', $subject)){
34 34
             // ascii-only subject, return as-is
35 35
             return $subject;
36 36
         }
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
         $prefix = '=?UTF-8?B?';
41 41
         $suffix = '?=';
42 42
 
43
-        return $prefix . \str_replace("=\r\n", $suffix . "\r\n  " . $prefix, $encoded) . $suffix;
43
+        return $prefix.\str_replace("=\r\n", $suffix."\r\n  ".$prefix, $encoded).$suffix;
44 44
     }
45 45
 
46 46
     public function render(MessageInterface $message): Email
47 47
     {
48
-        try {
48
+        try{
49 49
             $view = $this->views->get($message->getSubject());
50
-        } catch (ViewException $e) {
50
+        }catch (ViewException $e){
51 51
             throw new MailerException(
52 52
                 \sprintf('Invalid email template `%s`: %s', $message->getSubject(), $e->getMessage()),
53 53
                 $e->getCode(),
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
 
58 58
         $email = new Email();
59 59
 
60
-        if ($message->getFrom() !== null) {
60
+        if ($message->getFrom() !== null){
61 61
             $email->from($message->getFrom());
62 62
         }
63 63
 
64
-        if ($message->getReplyTo() !== null) {
64
+        if ($message->getReplyTo() !== null){
65 65
             $email->replyTo($message->getReplyTo());
66 66
         }
67 67
 
@@ -69,13 +69,13 @@  discard block
 block discarded – undo
69 69
         $email->cc(...$message->getCC());
70 70
         $email->bcc(...$message->getBCC());
71 71
 
72
-        try {
72
+        try{
73 73
             $cloneMessage = clone $message;
74 74
             $this->eventDispatcher?->dispatch(new PreRender(message: $cloneMessage, email: $email));
75 75
             // render message partials
76 76
             $view->render(\array_merge(['_msg_' => $email], $cloneMessage->getData()));
77 77
             $this->eventDispatcher?->dispatch(new PostRender(message: $cloneMessage, email: $email));
78
-        } catch (ViewException $e) {
78
+        }catch (ViewException $e){
79 79
             throw new MailerException(
80 80
                 \sprintf('Unable to render email `%s`: %s', $message->getSubject(), $e->getMessage()),
81 81
                 $e->getCode(),
Please login to merge, or discard this patch.
src/SendIt/src/Event/PostRender.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,5 +13,5 @@
 block discarded – undo
13 13
     public function __construct(
14 14
         public readonly MessageInterface $message,
15 15
         public readonly Email            $email,
16
-    ) {}
16
+    ){}
17 17
 }
Please login to merge, or discard this patch.
src/SendIt/src/Event/PreRender.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,5 +13,5 @@
 block discarded – undo
13 13
     public function __construct(
14 14
         public readonly MessageInterface $message,
15 15
         public readonly Email            $email,
16
-    ) {}
16
+    ){}
17 17
 }
Please login to merge, or discard this patch.