Passed
Push — master ( 3259b8...261523 )
by Aleksei
12:20
created
src/SendIt/src/Renderer/ViewRenderer.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 {
16 16
     public function __construct(
17 17
         private readonly ViewsInterface $views,
18
-    ) {}
18
+    ){}
19 19
 
20 20
     /**
21 21
      * Copy-pasted form https://stackoverflow.com/a/20806227
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      */
27 27
     public static function escapeSubject(string $subject): string
28 28
     {
29
-        if (!\preg_match('/[^\x20-\x7e]/', $subject)) {
29
+        if (!\preg_match('/[^\x20-\x7e]/', $subject)){
30 30
             // ascii-only subject, return as-is
31 31
             return $subject;
32 32
         }
@@ -36,14 +36,14 @@  discard block
 block discarded – undo
36 36
         $prefix = '=?UTF-8?B?';
37 37
         $suffix = '?=';
38 38
 
39
-        return $prefix . \str_replace("=\r\n", $suffix . "\r\n  " . $prefix, $encoded) . $suffix;
39
+        return $prefix.\str_replace("=\r\n", $suffix."\r\n  ".$prefix, $encoded).$suffix;
40 40
     }
41 41
 
42 42
     public function render(MessageInterface $message): Email
43 43
     {
44
-        try {
44
+        try{
45 45
             $view = $this->views->get($message->getSubject());
46
-        } catch (ViewException $e) {
46
+        }catch (ViewException $e){
47 47
             throw new MailerException(
48 48
                 \sprintf('Invalid email template `%s`: %s', $message->getSubject(), $e->getMessage()),
49 49
                 $e->getCode(),
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
 
54 54
         $msg = new Email();
55 55
 
56
-        if ($message->getFrom() !== null) {
56
+        if ($message->getFrom() !== null){
57 57
             $msg->from($message->getFrom());
58 58
         }
59 59
 
60
-        if ($message->getReplyTo() !== null) {
60
+        if ($message->getReplyTo() !== null){
61 61
             $msg->replyTo($message->getReplyTo());
62 62
         }
63 63
 
@@ -65,10 +65,10 @@  discard block
 block discarded – undo
65 65
         $msg->cc(...$message->getCC());
66 66
         $msg->bcc(...$message->getBCC());
67 67
 
68
-        try {
68
+        try{
69 69
             // render message partials
70 70
             $view->render(\array_merge(['_msg_' => $msg], $message->getData()));
71
-        } catch (ViewException $e) {
71
+        }catch (ViewException $e){
72 72
             throw new MailerException(
73 73
                 \sprintf('Unable to render email `%s`: %s', $message->getSubject(), $e->getMessage()),
74 74
                 $e->getCode(),
Please login to merge, or discard this patch.