@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | */ |
131 | 131 | public function send(Swift_Mime_Message $message, &$failedRecipients = null) |
132 | 132 | { |
133 | - $failedRecipients = (array)$failedRecipients; |
|
133 | + $failedRecipients = (array) $failedRecipients; |
|
134 | 134 | |
135 | 135 | $evt = $this->_eventDispatcher->createSendEvent($this, $message); |
136 | 136 | if ($evt) { |
@@ -142,9 +142,9 @@ discard block |
||
142 | 142 | } |
143 | 143 | |
144 | 144 | $count = ( |
145 | - count((array)$message->getTo()) |
|
146 | - + count((array)$message->getCc()) |
|
147 | - + count((array)$message->getBcc()) |
|
145 | + count((array) $message->getTo()) |
|
146 | + + count((array) $message->getCc()) |
|
147 | + + count((array) $message->getBcc()) |
|
148 | 148 | ); |
149 | 149 | |
150 | 150 | /* |
@@ -177,10 +177,10 @@ discard block |
||
177 | 177 | |
178 | 178 | // Separate headers from body |
179 | 179 | if (false !== $endHeaders = strpos($messageStr, "\r\n\r\n")) { |
180 | - $headers = substr($messageStr, 0, $endHeaders) . "\r\n"; // Keep last EOL |
|
180 | + $headers = substr($messageStr, 0, $endHeaders)."\r\n"; // Keep last EOL |
|
181 | 181 | $body = substr($messageStr, $endHeaders + 4); |
182 | 182 | } else { |
183 | - $headers = $messageStr . "\r\n"; |
|
183 | + $headers = $messageStr."\r\n"; |
|
184 | 184 | $body = ''; |
185 | 185 | } |
186 | 186 | |
@@ -207,9 +207,9 @@ discard block |
||
207 | 207 | } else { |
208 | 208 | $failedRecipients = array_merge( |
209 | 209 | $failedRecipients, |
210 | - array_keys((array)$message->getTo()), |
|
211 | - array_keys((array)$message->getCc()), |
|
212 | - array_keys((array)$message->getBcc()) |
|
210 | + array_keys((array) $message->getTo()), |
|
211 | + array_keys((array) $message->getCc()), |
|
212 | + array_keys((array) $message->getBcc()) |
|
213 | 213 | ); |
214 | 214 | |
215 | 215 | if ($evt) { |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | $count = 0; |
222 | 222 | } |
223 | 223 | |
224 | - $message->generateId(); // Make sure a new Message ID is used |
|
224 | + $message->generateId(); // Make sure a new Message ID is used |
|
225 | 225 | |
226 | 226 | return $count; |
227 | 227 | } |
@@ -158,8 +158,8 @@ discard block |
||
158 | 158 | $address = array($address => $name); |
159 | 159 | } |
160 | 160 | |
161 | - if (!$this->_setHeaderFieldModel('Sender', (array)$address)) { |
|
162 | - $this->getHeaders()->addMailboxHeader('Sender', (array)$address); |
|
161 | + if (!$this->_setHeaderFieldModel('Sender', (array) $address)) { |
|
162 | + $this->getHeaders()->addMailboxHeader('Sender', (array) $address); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | return $this; |
@@ -212,8 +212,8 @@ discard block |
||
212 | 212 | $addresses = array($addresses => $name); |
213 | 213 | } |
214 | 214 | |
215 | - if (!$this->_setHeaderFieldModel('From', (array)$addresses)) { |
|
216 | - $this->getHeaders()->addMailboxHeader('From', (array)$addresses); |
|
215 | + if (!$this->_setHeaderFieldModel('From', (array) $addresses)) { |
|
216 | + $this->getHeaders()->addMailboxHeader('From', (array) $addresses); |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | return $this; |
@@ -266,8 +266,8 @@ discard block |
||
266 | 266 | $addresses = array($addresses => $name); |
267 | 267 | } |
268 | 268 | |
269 | - if (!$this->_setHeaderFieldModel('Reply-To', (array)$addresses)) { |
|
270 | - $this->getHeaders()->addMailboxHeader('Reply-To', (array)$addresses); |
|
269 | + if (!$this->_setHeaderFieldModel('Reply-To', (array) $addresses)) { |
|
270 | + $this->getHeaders()->addMailboxHeader('Reply-To', (array) $addresses); |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | return $this; |
@@ -321,8 +321,8 @@ discard block |
||
321 | 321 | $addresses = array($addresses => $name); |
322 | 322 | } |
323 | 323 | |
324 | - if (!$this->_setHeaderFieldModel('To', (array)$addresses)) { |
|
325 | - $this->getHeaders()->addMailboxHeader('To', (array)$addresses); |
|
324 | + if (!$this->_setHeaderFieldModel('To', (array) $addresses)) { |
|
325 | + $this->getHeaders()->addMailboxHeader('To', (array) $addresses); |
|
326 | 326 | } |
327 | 327 | |
328 | 328 | return $this; |
@@ -373,8 +373,8 @@ discard block |
||
373 | 373 | $addresses = array($addresses => $name); |
374 | 374 | } |
375 | 375 | |
376 | - if (!$this->_setHeaderFieldModel('Cc', (array)$addresses)) { |
|
377 | - $this->getHeaders()->addMailboxHeader('Cc', (array)$addresses); |
|
376 | + if (!$this->_setHeaderFieldModel('Cc', (array) $addresses)) { |
|
377 | + $this->getHeaders()->addMailboxHeader('Cc', (array) $addresses); |
|
378 | 378 | } |
379 | 379 | |
380 | 380 | return $this; |
@@ -425,8 +425,8 @@ discard block |
||
425 | 425 | $addresses = array($addresses => $name); |
426 | 426 | } |
427 | 427 | |
428 | - if (!$this->_setHeaderFieldModel('Bcc', (array)$addresses)) { |
|
429 | - $this->getHeaders()->addMailboxHeader('Bcc', (array)$addresses); |
|
428 | + if (!$this->_setHeaderFieldModel('Bcc', (array) $addresses)) { |
|
429 | + $this->getHeaders()->addMailboxHeader('Bcc', (array) $addresses); |
|
430 | 430 | } |
431 | 431 | |
432 | 432 | return $this; |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | { |
565 | 565 | $this->attach($entity); |
566 | 566 | |
567 | - return 'cid:' . $entity->getId(); |
|
567 | + return 'cid:'.$entity->getId(); |
|
568 | 568 | } |
569 | 569 | |
570 | 570 | /** |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | { |
107 | 107 | if ($lang && $this->_lang !== $lang) { |
108 | 108 | $this->clearCachedValue(); |
109 | - $this->_lang = (string)$lang; |
|
109 | + $this->_lang = (string) $lang; |
|
110 | 110 | } |
111 | 111 | } |
112 | 112 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | if ($lineLength && $this->_lineLength !== $lineLength) { |
166 | 166 | $this->clearCachedValue(); |
167 | 167 | |
168 | - $this->_lineLength = (int)$lineLength; |
|
168 | + $this->_lineLength = (int) $lineLength; |
|
169 | 169 | |
170 | 170 | return true; |
171 | 171 | } |
@@ -231,17 +231,17 @@ discard block |
||
231 | 231 | // Treat token as exactly what was given |
232 | 232 | $phraseStr = $string; |
233 | 233 | // If it's not valid |
234 | - if (!preg_match('/^' . self::PHRASE_PATTERN . '$/D', $phraseStr)) { |
|
234 | + if (!preg_match('/^'.self::PHRASE_PATTERN.'$/D', $phraseStr)) { |
|
235 | 235 | // .. but it is just ascii text, try escaping some characters |
236 | 236 | // and make it a quoted-string |
237 | 237 | if (preg_match('/^[\x00-\x08\x0B\x0C\x0E-\x7F]*$/D', $phraseStr)) { |
238 | 238 | $phraseStr = $this->escapeSpecials($phraseStr, array('"')); |
239 | - $phraseStr = '"' . $phraseStr . '"'; |
|
239 | + $phraseStr = '"'.$phraseStr.'"'; |
|
240 | 240 | } else { |
241 | 241 | // ... otherwise it needs encoding |
242 | 242 | // Determine space remaining on line if first line |
243 | 243 | if ($shorten) { |
244 | - $usedLength = strlen($header->getFieldName() . ': '); |
|
244 | + $usedLength = strlen($header->getFieldName().': '); |
|
245 | 245 | } else { |
246 | 246 | $usedLength = 0; |
247 | 247 | } |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | protected function escapeSpecials($token, array $include = array()) |
264 | 264 | { |
265 | 265 | foreach (array_merge(array('\\'), $include) as $char) { |
266 | - $token = str_replace($char, '\\' . $char, $token); |
|
266 | + $token = str_replace($char, '\\'.$char, $token); |
|
267 | 267 | } |
268 | 268 | |
269 | 269 | return $token; |
@@ -368,10 +368,10 @@ discard block |
||
368 | 368 | $charsetDecl = $this->_charset; |
369 | 369 | |
370 | 370 | if ($this->_lang) { |
371 | - $charsetDecl .= '*' . $this->_lang; |
|
371 | + $charsetDecl .= '*'.$this->_lang; |
|
372 | 372 | } |
373 | 373 | |
374 | - $encodingWrapperLength = strlen('=?' . $charsetDecl . '?' . $this->_encoder->getName() . '??='); |
|
374 | + $encodingWrapperLength = strlen('=?'.$charsetDecl.'?'.$this->_encoder->getName().'??='); |
|
375 | 375 | |
376 | 376 | if ($firstLineOffset >= 75) { |
377 | 377 | // Does this logic need to be here? |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | if (Swift::strtolowerWithStaticCache($this->_charset) !== 'iso-2022-jp') { |
388 | 388 | // special encoding for iso-2022-jp using mb_encode_mimeheader |
389 | 389 | foreach ($encodedTextLines as $lineNum => $line) { |
390 | - $encodedTextLines[$lineNum] = '=?' . $charsetDecl . '?' . $this->_encoder->getName() . '?' . $line . '?='; |
|
390 | + $encodedTextLines[$lineNum] = '=?'.$charsetDecl.'?'.$this->_encoder->getName().'?'.$line.'?='; |
|
391 | 391 | } |
392 | 392 | } |
393 | 393 | |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | { |
482 | 482 | $lineCount = 0; |
483 | 483 | $headerLines = array(); |
484 | - $headerLines[] = $this->_name . ': '; |
|
484 | + $headerLines[] = $this->_name.': '; |
|
485 | 485 | $currentLine = &$headerLines[$lineCount++]; |
486 | 486 | |
487 | 487 | // Build all tokens back into compliant header |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | ( |
497 | 497 | $i > 0 |
498 | 498 | && |
499 | - strlen($currentLine . $token) > $this->_lineLength |
|
499 | + strlen($currentLine.$token) > $this->_lineLength |
|
500 | 500 | ) |
501 | 501 | ) |
502 | 502 | ) { |
@@ -511,7 +511,7 @@ discard block |
||
511 | 511 | } |
512 | 512 | |
513 | 513 | // Implode with FWS (RFC 2822, 2.2.3) |
514 | - return implode("\r\n", $headerLines) . "\r\n"; |
|
514 | + return implode("\r\n", $headerLines)."\r\n"; |
|
515 | 515 | } |
516 | 516 | |
517 | 517 | /** |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | if (strpos($path, '?') !== false) { |
82 | 82 | $parameter = parse_url($path, PHP_URL_QUERY); |
83 | 83 | |
84 | - $this->_path = str_replace('?' . $parameter, '', $path); |
|
84 | + $this->_path = str_replace('?'.$parameter, '', $path); |
|
85 | 85 | } else { |
86 | 86 | $this->_path = $path; |
87 | 87 | } |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | $pointer = @fopen($this->_path, 'rb', false, stream_context_create($opts)); |
208 | 208 | |
209 | 209 | if (!$pointer) { |
210 | - throw new Swift_IoException('Unable to open file for reading [' . $this->_path . ']'); |
|
210 | + throw new Swift_IoException('Unable to open file for reading ['.$this->_path.']'); |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | $this->_reader = $pointer; |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | $pointer = @fopen($this->_path, $this->_mode); |
230 | 230 | |
231 | 231 | if (!$pointer) { |
232 | - throw new Swift_IoException('Unable to open file for writing [' . $this->_path . ']'); |
|
232 | + throw new Swift_IoException('Unable to open file for writing ['.$this->_path.']'); |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | $this->_writer = $pointer; |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | $source = @fopen($this->_path, 'rb'); |
301 | 301 | |
302 | 302 | if (!$source) { |
303 | - throw new Swift_IoException('Unable to open file for copying [' . $this->_path . ']'); |
|
303 | + throw new Swift_IoException('Unable to open file for copying ['.$this->_path.']'); |
|
304 | 304 | } |
305 | 305 | |
306 | 306 | fseek($tmpFile, 0, SEEK_SET); |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | public function setTimeout($timeout) |
141 | 141 | { |
142 | - $this->_timeout = (int)$timeout; |
|
142 | + $this->_timeout = (int) $timeout; |
|
143 | 143 | |
144 | 144 | return $this; |
145 | 145 | } |
@@ -306,11 +306,11 @@ discard block |
||
306 | 306 | $host = $this->_host; |
307 | 307 | switch (Swift::strtolowerWithStaticCache($this->_crypto)) { |
308 | 308 | case 'ssl': |
309 | - $host = 'ssl://' . $host; |
|
309 | + $host = 'ssl://'.$host; |
|
310 | 310 | break; |
311 | 311 | |
312 | 312 | case 'tls': |
313 | - $host = 'tls://' . $host; |
|
313 | + $host = 'tls://'.$host; |
|
314 | 314 | break; |
315 | 315 | } |
316 | 316 |
@@ -51,23 +51,23 @@ discard block |
||
51 | 51 | $prefix = 'Swift_CharacterReader_'; |
52 | 52 | |
53 | 53 | $singleByte = array( |
54 | - 'class' => $prefix . 'GenericFixedWidthReader', |
|
54 | + 'class' => $prefix.'GenericFixedWidthReader', |
|
55 | 55 | 'constructor' => array(1), |
56 | 56 | ); |
57 | 57 | |
58 | 58 | $doubleByte = array( |
59 | - 'class' => $prefix . 'GenericFixedWidthReader', |
|
59 | + 'class' => $prefix.'GenericFixedWidthReader', |
|
60 | 60 | 'constructor' => array(2), |
61 | 61 | ); |
62 | 62 | |
63 | 63 | $fourBytes = array( |
64 | - 'class' => $prefix . 'GenericFixedWidthReader', |
|
64 | + 'class' => $prefix.'GenericFixedWidthReader', |
|
65 | 65 | 'constructor' => array(4), |
66 | 66 | ); |
67 | 67 | |
68 | 68 | // UTF-8 |
69 | 69 | self::$_map['utf-?8'] = array( |
70 | - 'class' => $prefix . 'Utf8Reader', |
|
70 | + 'class' => $prefix.'Utf8Reader', |
|
71 | 71 | 'constructor' => array(), |
72 | 72 | ); |
73 | 73 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $charset = Swift::strtolowerWithStaticCache(trim($charset)); |
107 | 107 | |
108 | 108 | foreach (self::$_map as $pattern => $spec) { |
109 | - $re = '/^' . $pattern . '$/D'; |
|
109 | + $re = '/^'.$pattern.'$/D'; |
|
110 | 110 | if (preg_match($re, $charset)) { |
111 | 111 | if (!array_key_exists($pattern, self::$_loaded)) { |
112 | 112 | $reflector = new ReflectionClass($spec['class']); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | */ |
110 | 110 | public function setNameAddresses($mailboxes) |
111 | 111 | { |
112 | - $this->_mailboxes = $this->normalizeMailboxes((array)$mailboxes); |
|
112 | + $this->_mailboxes = $this->normalizeMailboxes((array) $mailboxes); |
|
113 | 113 | $this->setCachedValue(null); //Clear any cached value |
114 | 114 | } |
115 | 115 | |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | */ |
195 | 195 | public function setAddresses($addresses) |
196 | 196 | { |
197 | - $this->setNameAddresses(array_values((array)$addresses)); |
|
197 | + $this->setNameAddresses(array_values((array) $addresses)); |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | /** |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | public function removeAddresses($addresses) |
218 | 218 | { |
219 | 219 | $this->setCachedValue(null); |
220 | - foreach ((array)$addresses as $address) { |
|
220 | + foreach ((array) $addresses as $address) { |
|
221 | 221 | unset($this->_mailboxes[$address]); |
222 | 222 | } |
223 | 223 | } |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | $mailboxStr = $email; |
338 | 338 | if ($name) { |
339 | 339 | $nameStr = $this->createDisplayNameString($name, 0 === count($strings)); |
340 | - $mailboxStr = $nameStr . ' <' . $mailboxStr . '>'; |
|
340 | + $mailboxStr = $nameStr.' <'.$mailboxStr.'>'; |
|
341 | 341 | } |
342 | 342 | $strings[] = $mailboxStr; |
343 | 343 | } |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | private function _assertValidAddress($address) |
356 | 356 | { |
357 | 357 | if ($this->_emailValidator->isValidWrapper($address) === false) { |
358 | - throw new Swift_RfcComplianceException('Address in mailbox given [' . $address . '] does not comply with RFC 2822, 3.6.2.'); |
|
358 | + throw new Swift_RfcComplianceException('Address in mailbox given ['.$address.'] does not comply with RFC 2822, 3.6.2.'); |
|
359 | 359 | } |
360 | 360 | } |
361 | 361 | } |
@@ -203,7 +203,7 @@ |
||
203 | 203 | $to = $start; |
204 | 204 | for (; $this->_currentPos < $end; ++$this->_currentPos) { |
205 | 205 | if (isset($this->_map['i'], $this->_map['i'][$this->_currentPos])) { |
206 | - $ret .= substr($this->_datas, $start, $to - $start) . '?'; |
|
206 | + $ret .= substr($this->_datas, $start, $to - $start).'?'; |
|
207 | 207 | $start = $this->_map['p'][$this->_currentPos]; |
208 | 208 | } else { |
209 | 209 | $to = $this->_map['p'][$this->_currentPos]; |
@@ -185,8 +185,8 @@ discard block |
||
185 | 185 | } |
186 | 186 | |
187 | 187 | throw new Swift_TransportException( |
188 | - 'Failed to authenticate on SMTP server with username "' . |
|
189 | - $this->_username . '" using ' . $count . ' possible authenticators' |
|
188 | + 'Failed to authenticate on SMTP server with username "'. |
|
189 | + $this->_username.'" using '.$count.' possible authenticators' |
|
190 | 190 | ); |
191 | 191 | } |
192 | 192 | } |
@@ -263,6 +263,6 @@ discard block |
||
263 | 263 | } |
264 | 264 | } |
265 | 265 | |
266 | - throw new Swift_TransportException('Auth mode ' . $mode . ' is invalid'); |
|
266 | + throw new Swift_TransportException('Auth mode '.$mode.' is invalid'); |
|
267 | 267 | } |
268 | 268 | } |