@@ -182,18 +182,18 @@ discard block |
||
182 | 182 | $this->message = $message; |
183 | 183 | |
184 | 184 | $this->connect() |
185 | - ->ehlo(); |
|
185 | + ->ehlo(); |
|
186 | 186 | |
187 | 187 | if ($this->tls) { |
188 | 188 | $this->starttls() |
189 | - ->ehlo(); |
|
189 | + ->ehlo(); |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | $this->authLogin() |
193 | - ->mailFrom() |
|
194 | - ->rcptTo() |
|
195 | - ->data() |
|
196 | - ->quit(); |
|
193 | + ->mailFrom() |
|
194 | + ->rcptTo() |
|
195 | + ->data() |
|
196 | + ->quit(); |
|
197 | 197 | |
198 | 198 | if (is_resource($this->smtp)) { |
199 | 199 | return fclose($this->smtp); |
@@ -221,11 +221,11 @@ discard block |
||
221 | 221 | } |
222 | 222 | |
223 | 223 | /** |
224 | - * Connect to server |
|
225 | - * @return $this |
|
226 | - * @throws SMTPException |
|
227 | - * @throws SMTPRetunCodeException |
|
228 | - */ |
|
224 | + * Connect to server |
|
225 | + * @return $this |
|
226 | + * @throws SMTPException |
|
227 | + * @throws SMTPRetunCodeException |
|
228 | + */ |
|
229 | 229 | protected function connect(): self |
230 | 230 | { |
231 | 231 | $host = $this->ssl ? 'ssl://' . $this->host : $this->host; |
@@ -257,14 +257,14 @@ discard block |
||
257 | 257 | } |
258 | 258 | |
259 | 259 | /** |
260 | - * STREAM_CRYPTO_METHOD_TLS_CLIENT is quite the mess ... |
|
261 | - * |
|
262 | - * - On PHP <5.6 it doesn't even mean TLS, but SSL 2.0, and there's no option to use actual TLS |
|
263 | - * - On PHP 5.6.0-5.6.6, >=7.2 it means negotiation with any of TLS 1.0, 1.1, 1.2 |
|
264 | - * - On PHP 5.6.7-7.1.* it means only TLS 1.0 |
|
265 | - * |
|
266 | - * We want the negotiation, so we'll force it below ... |
|
267 | - */ |
|
260 | + * STREAM_CRYPTO_METHOD_TLS_CLIENT is quite the mess ... |
|
261 | + * |
|
262 | + * - On PHP <5.6 it doesn't even mean TLS, but SSL 2.0, and there's no option to use actual TLS |
|
263 | + * - On PHP 5.6.0-5.6.6, >=7.2 it means negotiation with any of TLS 1.0, 1.1, 1.2 |
|
264 | + * - On PHP 5.6.7-7.1.* it means only TLS 1.0 |
|
265 | + * |
|
266 | + * We want the negotiation, so we'll force it below ... |
|
267 | + */ |
|
268 | 268 | if (is_resource($this->smtp)) { |
269 | 269 | if ( |
270 | 270 | !stream_socket_enable_crypto( |
@@ -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( |
@@ -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 |
@@ -103,16 +103,16 @@ discard block |
||
103 | 103 | */ |
104 | 104 | protected string $body = ''; |
105 | 105 | |
106 | - /** |
|
107 | - * The mail attachments |
|
108 | - * @var array<int, array<string, string>> |
|
109 | - */ |
|
106 | + /** |
|
107 | + * The mail attachments |
|
108 | + * @var array<int, array<string, string>> |
|
109 | + */ |
|
110 | 110 | protected array $attachments = []; |
111 | 111 | |
112 | - /** |
|
113 | - * The mail headers |
|
114 | - * @var array<string, mixed> |
|
115 | - */ |
|
112 | + /** |
|
113 | + * The mail headers |
|
114 | + * @var array<string, mixed> |
|
115 | + */ |
|
116 | 116 | protected array $headers = []; |
117 | 117 | |
118 | 118 | /** |
@@ -284,8 +284,8 @@ discard block |
||
284 | 284 | } |
285 | 285 | |
286 | 286 | /** |
287 | - * {@inheritedoc} |
|
288 | - */ |
|
287 | + * {@inheritedoc} |
|
288 | + */ |
|
289 | 289 | public function setReplyTo(string $email, ?string $name = null): self |
290 | 290 | { |
291 | 291 | $this->replyTo = $this->formatHeader($email, $name); |
@@ -463,17 +463,17 @@ discard block |
||
463 | 463 | } |
464 | 464 | |
465 | 465 | $this->addHeader('X-Priority', $this->priority) |
466 | - ->addHeader('X-Mailer', 'Platine PHP Mail') |
|
467 | - ->addHeader('Subject', $this->subject) |
|
468 | - ->addHeader('To', join(', ', $this->to)) |
|
469 | - ->addHeader('Date', date('r')); |
|
466 | + ->addHeader('X-Mailer', 'Platine PHP Mail') |
|
467 | + ->addHeader('Subject', $this->subject) |
|
468 | + ->addHeader('To', join(', ', $this->to)) |
|
469 | + ->addHeader('Date', date('r')); |
|
470 | 470 | |
471 | 471 | if ($this->hasAttachments()) { |
472 | 472 | $this->addHeader('MIME-Version', '1.0') |
473 | - ->addHeader( |
|
474 | - 'Content-Type', |
|
475 | - sprintf('multipart/mixed; boundary="%s"', $this->uid) |
|
476 | - ); |
|
473 | + ->addHeader( |
|
474 | + 'Content-Type', |
|
475 | + sprintf('multipart/mixed; boundary="%s"', $this->uid) |
|
476 | + ); |
|
477 | 477 | } |
478 | 478 | |
479 | 479 | return $this; |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | protected function filterEmail(string $email): string |
578 | 578 | { |
579 | 579 | $rules = [ |
580 | - "\r" => '', |
|
580 | + "\r" => '', |
|
581 | 581 | "\n" => '', |
582 | 582 | "\t" => '', |
583 | 583 | '"' => '', |
@@ -602,7 +602,7 @@ discard block |
||
602 | 602 | protected function filterName(string $name): string |
603 | 603 | { |
604 | 604 | $rules = [ |
605 | - "\r" => '', |
|
605 | + "\r" => '', |
|
606 | 606 | "\n" => '', |
607 | 607 | "\t" => '', |
608 | 608 | '"' => "'", |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $this->body = ''; |
156 | 156 | $this->attachments = []; |
157 | 157 | $this->headers = []; |
158 | - $this->uid = md5(uniqid((string)time())); |
|
158 | + $this->uid = md5(uniqid((string) time())); |
|
159 | 159 | $this->wrap = 70; |
160 | 160 | $this->priority = 3; |
161 | 161 | |
@@ -645,7 +645,7 @@ discard block |
||
645 | 645 | */ |
646 | 646 | protected function encodeUtf8(?string $value): string |
647 | 647 | { |
648 | - $valueClean = trim((string)$value); |
|
648 | + $valueClean = trim((string) $value); |
|
649 | 649 | if (preg_match('/(\s)/', $valueClean)) { |
650 | 650 | return $this->encodeUtf8Words($valueClean); |
651 | 651 | } |