@@ -77,8 +77,9 @@ |
||
77 | 77 | |
78 | 78 | /** |
79 | 79 | * @param Message $message |
80 | + * @param string $status |
|
80 | 81 | * |
81 | - * @return array map where message token => replacement string |
|
82 | + * @return string map where message token => replacement string |
|
82 | 83 | */ |
83 | 84 | protected function getMessageTokens(Message $message, $status) |
84 | 85 | { |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | namespace Kodus\Mail; |
4 | 4 | |
5 | -use Error; |
|
6 | -use Exception; |
|
5 | +use Error; |
|
6 | +use Exception; |
|
7 | 7 | use Psr\Log\LoggerInterface; |
8 | 8 | |
9 | 9 | /** |
@@ -104,7 +104,7 @@ |
||
104 | 104 | return implode( |
105 | 105 | ", ", |
106 | 106 | array_map( |
107 | - function (Address $address) { |
|
107 | + function(Address $address) { |
|
108 | 108 | $name = $address->getName(); |
109 | 109 | $email = $address->getEmail(); |
110 | 110 |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
95 | - * @return Address|Address[] |
|
95 | + * @return Address[] |
|
96 | 96 | */ |
97 | 97 | public function getTo() |
98 | 98 | { |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | * |
176 | 176 | * In particular, the "Sender" field *must* be present if it is *not* the same as the "From" Field. |
177 | 177 | * |
178 | - * @param Address|null $sender |
|
178 | + * @param Address $sender |
|
179 | 179 | */ |
180 | 180 | public function setSender(Address $sender) |
181 | 181 | { |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | } |
184 | 184 | |
185 | 185 | /** |
186 | - * @return Address|Address[] |
|
186 | + * @return Address[] |
|
187 | 187 | */ |
188 | 188 | public function getCC() |
189 | 189 | { |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | } |
210 | 210 | |
211 | 211 | /** |
212 | - * @return Address|Address[] |
|
212 | + * @return Address[] |
|
213 | 213 | */ |
214 | 214 | public function getBCC() |
215 | 215 | { |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | } |
242 | 242 | |
243 | 243 | /** |
244 | - * @return Address|Address[] |
|
244 | + * @return Address[] |
|
245 | 245 | */ |
246 | 246 | public function getReplyTo() |
247 | 247 | { |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | } |
290 | 290 | |
291 | 291 | /** |
292 | - * @param int|string $date integer timestamp, or a string compatible with the strtotime() function |
|
292 | + * @param integer $date integer timestamp, or a string compatible with the strtotime() function |
|
293 | 293 | */ |
294 | 294 | public function setDate($date) |
295 | 295 | { |
@@ -164,7 +164,8 @@ |
||
164 | 164 | * Write the "Content-Type" header and the Attachment Content in base-64 encoded format |
165 | 165 | * |
166 | 166 | * @param Attachment $attachment |
167 | - * @param string|null Content ID (for inline Attachments) |
|
167 | + * @param string|null Content ID (for inline Attachments) |
|
168 | + * @param string $content_id |
|
168 | 169 | */ |
169 | 170 | public function writeAttachmentPart(Attachment $attachment, $content_id = null) |
170 | 171 | { |
@@ -110,8 +110,8 @@ discard block |
||
110 | 110 | $text = $message->getText(); |
111 | 111 | $html = $message->getHTML(); |
112 | 112 | |
113 | - if (! empty($text)) { |
|
114 | - if (! empty($html)) { |
|
113 | + if (!empty($text)) { |
|
114 | + if (!empty($html)) { |
|
115 | 115 | $boundary = $this->createMultipartBoundaryName("alternative"); |
116 | 116 | |
117 | 117 | $this->writeAlternativeContentTypeHeader($boundary); |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | } else { |
128 | 128 | $this->writeTextPart($text); |
129 | 129 | } |
130 | - } elseif (! empty($html)) { |
|
130 | + } elseif (!empty($html)) { |
|
131 | 131 | $this->writeHTMLPart($html); |
132 | 132 | } |
133 | 133 | } |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | implode( |
226 | 226 | ", ", |
227 | 227 | array_map( |
228 | - function (Address $address) { |
|
228 | + function(Address $address) { |
|
229 | 229 | $email = $address->getEmail(); |
230 | 230 | $name = $address->getName(); |
231 | 231 |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | namespace Kodus\Mail\SMTP; |
4 | 4 | |
5 | -use Kodus\Mail\MailService; |
|
6 | -use Kodus\Mail\Message; |
|
5 | +use Kodus\Mail\MailService; |
|
6 | +use Kodus\Mail\Message; |
|
7 | 7 | use Kodus\Mail\MIMEWriter; |
8 | 8 | |
9 | 9 | /** |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $this->getClient()->sendMail( |
51 | 51 | $this->getSender($message), |
52 | 52 | $this->getRecipients($message), |
53 | - function ($socket) use ($message) { |
|
53 | + function($socket) use ($message) { |
|
54 | 54 | $writer = new MIMEWriter($socket); |
55 | 55 | |
56 | 56 | $writer->writeMessage($message); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | protected function getClient() |
83 | 83 | { |
84 | - if (! isset($this->client)) { |
|
84 | + if (!isset($this->client)) { |
|
85 | 85 | $this->client = $this->connector->connect($this->client_domain); |
86 | 86 | |
87 | 87 | $this->authenticator->authenticate($this->client); |
@@ -29,11 +29,11 @@ |
||
29 | 29 | */ |
30 | 30 | public function __construct($email, $name = null) |
31 | 31 | { |
32 | - if (! self::isValidEmail($email)) { |
|
32 | + if (!self::isValidEmail($email)) { |
|
33 | 33 | throw new InvalidArgumentException("invalid e-mail address"); |
34 | 34 | } |
35 | 35 | |
36 | - if (! empty($name)) { |
|
36 | + if (!empty($name)) { |
|
37 | 37 | if (preg_match('/[\r\n]/', $name)) { |
38 | 38 | throw new RuntimeException("CR/LF injection detected"); |
39 | 39 | } |
@@ -32,7 +32,7 @@ |
||
32 | 32 | { |
33 | 33 | $socket = @fsockopen($this->host, $this->port); |
34 | 34 | |
35 | - if (! $socket) { |
|
35 | + if (!$socket) { |
|
36 | 36 | throw new SMTPException("Could not open SMTP Port."); |
37 | 37 | } |
38 | 38 |
@@ -91,7 +91,7 @@ |
||
91 | 91 | { |
92 | 92 | $this->sendCommand("STARTTLS", "220"); |
93 | 93 | |
94 | - if (! stream_socket_enable_crypto($this->socket, true, $crypto_method)) { |
|
94 | + if (!stream_socket_enable_crypto($this->socket, true, $crypto_method)) { |
|
95 | 95 | throw new SMTPException("STARTTLS failed to enable crypto-method: {$crypto_method}"); |
96 | 96 | } |
97 | 97 | } |