@@ -56,15 +56,19 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | $email = $this->renderer->render($message); |
| 58 | 58 | |
| 59 | - if ($email->getFrom() === []) { |
|
| 59 | + if ($email->getFrom() === []) |
|
| 60 | + { |
|
| 60 | 61 | $email->from(Address::create($this->config->getFromAddress())); |
| 61 | 62 | } |
| 62 | 63 | |
| 63 | 64 | $recipients = $this->getRecipients($email); |
| 64 | 65 | |
| 65 | - try { |
|
| 66 | + try |
|
| 67 | + { |
|
| 66 | 68 | $this->mailer->send($email); |
| 67 | - } catch (TransportExceptionInterface $e) { |
|
| 69 | + } |
|
| 70 | + catch (TransportExceptionInterface $e) |
|
| 71 | + { |
|
| 68 | 72 | $this->getLogger()->error( |
| 69 | 73 | sprintf( |
| 70 | 74 | 'Failed to send `%s` to "%s": %s', |
@@ -98,7 +102,8 @@ discard block |
||
| 98 | 102 | |
| 99 | 103 | $addresses = array_merge($message->getTo(), $message->getCc(), $message->getBcc()); |
| 100 | 104 | |
| 101 | - foreach ($addresses as $address) { |
|
| 105 | + foreach ($addresses as $address) |
|
| 106 | + { |
|
| 102 | 107 | $emails[] = $address->toString(); |
| 103 | 108 | } |
| 104 | 109 | |
@@ -7,7 +7,8 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | $_msg_->subject(\Spiral\SendIt\Renderer\ViewRenderer::escapeSubject(inject('subject'))); |
| 9 | 9 | |
| 10 | -if (injected('from')) { |
|
| 10 | +if (injected('from')) |
|
| 11 | +{ |
|
| 11 | 12 | $_msg_->from(\Symfony\Component\Mime\Address::create(inject('from'))); |
| 12 | 13 | } |
| 13 | 14 | |
@@ -19,13 +20,15 @@ discard block |
||
| 19 | 20 | |
| 20 | 21 | ob_start(); ?>${html}<?php $_html_ = ob_get_clean(); |
| 21 | 22 | |
| 22 | -if (!empty($_html_)) { |
|
| 23 | +if (!empty($_html_)) |
|
| 24 | +{ |
|
| 23 | 25 | $_msg_->html($_html_); |
| 24 | 26 | } |
| 25 | 27 | |
| 26 | 28 | ob_start(); ?>${text}<?php $_text_ = ob_get_clean(); |
| 27 | 29 | |
| 28 | -if (!empty($_text_)) { |
|
| 30 | +if (!empty($_text_)) |
|
| 31 | +{ |
|
| 29 | 32 | $_msg_->text($_text_); |
| 30 | 33 | } |
| 31 | 34 | ?> |
@@ -203,7 +203,8 @@ discard block |
||
| 203 | 203 | { |
| 204 | 204 | $checker = new DatetimeChecker(); |
| 205 | 205 | |
| 206 | - foreach (\DateTimeZone::listIdentifiers() as $identifier) { |
|
| 206 | + foreach (\DateTimeZone::listIdentifiers() as $identifier) |
|
| 207 | + { |
|
| 207 | 208 | $this->assertTrue($checker->timezone($identifier)); |
| 208 | 209 | $this->assertFalse($checker->timezone(str_rot13($identifier))); |
| 209 | 210 | } |
@@ -338,21 +339,24 @@ discard block |
||
| 338 | 339 | |
| 339 | 340 | private function now(): \Closure |
| 340 | 341 | { |
| 341 | - return static function () { |
|
| 342 | + return static function () |
|
| 343 | + { |
|
| 342 | 344 | return \time(); |
| 343 | 345 | }; |
| 344 | 346 | } |
| 345 | 347 | |
| 346 | 348 | private function inFuture(int $seconds): \Closure |
| 347 | 349 | { |
| 348 | - return static function () use ($seconds) { |
|
| 350 | + return static function () use ($seconds) |
|
| 351 | + { |
|
| 349 | 352 | return \time() + $seconds; |
| 350 | 353 | }; |
| 351 | 354 | } |
| 352 | 355 | |
| 353 | 356 | private function inPast(int $seconds): \Closure |
| 354 | 357 | { |
| 355 | - return static function () use ($seconds) { |
|
| 358 | + return static function () use ($seconds) |
|
| 359 | + { |
|
| 356 | 360 | return \time() - $seconds; |
| 357 | 361 | }; |
| 358 | 362 | } |