@@ -70,7 +70,7 @@ |
||
70 | 70 | * |
71 | 71 | * This method returns a UNIX timestamp. |
72 | 72 | * |
73 | - * @return mixed |
|
73 | + * @return integer|null |
|
74 | 74 | */ |
75 | 75 | public function getFieldBodyModel() |
76 | 76 | { |
@@ -228,6 +228,6 @@ |
||
228 | 228 | */ |
229 | 229 | protected function _convertString($string) |
230 | 230 | { |
231 | - return UTF8::encode($this->getCharset(),$string, false); |
|
231 | + return UTF8::encode($this->getCharset(), $string, false); |
|
232 | 232 | } |
233 | 233 | } |
@@ -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 | } |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | $phraseStr = $string; |
230 | 230 | |
231 | 231 | // If it's not valid ... |
232 | - if (!preg_match('/^' . self::PHRASE_PATTERN . '$/D', $phraseStr)) { |
|
232 | + if (!preg_match('/^'.self::PHRASE_PATTERN.'$/D', $phraseStr)) { |
|
233 | 233 | |
234 | 234 | if (preg_match('/^[\x00-\x08\x0B\x0C\x0E-\x7F]*$/D', $phraseStr)) { |
235 | 235 | // ... but it is just ascii text, try escaping some characters |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | } |
241 | 241 | |
242 | 242 | // ... and make it a quoted-string. |
243 | - $phraseStr = '"' . $phraseStr . '"'; |
|
243 | + $phraseStr = '"'.$phraseStr.'"'; |
|
244 | 244 | } |
245 | 245 | |
246 | 246 | return $phraseStr; |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | protected function escapeSpecials($token, array $include = array()) |
258 | 258 | { |
259 | 259 | foreach (array_merge(array('\\'), $include) as $char) { |
260 | - $token = str_replace($char, '\\' . $char, $token); |
|
260 | + $token = str_replace($char, '\\'.$char, $token); |
|
261 | 261 | } |
262 | 262 | |
263 | 263 | return $token; |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | $token = substr($token, 1); |
290 | 290 | } |
291 | 291 | |
292 | - $usedLength = strlen($header->getFieldName() . ': ') + strlen($value); |
|
292 | + $usedLength = strlen($header->getFieldName().': ') + strlen($value); |
|
293 | 293 | $value .= $this->getTokenAsEncodedWord($token, $usedLength); |
294 | 294 | |
295 | 295 | $header->setMaxLineLength(74); // Forcefully override (we need to save two chars for quoting) |
@@ -364,10 +364,10 @@ discard block |
||
364 | 364 | $charsetDecl = $this->_charset; |
365 | 365 | |
366 | 366 | if ($this->_lang) { |
367 | - $charsetDecl .= '*' . $this->_lang; |
|
367 | + $charsetDecl .= '*'.$this->_lang; |
|
368 | 368 | } |
369 | 369 | |
370 | - $encodingWrapperLength = strlen('=?' . $charsetDecl . '?' . $this->_encoder->getName() . '??='); |
|
370 | + $encodingWrapperLength = strlen('=?'.$charsetDecl.'?'.$this->_encoder->getName().'??='); |
|
371 | 371 | |
372 | 372 | if ($firstLineOffset >= 75) { |
373 | 373 | // Does this logic need to be here? |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | if (Swift::strtolowerWithStaticCache($this->_charset) !== 'iso-2022-jp') { |
384 | 384 | // special encoding for iso-2022-jp using mb_encode_mimeheader |
385 | 385 | foreach ($encodedTextLines as $lineNum => $line) { |
386 | - $encodedTextLines[$lineNum] = '=?' . $charsetDecl . '?' . $this->_encoder->getName() . '?' . $line . '?='; |
|
386 | + $encodedTextLines[$lineNum] = '=?'.$charsetDecl.'?'.$this->_encoder->getName().'?'.$line.'?='; |
|
387 | 387 | } |
388 | 388 | } |
389 | 389 | |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | { |
478 | 478 | $lineCount = 0; |
479 | 479 | $headerLines = array(); |
480 | - $headerLines[] = $this->_name . ': '; |
|
480 | + $headerLines[] = $this->_name.': '; |
|
481 | 481 | $currentLine = &$headerLines[$lineCount++]; |
482 | 482 | |
483 | 483 | // Build all tokens back into compliant header |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | ( |
493 | 493 | $i > 0 |
494 | 494 | && |
495 | - strlen($currentLine . $token) > $this->_lineLength |
|
495 | + strlen($currentLine.$token) > $this->_lineLength |
|
496 | 496 | ) |
497 | 497 | ) |
498 | 498 | ) { |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | } |
508 | 508 | |
509 | 509 | // Implode with FWS (RFC 2822, 2.2.3) |
510 | - return implode("\r\n", $headerLines) . "\r\n"; |
|
510 | + return implode("\r\n", $headerLines)."\r\n"; |
|
511 | 511 | } |
512 | 512 | |
513 | 513 | /** |
@@ -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,19 +182,19 @@ 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 | |
195 | 195 | // Allow space for the indices, charset and language. |
196 | - $maxValueLength = $this->getMaxLineLength() - strlen($name . '*N*="";') - 1; |
|
197 | - $firstLineOffset = strlen($this->getCharset() . "'" . $this->getLanguage() . "'"); |
|
196 | + $maxValueLength = $this->getMaxLineLength() - strlen($name.'*N*="";') - 1; |
|
197 | + $firstLineOffset = strlen($this->getCharset()."'".$this->getLanguage()."'"); |
|
198 | 198 | } |
199 | 199 | } |
200 | 200 | |
@@ -224,13 +224,13 @@ discard block |
||
224 | 224 | if (count($valueLines) > 1) { |
225 | 225 | $paramLines = array(); |
226 | 226 | foreach ($valueLines as $i => $line) { |
227 | - $paramLines[] = $name . '*' . $i . $this->_getEndOfParameterValue($line, true, $i === 0); |
|
227 | + $paramLines[] = $name.'*'.$i.$this->_getEndOfParameterValue($line, true, $i === 0); |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | return implode(";\r\n ", $paramLines); |
231 | 231 | } |
232 | 232 | |
233 | - return $name . $this->_getEndOfParameterValue( |
|
233 | + return $name.$this->_getEndOfParameterValue( |
|
234 | 234 | $valueLines[0], |
235 | 235 | $encoded, |
236 | 236 | true |
@@ -248,18 +248,18 @@ discard block |
||
248 | 248 | */ |
249 | 249 | private function _getEndOfParameterValue($value, $encoded = false, $firstLine = false) |
250 | 250 | { |
251 | - if (!preg_match('/^' . self::TOKEN_REGEX . '$/D', $value)) { |
|
252 | - $value = '"' . $value . '"'; |
|
251 | + if (!preg_match('/^'.self::TOKEN_REGEX.'$/D', $value)) { |
|
252 | + $value = '"'.$value.'"'; |
|
253 | 253 | } |
254 | 254 | |
255 | 255 | $prepend = '='; |
256 | 256 | if ($encoded) { |
257 | 257 | $prepend = '*='; |
258 | 258 | if ($firstLine) { |
259 | - $prepend = '*=' . $this->getCharset() . "'" . $this->getLanguage() . "'"; |
|
259 | + $prepend = '*='.$this->getCharset()."'".$this->getLanguage()."'"; |
|
260 | 260 | } |
261 | 261 | } |
262 | 262 | |
263 | - return $prepend . $value; |
|
263 | + return $prepend.$value; |
|
264 | 264 | } |
265 | 265 | } |