@@ -30,6 +30,6 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | public function isValidSimpleWrapper($email) |
| 32 | 32 | { |
| 33 | - return (boolean)preg_match('/^(.*<?)(.*)@(.*)(>?)$/', $email); |
|
| 33 | + return (boolean) preg_match('/^(.*<?)(.*)@(.*)(>?)$/', $email); |
|
| 34 | 34 | } |
| 35 | 35 | } |
@@ -77,9 +77,9 @@ |
||
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | $count = ( |
| 80 | - count((array)$message->getTo()) |
|
| 81 | - + count((array)$message->getCc()) |
|
| 82 | - + count((array)$message->getBcc()) |
|
| 80 | + count((array) $message->getTo()) |
|
| 81 | + + count((array) $message->getCc()) |
|
| 82 | + + count((array) $message->getBcc()) |
|
| 83 | 83 | ); |
| 84 | 84 | |
| 85 | 85 | return $count; |
@@ -111,7 +111,7 @@ |
||
| 111 | 111 | if ($i !== null) { |
| 112 | 112 | $tree[-1] = min(count($replace) - 1, $i); |
| 113 | 113 | $tree[-2] = $last_size; |
| 114 | - $this->_treeMaxLen = (int)$size; |
|
| 114 | + $this->_treeMaxLen = (int) $size; |
|
| 115 | 115 | } |
| 116 | 116 | foreach ($replace as $rep) { |
| 117 | 117 | if (!is_array($rep)) { |
@@ -8,17 +8,17 @@ |
||
| 8 | 8 | * file that was distributed with this source code. |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -require __DIR__ . '/classes/Swift.php'; |
|
| 11 | +require __DIR__.'/classes/Swift.php'; |
|
| 12 | 12 | |
| 13 | 13 | Swift::registerAutoload( |
| 14 | - function () { |
|
| 14 | + function() { |
|
| 15 | 15 | // Load in dependency maps |
| 16 | - require __DIR__ . '/dependency_maps/cache_deps.php'; |
|
| 17 | - require __DIR__ . '/dependency_maps/mime_deps.php'; |
|
| 18 | - require __DIR__ . '/dependency_maps/message_deps.php'; |
|
| 19 | - require __DIR__ . '/dependency_maps/transport_deps.php'; |
|
| 16 | + require __DIR__.'/dependency_maps/cache_deps.php'; |
|
| 17 | + require __DIR__.'/dependency_maps/mime_deps.php'; |
|
| 18 | + require __DIR__.'/dependency_maps/message_deps.php'; |
|
| 19 | + require __DIR__.'/dependency_maps/transport_deps.php'; |
|
| 20 | 20 | |
| 21 | 21 | // Load in global library preferences |
| 22 | - require __DIR__ . '/preferences.php'; |
|
| 22 | + require __DIR__.'/preferences.php'; |
|
| 23 | 23 | } |
| 24 | 24 | ); |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -require __DIR__ . '/../mime_types.php'; |
|
| 3 | +require __DIR__.'/../mime_types.php'; |
|
| 4 | 4 | |
| 5 | 5 | Swift_DependencyContainer::getInstance() |
| 6 | 6 | ->register('properties.charset') |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | foreach ($this->_params as $name => $value) { |
| 133 | 133 | if (null !== $value) { |
| 134 | 134 | // Add the parameter |
| 135 | - $body .= '; ' . $this->_createParameter($name, $value); |
|
| 135 | + $body .= '; '.$this->_createParameter($name, $value); |
|
| 136 | 136 | } |
| 137 | 137 | } |
| 138 | 138 | |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | $tokens[count($tokens) - 1] .= ';'; |
| 161 | 161 | $tokens = array_merge( |
| 162 | 162 | $tokens, |
| 163 | - $this->generateTokenLines(' ' . $this->_createParameter($name, $value)) |
|
| 163 | + $this->generateTokenLines(' '.$this->_createParameter($name, $value)) |
|
| 164 | 164 | ); |
| 165 | 165 | } |
| 166 | 166 | } |
@@ -182,18 +182,18 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | $encoded = false; |
| 184 | 184 | // Allow room for parameter name, indices, "=" and DQUOTEs |
| 185 | - $maxValueLength = $this->getMaxLineLength() - strlen($name . '=*N"";') - 1; |
|
| 185 | + $maxValueLength = $this->getMaxLineLength() - strlen($name.'=*N"";') - 1; |
|
| 186 | 186 | $firstLineOffset = 0; |
| 187 | 187 | |
| 188 | 188 | // If it's not already a valid parameter value... |
| 189 | - if (!preg_match('/^' . self::TOKEN_REGEX . '$/D', $value)) { |
|
| 189 | + if (!preg_match('/^'.self::TOKEN_REGEX.'$/D', $value)) { |
|
| 190 | 190 | // TODO: text, or something else?? |
| 191 | 191 | // ... and it's not ascii |
| 192 | 192 | if (!preg_match('/^[\x00-\x08\x0B\x0C\x0E-\x7F]*$/D', $value)) { |
| 193 | 193 | $encoded = true; |
| 194 | 194 | // Allow space for the indices, charset and language |
| 195 | - $maxValueLength = $this->getMaxLineLength() - strlen($name . '*N*="";') - 1; |
|
| 196 | - $firstLineOffset = strlen($this->getCharset() . "'" . $this->getLanguage() . "'"); |
|
| 195 | + $maxValueLength = $this->getMaxLineLength() - strlen($name.'*N*="";') - 1; |
|
| 196 | + $firstLineOffset = strlen($this->getCharset()."'".$this->getLanguage()."'"); |
|
| 197 | 197 | } |
| 198 | 198 | } |
| 199 | 199 | |
@@ -219,12 +219,12 @@ discard block |
||
| 219 | 219 | if (count($valueLines) > 1) { |
| 220 | 220 | $paramLines = array(); |
| 221 | 221 | foreach ($valueLines as $i => $line) { |
| 222 | - $paramLines[] = $name . '*' . $i . $this->_getEndOfParameterValue($line, true, $i === 0); |
|
| 222 | + $paramLines[] = $name.'*'.$i.$this->_getEndOfParameterValue($line, true, $i === 0); |
|
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | return implode(";\r\n ", $paramLines); |
| 226 | 226 | } else { |
| 227 | - return $name . $this->_getEndOfParameterValue( |
|
| 227 | + return $name.$this->_getEndOfParameterValue( |
|
| 228 | 228 | $valueLines[0], |
| 229 | 229 | $encoded, |
| 230 | 230 | true |
@@ -243,18 +243,18 @@ discard block |
||
| 243 | 243 | */ |
| 244 | 244 | private function _getEndOfParameterValue($value, $encoded = false, $firstLine = false) |
| 245 | 245 | { |
| 246 | - if (!preg_match('/^' . self::TOKEN_REGEX . '$/D', $value)) { |
|
| 247 | - $value = '"' . $value . '"'; |
|
| 246 | + if (!preg_match('/^'.self::TOKEN_REGEX.'$/D', $value)) { |
|
| 247 | + $value = '"'.$value.'"'; |
|
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | $prepend = '='; |
| 251 | 251 | if ($encoded) { |
| 252 | 252 | $prepend = '*='; |
| 253 | 253 | if ($firstLine) { |
| 254 | - $prepend = '*=' . $this->getCharset() . "'" . $this->getLanguage() . "'"; |
|
| 254 | + $prepend = '*='.$this->getCharset()."'".$this->getLanguage()."'"; |
|
| 255 | 255 | } |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | - return $prepend . $value; |
|
| 258 | + return $prepend.$value; |
|
| 259 | 259 | } |
| 260 | 260 | } |
@@ -113,7 +113,7 @@ |
||
| 113 | 113 | */ |
| 114 | 114 | public function toString() |
| 115 | 115 | { |
| 116 | - return $this->_fieldName . ': ' . $this->_value; |
|
| 116 | + return $this->_fieldName.': '.$this->_value; |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** |
@@ -218,17 +218,17 @@ discard block |
||
| 218 | 218 | // Treat token as exactly what was given |
| 219 | 219 | $phraseStr = $string; |
| 220 | 220 | // If it's not valid |
| 221 | - if (!preg_match('/^' . self::PHRASE_PATTERN . '$/D', $phraseStr)) { |
|
| 221 | + if (!preg_match('/^'.self::PHRASE_PATTERN.'$/D', $phraseStr)) { |
|
| 222 | 222 | // .. but it is just ascii text, try escaping some characters |
| 223 | 223 | // and make it a quoted-string |
| 224 | 224 | if (preg_match('/^[\x00-\x08\x0B\x0C\x0E-\x7F]*$/D', $phraseStr)) { |
| 225 | 225 | $phraseStr = $this->escapeSpecials($phraseStr, array('"')); |
| 226 | - $phraseStr = '"' . $phraseStr . '"'; |
|
| 226 | + $phraseStr = '"'.$phraseStr.'"'; |
|
| 227 | 227 | } else { |
| 228 | 228 | // ... otherwise it needs encoding |
| 229 | 229 | // Determine space remaining on line if first line |
| 230 | 230 | if ($shorten) { |
| 231 | - $usedLength = strlen($header->getFieldName() . ': '); |
|
| 231 | + $usedLength = strlen($header->getFieldName().': '); |
|
| 232 | 232 | } else { |
| 233 | 233 | $usedLength = 0; |
| 234 | 234 | } |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | protected function escapeSpecials($token, array $include = array()) |
| 251 | 251 | { |
| 252 | 252 | foreach (array_merge(array('\\'), $include) as $char) { |
| 253 | - $token = str_replace($char, '\\' . $char, $token); |
|
| 253 | + $token = str_replace($char, '\\'.$char, $token); |
|
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | return $token; |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | protected function encodeWords(Swift_Mime_Header $header, $input, $usedLength = -1) |
| 269 | 269 | { |
| 270 | 270 | $value = ''; |
| 271 | - $usedLength = (int)$usedLength; |
|
| 271 | + $usedLength = (int) $usedLength; |
|
| 272 | 272 | |
| 273 | 273 | $tokens = $this->getEncodableWordTokens($input); |
| 274 | 274 | |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | if (-1 === $usedLength) { |
| 288 | - $usedLength = strlen($header->getFieldName() . ': ') + strlen($value); |
|
| 288 | + $usedLength = strlen($header->getFieldName().': ') + strlen($value); |
|
| 289 | 289 | } |
| 290 | 290 | $value .= $this->getTokenAsEncodedWord($token, $usedLength); |
| 291 | 291 | |
@@ -361,10 +361,10 @@ discard block |
||
| 361 | 361 | $charsetDecl = $this->_charset; |
| 362 | 362 | |
| 363 | 363 | if (isset($this->_lang)) { |
| 364 | - $charsetDecl .= '*' . $this->_lang; |
|
| 364 | + $charsetDecl .= '*'.$this->_lang; |
|
| 365 | 365 | } |
| 366 | 366 | |
| 367 | - $encodingWrapperLength = strlen('=?' . $charsetDecl . '?' . $this->_encoder->getName() . '??='); |
|
| 367 | + $encodingWrapperLength = strlen('=?'.$charsetDecl.'?'.$this->_encoder->getName().'??='); |
|
| 368 | 368 | |
| 369 | 369 | if ($firstLineOffset >= 75) { |
| 370 | 370 | // Does this logic need to be here? |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | if (Swift::strtolowerWithStaticCache($this->_charset) !== 'iso-2022-jp') { |
| 381 | 381 | // special encoding for iso-2022-jp using mb_encode_mimeheader |
| 382 | 382 | foreach ($encodedTextLines as $lineNum => $line) { |
| 383 | - $encodedTextLines[$lineNum] = '=?' . $charsetDecl . '?' . $this->_encoder->getName() . '?' . $line . '?='; |
|
| 383 | + $encodedTextLines[$lineNum] = '=?'.$charsetDecl.'?'.$this->_encoder->getName().'?'.$line.'?='; |
|
| 384 | 384 | } |
| 385 | 385 | } |
| 386 | 386 | |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | { |
| 470 | 470 | $lineCount = 0; |
| 471 | 471 | $headerLines = array(); |
| 472 | - $headerLines[] = $this->_name . ': '; |
|
| 472 | + $headerLines[] = $this->_name.': '; |
|
| 473 | 473 | $currentLine = &$headerLines[$lineCount++]; |
| 474 | 474 | |
| 475 | 475 | // Build all tokens back into compliant header |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | if ( |
| 479 | 479 | ("\r\n" === $token) |
| 480 | 480 | || |
| 481 | - ($i > 0 && strlen($currentLine . $token) > $this->_lineLength) |
|
| 481 | + ($i > 0 && strlen($currentLine.$token) > $this->_lineLength) |
|
| 482 | 482 | && |
| 483 | 483 | 0 < strlen($currentLine) |
| 484 | 484 | ) { |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | } |
| 494 | 494 | |
| 495 | 495 | // Implode with FWS (RFC 2822, 2.2.3) |
| 496 | - return implode("\r\n", $headerLines) . "\r\n"; |
|
| 496 | + return implode("\r\n", $headerLines)."\r\n"; |
|
| 497 | 497 | } |
| 498 | 498 | |
| 499 | 499 | /** |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | $angleAddrs = array(); |
| 157 | 157 | |
| 158 | 158 | foreach ($this->_ids as $id) { |
| 159 | - $angleAddrs[] = '<' . $id . '>'; |
|
| 159 | + $angleAddrs[] = '<'.$id.'>'; |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | $this->setCachedValue(implode(' ', $angleAddrs)); |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | { |
| 177 | 177 | if ($this->_emailValidator->isValidSimpleWrapper($id) === false) { |
| 178 | 178 | throw new Swift_RfcComplianceException( |
| 179 | - 'Invalid ID given <' . $id . '>' |
|
| 179 | + 'Invalid ID given <'.$id.'>' |
|
| 180 | 180 | ); |
| 181 | 181 | } |
| 182 | 182 | } |