@@ -29,11 +29,11 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | private function writeJson(ResponseInterface $response, $payload, int $code = 200): ResponseInterface |
| 31 | 31 | { |
| 32 | - if ($payload instanceof JsonSerializable) { |
|
| 32 | + if ($payload instanceof JsonSerializable){ |
|
| 33 | 33 | $payload = $payload->jsonSerialize(); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - if (is_array($payload) && isset($payload['status']) && is_int($payload['status'])) { |
|
| 36 | + if (is_array($payload) && isset($payload['status']) && is_int($payload['status'])){ |
|
| 37 | 37 | $code = $payload['status']; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -29,11 +29,13 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | private function writeJson(ResponseInterface $response, $payload, int $code = 200): ResponseInterface |
| 31 | 31 | { |
| 32 | - if ($payload instanceof JsonSerializable) { |
|
| 32 | + if ($payload instanceof JsonSerializable) |
|
| 33 | + { |
|
| 33 | 34 | $payload = $payload->jsonSerialize(); |
| 34 | 35 | } |
| 35 | 36 | |
| 36 | - if (is_array($payload) && isset($payload['status']) && is_int($payload['status'])) { |
|
| 37 | + if (is_array($payload) && isset($payload['status']) && is_int($payload['status'])) |
|
| 38 | + { |
|
| 37 | 39 | $code = $payload['status']; |
| 38 | 40 | } |
| 39 | 41 | |
@@ -37,9 +37,9 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | public function render(MessageInterface $message): Email |
| 39 | 39 | { |
| 40 | - try { |
|
| 40 | + try{ |
|
| 41 | 41 | $view = $this->views->get($message->getSubject()); |
| 42 | - } catch (ViewException $e) { |
|
| 42 | + }catch (ViewException $e){ |
|
| 43 | 43 | throw new MailerException( |
| 44 | 44 | sprintf('Invalid email template `%s`: %s', $message->getSubject(), $e->getMessage()), |
| 45 | 45 | $e->getCode(), |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | $msg = new Email(); |
| 51 | 51 | |
| 52 | - if ($message->getFrom() !== null) { |
|
| 52 | + if ($message->getFrom() !== null){ |
|
| 53 | 53 | $msg->from([$message->getFrom()]); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -57,10 +57,10 @@ discard block |
||
| 57 | 57 | $msg->cc(...$message->getCC()); |
| 58 | 58 | $msg->bcc(...$message->getBCC()); |
| 59 | 59 | |
| 60 | - try { |
|
| 60 | + try{ |
|
| 61 | 61 | // render message partials |
| 62 | 62 | $view->render(array_merge(['_msg_' => $msg], $message->getData())); |
| 63 | - } catch (ViewException $e) { |
|
| 63 | + }catch (ViewException $e){ |
|
| 64 | 64 | throw new MailerException( |
| 65 | 65 | sprintf('Unable to render email `%s`: %s', $message->getSubject(), $e->getMessage()), |
| 66 | 66 | $e->getCode(), |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public static function escapeSubject(string $subject): string |
| 82 | 82 | { |
| 83 | - if (!preg_match('/[^\x20-\x7e]/', $subject)) { |
|
| 83 | + if (!preg_match('/[^\x20-\x7e]/', $subject)){ |
|
| 84 | 84 | // ascii-only subject, return as-is |
| 85 | 85 | return $subject; |
| 86 | 86 | } |
@@ -90,6 +90,6 @@ discard block |
||
| 90 | 90 | $prefix = '=?UTF-8?B?'; |
| 91 | 91 | $suffix = '?='; |
| 92 | 92 | |
| 93 | - return $prefix . str_replace("=\r\n", $suffix . "\r\n " . $prefix, $encoded) . $suffix; |
|
| 93 | + return $prefix.str_replace("=\r\n", $suffix."\r\n ".$prefix, $encoded).$suffix; |
|
| 94 | 94 | } |
| 95 | 95 | } |