@@ -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 | } |
@@ -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 | } |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | $mailboxStr = $email; |
| 334 | 334 | if ($name) { |
| 335 | 335 | $nameStr = $this->createDisplayNameString($name, empty($strings)); |
| 336 | - $mailboxStr = $nameStr . ' <' . $mailboxStr . '>'; |
|
| 336 | + $mailboxStr = $nameStr.' <'.$mailboxStr.'>'; |
|
| 337 | 337 | } |
| 338 | 338 | $strings[] = $mailboxStr; |
| 339 | 339 | } |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | private function _assertValidAddress($address) |
| 352 | 352 | { |
| 353 | 353 | if ($this->_emailValidator->isValidWrapper($address) === false) { |
| 354 | - throw new Swift_RfcComplianceException('Address in mailbox given [' . $address . '] does not comply with RFC 2822, 3.6.2.'); |
|
| 354 | + throw new Swift_RfcComplianceException('Address in mailbox given ['.$address.'] does not comply with RFC 2822, 3.6.2.'); |
|
| 355 | 355 | } |
| 356 | 356 | } |
| 357 | 357 | } |
@@ -126,7 +126,7 @@ |
||
| 126 | 126 | { |
| 127 | 127 | if (!$this->getCachedValue()) { |
| 128 | 128 | if (isset($this->_address)) { |
| 129 | - $this->setCachedValue('<' . $this->_address . '>'); |
|
| 129 | + $this->setCachedValue('<'.$this->_address.'>'); |
|
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | protected function getSafeMapShareId() |
| 39 | 39 | { |
| 40 | - return get_class($this) . ($this->_dotEscape ? '.dotEscape' : ''); |
|
| 40 | + return get_class($this).($this->_dotEscape ? '.dotEscape' : ''); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | protected function initSafeMap() |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $newLineLength = $lineLen + ($i === false ? $size : $i); |
| 101 | 101 | |
| 102 | 102 | if ($currentLine && $newLineLength >= $thisLineLength) { |
| 103 | - $is->write($prepend . $this->_standardize($currentLine)); |
|
| 103 | + $is->write($prepend.$this->_standardize($currentLine)); |
|
| 104 | 104 | $currentLine = ''; |
| 105 | 105 | $prepend = "=\r\n"; |
| 106 | 106 | $thisLineLength = $maxLineLength; |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | if ($currentLine !== '') { |
| 121 | - $is->write($prepend . $this->_standardize($currentLine)); |
|
| 121 | + $is->write($prepend.$this->_standardize($currentLine)); |
|
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | 124 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | if ($atEOF) { |
| 47 | 47 | $streamTheseBytes = $base64ReadBufferRemainderBytes; |
| 48 | 48 | } else { |
| 49 | - $streamTheseBytes = $base64ReadBufferRemainderBytes . $readBytes; |
|
| 49 | + $streamTheseBytes = $base64ReadBufferRemainderBytes.$readBytes; |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | $base64ReadBufferRemainderBytes = null; |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $thisMaxLineLength = $maxLineLength - $remainder - $firstLineOffset; |
| 72 | 72 | |
| 73 | 73 | while ($thisMaxLineLength < strlen($encoded)) { |
| 74 | - $encodedTransformed .= substr($encoded, 0, $thisMaxLineLength) . "\r\n"; |
|
| 74 | + $encodedTransformed .= substr($encoded, 0, $thisMaxLineLength)."\r\n"; |
|
| 75 | 75 | $firstLineOffset = 0; |
| 76 | 76 | $encoded = substr($encoded, $thisMaxLineLength); |
| 77 | 77 | $thisMaxLineLength = $maxLineLength; |