@@ -40,6 +40,5 @@ |
||
| 40 | 40 | * Class MailException |
| 41 | 41 | * @package Platine\Mail\Exception |
| 42 | 42 | */ |
| 43 | -class MailException extends Exception |
|
| 44 | -{ |
|
| 43 | +class MailException extends Exception { |
|
| 45 | 44 | } |
@@ -40,6 +40,5 @@ |
||
| 40 | 40 | * Class FileTransportException |
| 41 | 41 | * @package Platine\Mail\Exception |
| 42 | 42 | */ |
| 43 | -class FileTransportException extends Exception |
|
| 44 | -{ |
|
| 43 | +class FileTransportException extends Exception { |
|
| 45 | 44 | } |
@@ -38,16 +38,14 @@ |
||
| 38 | 38 | * Class SMTPRetunCodeException |
| 39 | 39 | * @package Platine\Mail\Exception |
| 40 | 40 | */ |
| 41 | -class SMTPRetunCodeException extends SMTPException |
|
| 42 | -{ |
|
| 41 | +class SMTPRetunCodeException extends SMTPException { |
|
| 43 | 42 | /** |
| 44 | 43 | * Create new instance |
| 45 | 44 | * @param int $expected |
| 46 | 45 | * @param int $received |
| 47 | 46 | * @param string|null $serverMessage |
| 48 | 47 | */ |
| 49 | - public function __construct(int $expected, int $received, ?string $serverMessage = null) |
|
| 50 | - { |
|
| 48 | + public function __construct(int $expected, int $received, ?string $serverMessage = null) { |
|
| 51 | 49 | $message = sprintf( |
| 52 | 50 | 'Unexpected return code expected %d, but got %d', |
| 53 | 51 | $expected, |
@@ -38,6 +38,5 @@ |
||
| 38 | 38 | * Class SMTPException |
| 39 | 39 | * @package Platine\Mail\Exception |
| 40 | 40 | */ |
| 41 | -class SMTPSecureException extends SMTPException |
|
| 42 | -{ |
|
| 41 | +class SMTPSecureException extends SMTPException { |
|
| 43 | 42 | } |
@@ -40,6 +40,5 @@ |
||
| 40 | 40 | * Class SMTPException |
| 41 | 41 | * @package Platine\Mail\Exception |
| 42 | 42 | */ |
| 43 | -class SMTPException extends Exception |
|
| 44 | -{ |
|
| 43 | +class SMTPException extends Exception { |
|
| 45 | 44 | } |
@@ -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 | * @var string |
@@ -67,8 +66,7 @@ discard block |
||
| 67 | 66 | * Create new instance |
| 68 | 67 | * @param string|null $path |
| 69 | 68 | */ |
| 70 | - public function __construct(?string $path = null) |
|
| 71 | - { |
|
| 69 | + public function __construct(?string $path = null) { |
|
| 72 | 70 | if ($path === null) { |
| 73 | 71 | $path = sys_get_temp_dir(); |
| 74 | 72 | } |
@@ -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 | * @var string |
@@ -67,8 +66,7 @@ discard block |
||
| 67 | 66 | * Create new instance |
| 68 | 67 | * @param string $path |
| 69 | 68 | */ |
| 70 | - public function __construct(string $path = '/usr/sbin/sendmail') |
|
| 71 | - { |
|
| 69 | + public function __construct(string $path = '/usr/sbin/sendmail') { |
|
| 72 | 70 | $this->path = $path; |
| 73 | 71 | } |
| 74 | 72 | |
@@ -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 | * End of line char |
| 61 | 60 | */ |
@@ -136,8 +135,7 @@ discard block |
||
| 136 | 135 | /** |
| 137 | 136 | * Create new instance |
| 138 | 137 | */ |
| 139 | - public function __construct() |
|
| 140 | - { |
|
| 138 | + public function __construct() { |
|
| 141 | 139 | $this->reset(); |
| 142 | 140 | } |
| 143 | 141 | |
@@ -369,8 +367,7 @@ discard block |
||
| 369 | 367 | /** |
| 370 | 368 | * {@inheritedoc} |
| 371 | 369 | */ |
| 372 | - public function getHeader(string $name, $default = null) |
|
| 373 | - { |
|
| 370 | + public function getHeader(string $name, $default = null) { |
|
| 374 | 371 | $this->prepareHeaders(); |
| 375 | 372 | |
| 376 | 373 | 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 | * The mail transport instance |
| 62 | 61 | * @var TransportInterface |
@@ -67,8 +66,7 @@ discard block |
||
| 67 | 66 | * Create new instance |
| 68 | 67 | * @param TransportInterface|null $transport |
| 69 | 68 | */ |
| 70 | - public function __construct(?TransportInterface $transport = null) |
|
| 71 | - { |
|
| 69 | + public function __construct(?TransportInterface $transport = null) { |
|
| 72 | 70 | $this->transport = $transport ? $transport : new NullTransport(); |
| 73 | 71 | } |
| 74 | 72 | |