@@ -86,7 +86,7 @@ |
||
86 | 86 | )); |
87 | 87 | } |
88 | 88 | |
89 | - $content = (string)$message; |
|
89 | + $content = (string) $message; |
|
90 | 90 | $file = $this->path . date('YmdHis') . '-' . md5(uniqid()) . '.txt'; |
91 | 91 | if (!file_put_contents($file, $content)) { |
92 | 92 | throw new FileTransportException(sprintf( |
@@ -55,8 +55,7 @@ discard block |
||
55 | 55 | * Class File |
56 | 56 | * @package Platine\Mail\Transport |
57 | 57 | */ |
58 | -class File implements TransportInterface |
|
59 | -{ |
|
58 | +class File implements TransportInterface { |
|
60 | 59 | |
61 | 60 | /** |
62 | 61 | * |
@@ -68,8 +67,7 @@ discard block |
||
68 | 67 | * Create new instance |
69 | 68 | * @param string $path |
70 | 69 | */ |
71 | - public function __construct(string $path) |
|
72 | - { |
|
70 | + public function __construct(string $path) { |
|
73 | 71 | $this->path = rtrim($path, '/\\') . DIRECTORY_SEPARATOR; |
74 | 72 | } |
75 | 73 |
@@ -78,7 +78,7 @@ |
||
78 | 78 | */ |
79 | 79 | public function send(MessageInterface $message): bool |
80 | 80 | { |
81 | - $content = (string)$message; |
|
81 | + $content = (string) $message; |
|
82 | 82 | |
83 | 83 | $from = $message->getFrom(); |
84 | 84 |
@@ -55,8 +55,7 @@ discard block |
||
55 | 55 | * Class Sendmail |
56 | 56 | * @package Platine\Mail\Transport |
57 | 57 | */ |
58 | -class Sendmail implements TransportInterface |
|
59 | -{ |
|
58 | +class Sendmail implements TransportInterface { |
|
60 | 59 | |
61 | 60 | /** |
62 | 61 | * |
@@ -68,8 +67,7 @@ discard block |
||
68 | 67 | * Create new instance |
69 | 68 | * @param string $path |
70 | 69 | */ |
71 | - public function __construct(string $path = '/usr/sbin/sendmail') |
|
72 | - { |
|
70 | + public function __construct(string $path = '/usr/sbin/sendmail') { |
|
73 | 71 | $this->path = $path; |
74 | 72 | } |
75 | 73 |
@@ -99,16 +99,16 @@ discard block |
||
99 | 99 | */ |
100 | 100 | protected string $body = ''; |
101 | 101 | |
102 | - /** |
|
103 | - * The mail attachments |
|
104 | - * @var array<int, array<string, string>> |
|
105 | - */ |
|
102 | + /** |
|
103 | + * The mail attachments |
|
104 | + * @var array<int, array<string, string>> |
|
105 | + */ |
|
106 | 106 | protected array $attachments = []; |
107 | 107 | |
108 | - /** |
|
109 | - * The mail headers |
|
110 | - * @var array<string, mixed> |
|
111 | - */ |
|
108 | + /** |
|
109 | + * The mail headers |
|
110 | + * @var array<string, mixed> |
|
111 | + */ |
|
112 | 112 | protected array $headers = []; |
113 | 113 | |
114 | 114 | /** |
@@ -281,8 +281,8 @@ discard block |
||
281 | 281 | } |
282 | 282 | |
283 | 283 | /** |
284 | - * {@inheritedoc} |
|
285 | - */ |
|
284 | + * {@inheritedoc} |
|
285 | + */ |
|
286 | 286 | public function setReplyTo(string $email, ?string $name = null): self |
287 | 287 | { |
288 | 288 | $this->replyTo = $this->formatHeader($email, $name); |
@@ -568,7 +568,7 @@ discard block |
||
568 | 568 | protected function filterEmail(string $email): string |
569 | 569 | { |
570 | 570 | $rules = [ |
571 | - "\r" => '', |
|
571 | + "\r" => '', |
|
572 | 572 | "\n" => '', |
573 | 573 | "\t" => '', |
574 | 574 | '"' => '', |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | protected function filterName(string $name): string |
592 | 592 | { |
593 | 593 | $rules = [ |
594 | - "\r" => '', |
|
594 | + "\r" => '', |
|
595 | 595 | "\n" => '', |
596 | 596 | "\t" => '', |
597 | 597 | '"' => "'", |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $this->body = ''; |
152 | 152 | $this->attachments = []; |
153 | 153 | $this->headers = []; |
154 | - $this->uid = md5(uniqid((string)time())); |
|
154 | + $this->uid = md5(uniqid((string) time())); |
|
155 | 155 | $this->wrap = 78; |
156 | 156 | $this->priority = 3; |
157 | 157 | |
@@ -634,7 +634,7 @@ discard block |
||
634 | 634 | */ |
635 | 635 | protected function encodeUtf8(?string $value): string |
636 | 636 | { |
637 | - $value = trim((string)$value); |
|
637 | + $value = trim((string) $value); |
|
638 | 638 | if (preg_match('/(\s)/', $value)) { |
639 | 639 | return $this->encodeUtf8Words($value); |
640 | 640 | } |
@@ -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 | * |
@@ -132,8 +131,7 @@ discard block |
||
132 | 131 | /** |
133 | 132 | * Create new instance |
134 | 133 | */ |
135 | - public function __construct() |
|
136 | - { |
|
134 | + public function __construct() { |
|
137 | 135 | $this->reset(); |
138 | 136 | } |
139 | 137 | |
@@ -357,8 +355,7 @@ discard block |
||
357 | 355 | /** |
358 | 356 | * {@inheritedoc} |
359 | 357 | */ |
360 | - public function getHeader(string $name, $default = null) |
|
361 | - { |
|
358 | + public function getHeader(string $name, $default = null) { |
|
362 | 359 | $this->prepareHeaders(); |
363 | 360 | |
364 | 361 | return array_key_exists($name, $this->headers) |
@@ -53,8 +53,7 @@ |
||
53 | 53 | * Class MessageInterface |
54 | 54 | * @package Platine\Mail |
55 | 55 | */ |
56 | -interface MessageInterface |
|
57 | -{ |
|
56 | +interface MessageInterface { |
|
58 | 57 | |
59 | 58 | /** |
60 | 59 | * Set sender |