@@ -104,16 +104,16 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | protected string $body = ''; |
| 106 | 106 | |
| 107 | - /** |
|
| 108 | - * The mail attachments |
|
| 109 | - * @var array<int, array<string, string>> |
|
| 110 | - */ |
|
| 107 | + /** |
|
| 108 | + * The mail attachments |
|
| 109 | + * @var array<int, array<string, string>> |
|
| 110 | + */ |
|
| 111 | 111 | protected array $attachments = []; |
| 112 | 112 | |
| 113 | - /** |
|
| 114 | - * The mail headers |
|
| 115 | - * @var array<string, mixed> |
|
| 116 | - */ |
|
| 113 | + /** |
|
| 114 | + * The mail headers |
|
| 115 | + * @var array<string, mixed> |
|
| 116 | + */ |
|
| 117 | 117 | protected array $headers = []; |
| 118 | 118 | |
| 119 | 119 | /** |
@@ -286,8 +286,8 @@ discard block |
||
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | /** |
| 289 | - * {@inheritedoc} |
|
| 290 | - */ |
|
| 289 | + * {@inheritedoc} |
|
| 290 | + */ |
|
| 291 | 291 | public function setReplyTo(string $email, ?string $name = null): self |
| 292 | 292 | { |
| 293 | 293 | $this->replyTo = $this->formatHeader($email, $name); |
@@ -461,17 +461,17 @@ discard block |
||
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | $this->addHeader('X-Priority', $this->priority) |
| 464 | - ->addHeader('X-Mailer', 'Platine PHP Mail') |
|
| 465 | - ->addHeader('Subject', $this->subject) |
|
| 466 | - ->addHeader('To', join(', ', $this->to)) |
|
| 467 | - ->addHeader('Date', date('r')); |
|
| 464 | + ->addHeader('X-Mailer', 'Platine PHP Mail') |
|
| 465 | + ->addHeader('Subject', $this->subject) |
|
| 466 | + ->addHeader('To', join(', ', $this->to)) |
|
| 467 | + ->addHeader('Date', date('r')); |
|
| 468 | 468 | |
| 469 | 469 | if ($this->hasAttachments()) { |
| 470 | 470 | $this->addHeader('MIME-Version', '1.0') |
| 471 | - ->addHeader( |
|
| 472 | - 'Content-Type', |
|
| 473 | - sprintf('multipart/mixed; boundary="%s"', $this->uid) |
|
| 474 | - ); |
|
| 471 | + ->addHeader( |
|
| 472 | + 'Content-Type', |
|
| 473 | + sprintf('multipart/mixed; boundary="%s"', $this->uid) |
|
| 474 | + ); |
|
| 475 | 475 | } |
| 476 | 476 | |
| 477 | 477 | return $this; |
@@ -573,7 +573,7 @@ discard block |
||
| 573 | 573 | protected function filterEmail(string $email): string |
| 574 | 574 | { |
| 575 | 575 | $rules = [ |
| 576 | - "\r" => '', |
|
| 576 | + "\r" => '', |
|
| 577 | 577 | "\n" => '', |
| 578 | 578 | "\t" => '', |
| 579 | 579 | '"' => '', |
@@ -596,7 +596,7 @@ discard block |
||
| 596 | 596 | protected function filterName(string $name): string |
| 597 | 597 | { |
| 598 | 598 | $rules = [ |
| 599 | - "\r" => '', |
|
| 599 | + "\r" => '', |
|
| 600 | 600 | "\n" => '', |
| 601 | 601 | "\t" => '', |
| 602 | 602 | '"' => "'", |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | $this->body = ''; |
| 157 | 157 | $this->attachments = []; |
| 158 | 158 | $this->headers = []; |
| 159 | - $this->uid = md5(uniqid((string)time())); |
|
| 159 | + $this->uid = md5(uniqid((string) time())); |
|
| 160 | 160 | $this->wrap = 70; |
| 161 | 161 | $this->priority = 3; |
| 162 | 162 | |
@@ -639,7 +639,7 @@ discard block |
||
| 639 | 639 | */ |
| 640 | 640 | protected function encodeUtf8(?string $value): string |
| 641 | 641 | { |
| 642 | - $value = trim((string)$value); |
|
| 642 | + $value = trim((string) $value); |
|
| 643 | 643 | if (preg_match('/(\s)/', $value)) { |
| 644 | 644 | return $this->encodeUtf8Words($value); |
| 645 | 645 | } |
@@ -54,8 +54,7 @@ discard block |
||
| 54 | 54 | * Class Message |
| 55 | 55 | * @package Platine\Mail |
| 56 | 56 | */ |
| 57 | -class Message implements MessageInterface |
|
| 58 | -{ |
|
| 57 | +class Message implements MessageInterface { |
|
| 59 | 58 | |
| 60 | 59 | /** |
| 61 | 60 | * End of line char |
@@ -137,8 +136,7 @@ discard block |
||
| 137 | 136 | /** |
| 138 | 137 | * Create new instance |
| 139 | 138 | */ |
| 140 | - public function __construct() |
|
| 141 | - { |
|
| 139 | + public function __construct() { |
|
| 142 | 140 | $this->reset(); |
| 143 | 141 | } |
| 144 | 142 | |
@@ -370,8 +368,7 @@ discard block |
||
| 370 | 368 | /** |
| 371 | 369 | * {@inheritedoc} |
| 372 | 370 | */ |
| 373 | - public function getHeader(string $name, $default = null) |
|
| 374 | - { |
|
| 371 | + public function getHeader(string $name, $default = null) { |
|
| 375 | 372 | $this->prepareHeaders(); |
| 376 | 373 | |
| 377 | 374 | return array_key_exists($name, $this->headers) |
@@ -55,8 +55,7 @@ discard block |
||
| 55 | 55 | * Class Mailer |
| 56 | 56 | * @package Platine\Mail |
| 57 | 57 | */ |
| 58 | -class Mailer |
|
| 59 | -{ |
|
| 58 | +class Mailer { |
|
| 60 | 59 | |
| 61 | 60 | /** |
| 62 | 61 | * The mail transport instance |
@@ -68,8 +67,7 @@ discard block |
||
| 68 | 67 | * Create new instance |
| 69 | 68 | * @param TransportInterface|null $transport |
| 70 | 69 | */ |
| 71 | - public function __construct(?TransportInterface $transport = null) |
|
| 72 | - { |
|
| 70 | + public function __construct(?TransportInterface $transport = null) { |
|
| 73 | 71 | $this->transport = $transport ? $transport : new NullTransport(); |
| 74 | 72 | } |
| 75 | 73 | |