@@ -53,7 +53,7 @@ |
||
| 53 | 53 | */ |
| 54 | 54 | public function createMessage($service = 'message') |
| 55 | 55 | { |
| 56 | - return Swift_DependencyContainer::getInstance()->lookup('message.' . $service); |
|
| 56 | + return Swift_DependencyContainer::getInstance()->lookup('message.'.$service); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | return; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - $path = __DIR__ . '/' . str_replace('_', '/', $class) . '.php'; |
|
| 49 | + $path = __DIR__.'/'.str_replace('_', '/', $class).'.php'; |
|
| 50 | 50 | |
| 51 | 51 | if (!file_exists($path)) { |
| 52 | 52 | return; |
@@ -169,7 +169,7 @@ |
||
| 169 | 169 | ksort($valid_mime_types); |
| 170 | 170 | |
| 171 | 171 | // combine mime types and extensions array |
| 172 | - $output = "$preamble\$swift_mime_types = array(\n " . implode($valid_mime_types, ",\n ") . "\n);"; |
|
| 172 | + $output = "$preamble\$swift_mime_types = array(\n ".implode($valid_mime_types, ",\n ")."\n);"; |
|
| 173 | 173 | |
| 174 | 174 | // write mime_types.php config file |
| 175 | 175 | @file_put_contents('./mime_types.php', $output); |
@@ -96,10 +96,10 @@ discard block |
||
| 96 | 96 | public function queueMessage(Swift_Mime_Message $message) |
| 97 | 97 | { |
| 98 | 98 | $ser = serialize($message); |
| 99 | - $fileName = $this->_path . '/' . $this->getRandomString(10); |
|
| 99 | + $fileName = $this->_path.'/'.$this->getRandomString(10); |
|
| 100 | 100 | for ($i = 0; $i < $this->_retryLimit; ++$i) { |
| 101 | 101 | /* We try an exclusive creation of the file. This is an atomic operation, it avoid locking mechanism */ |
| 102 | - $fp = @fopen($fileName . '.message', 'x'); |
|
| 102 | + $fp = @fopen($fileName.'.message', 'x'); |
|
| 103 | 103 | if (false !== $fp) { |
| 104 | 104 | if (false === fwrite($fp, $ser)) { |
| 105 | 105 | return false; |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | } |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | - $failedRecipients = (array)$failedRecipients; |
|
| 159 | + $failedRecipients = (array) $failedRecipients; |
|
| 160 | 160 | $count = 0; |
| 161 | 161 | $time = time(); |
| 162 | 162 | foreach ($directoryIterator as $file) { |
@@ -167,12 +167,12 @@ discard block |
||
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | /* We try a rename, it's an atomic operation, and avoid locking the file */ |
| 170 | - if (rename($file, $file . '.sending')) { |
|
| 171 | - $message = unserialize(file_get_contents($file . '.sending')); |
|
| 170 | + if (rename($file, $file.'.sending')) { |
|
| 171 | + $message = unserialize(file_get_contents($file.'.sending')); |
|
| 172 | 172 | |
| 173 | 173 | $count += $transport->send($message, $failedRecipients); |
| 174 | 174 | |
| 175 | - unlink($file . '.sending'); |
|
| 175 | + unlink($file.'.sending'); |
|
| 176 | 176 | } else { |
| 177 | 177 | /* This message has just been catched by another process */ |
| 178 | 178 | continue; |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | $ret = ''; |
| 205 | 205 | $strlen = strlen($base); |
| 206 | 206 | for ($i = 0; $i < $count; ++$i) { |
| 207 | - $ret .= $base[((int)mt_rand(0, $strlen - 1))]; |
|
| 207 | + $ret .= $base[((int) mt_rand(0, $strlen - 1))]; |
|
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | return $ret; |
@@ -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 (strtolower($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 | |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | return false; |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - foreach ((array)$this->_search as $needle) { |
|
| 50 | + foreach ((array) $this->_search as $needle) { |
|
| 51 | 51 | if ( |
| 52 | 52 | $needle |
| 53 | 53 | && |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | $phraseStr = $string; |
| 217 | 217 | |
| 218 | 218 | // If it's not valid |
| 219 | - if (!preg_match('/^' . self::PHRASE_PATTERN . '$/D', $phraseStr)) { |
|
| 219 | + if (!preg_match('/^'.self::PHRASE_PATTERN.'$/D', $phraseStr)) { |
|
| 220 | 220 | |
| 221 | 221 | if (preg_match('/^[\x00-\x08\x0B\x0C\x0E-\x7F]*$/D', $phraseStr)) { |
| 222 | 222 | // .. but it is just ascii text, try escaping some characters |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | // and make it a quoted-string |
| 230 | - $phraseStr = '"' . $phraseStr . '"'; |
|
| 230 | + $phraseStr = '"'.$phraseStr.'"'; |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | return $phraseStr; |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | protected function escapeSpecials($token, array $include = array()) |
| 245 | 245 | { |
| 246 | 246 | foreach (array_merge(array('\\'), $include) as $char) { |
| 247 | - $token = str_replace($char, '\\' . $char, $token); |
|
| 247 | + $token = str_replace($char, '\\'.$char, $token); |
|
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | return $token; |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | $token = substr($token, 1); |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | - $usedLength = strlen($header->getFieldName() . ': ') + strlen($value); |
|
| 279 | + $usedLength = strlen($header->getFieldName().': ') + strlen($value); |
|
| 280 | 280 | $value .= $this->getTokenAsEncodedWord($token, $usedLength); |
| 281 | 281 | |
| 282 | 282 | $header->setMaxLineLength(76); // Forcefully override |
@@ -351,10 +351,10 @@ discard block |
||
| 351 | 351 | $charsetDecl = $this->_charset; |
| 352 | 352 | |
| 353 | 353 | if (isset($this->_lang)) { |
| 354 | - $charsetDecl .= '*' . $this->_lang; |
|
| 354 | + $charsetDecl .= '*'.$this->_lang; |
|
| 355 | 355 | } |
| 356 | 356 | |
| 357 | - $encodingWrapperLength = strlen('=?' . $charsetDecl . '?' . $this->_encoder->getName() . '??='); |
|
| 357 | + $encodingWrapperLength = strlen('=?'.$charsetDecl.'?'.$this->_encoder->getName().'??='); |
|
| 358 | 358 | |
| 359 | 359 | if ($firstLineOffset >= 75) { |
| 360 | 360 | // Does this logic need to be here? |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | if (Swift::strtolowerWithStaticCache($this->_charset) !== 'iso-2022-jp') { |
| 371 | 371 | // special encoding for iso-2022-jp using mb_encode_mimeheader |
| 372 | 372 | foreach ($encodedTextLines as $lineNum => $line) { |
| 373 | - $encodedTextLines[$lineNum] = '=?' . $charsetDecl . '?' . $this->_encoder->getName() . '?' . $line . '?='; |
|
| 373 | + $encodedTextLines[$lineNum] = '=?'.$charsetDecl.'?'.$this->_encoder->getName().'?'.$line.'?='; |
|
| 374 | 374 | } |
| 375 | 375 | } |
| 376 | 376 | |
@@ -459,7 +459,7 @@ discard block |
||
| 459 | 459 | { |
| 460 | 460 | $lineCount = 0; |
| 461 | 461 | $headerLines = array(); |
| 462 | - $headerLines[] = $this->_name . ': '; |
|
| 462 | + $headerLines[] = $this->_name.': '; |
|
| 463 | 463 | $currentLine = &$headerLines[$lineCount++]; |
| 464 | 464 | |
| 465 | 465 | // Build all tokens back into compliant header |
@@ -468,7 +468,7 @@ discard block |
||
| 468 | 468 | if ( |
| 469 | 469 | ("\r\n" === $token) |
| 470 | 470 | || |
| 471 | - ($i > 0 && strlen($currentLine . $token) > $this->_lineLength) |
|
| 471 | + ($i > 0 && strlen($currentLine.$token) > $this->_lineLength) |
|
| 472 | 472 | && |
| 473 | 473 | 0 < strlen($currentLine) |
| 474 | 474 | ) { |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | } |
| 484 | 484 | |
| 485 | 485 | // Implode with FWS (RFC 2822, 2.2.3) |
| 486 | - return implode("\r\n", $headerLines) . "\r\n"; |
|
| 486 | + return implode("\r\n", $headerLines)."\r\n"; |
|
| 487 | 487 | } |
| 488 | 488 | |
| 489 | 489 | /** |