@@ -39,11 +39,11 @@ |
||
| 39 | 39 | $firstLine = ''; |
| 40 | 40 | |
| 41 | 41 | if (0 != $firstLineOffset) { |
| 42 | - $firstLine = \substr($encodedString, 0, $maxLineLength - $firstLineOffset) . "\r\n"; |
|
| 42 | + $firstLine = \substr($encodedString, 0, $maxLineLength - $firstLineOffset)."\r\n"; |
|
| 43 | 43 | $encodedString = \substr($encodedString, $maxLineLength - $firstLineOffset); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - return $firstLine . \trim(\chunk_split($encodedString, $maxLineLength, "\r\n")); |
|
| 46 | + return $firstLine.\trim(\chunk_split($encodedString, $maxLineLength, "\r\n")); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -95,7 +95,7 @@ |
||
| 95 | 95 | */ |
| 96 | 96 | public function getCharset() |
| 97 | 97 | { |
| 98 | - return (string)$this->_getHeaderParameter('Content-Type', 'charset'); |
|
| 98 | + return (string) $this->_getHeaderParameter('Content-Type', 'charset'); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | /** |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | */ |
| 242 | 242 | public function getId() |
| 243 | 243 | { |
| 244 | - $tmp = (array)$this->_getHeaderFieldModel($this->_getIdField()); |
|
| 244 | + $tmp = (array) $this->_getHeaderFieldModel($this->_getIdField()); |
|
| 245 | 245 | |
| 246 | 246 | return $this->_headers->has($this->_getIdField()) ? current($tmp) : $this->_id; |
| 247 | 247 | } |
@@ -468,7 +468,7 @@ discard block |
||
| 468 | 468 | public function getBoundary() |
| 469 | 469 | { |
| 470 | 470 | if (!isset($this->_boundary)) { |
| 471 | - $this->_boundary = '_=_swift_v5_' . time() . '_' . md5(getmypid() . mt_rand() . uniqid('', true)) . '_=_'; |
|
| 471 | + $this->_boundary = '_=_swift_v5_'.time().'_'.md5(getmypid().mt_rand().uniqid('', true)).'_=_'; |
|
| 472 | 472 | } |
| 473 | 473 | |
| 474 | 474 | return $this->_boundary; |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | if ($this->_cache->hasKey($this->_cacheKey, 'body')) { |
| 544 | 544 | $body = $this->_cache->getString($this->_cacheKey, 'body'); |
| 545 | 545 | } else { |
| 546 | - $body = "\r\n" . $this->_encoder->encodeString($this->getBody(), 0, $this->getMaxLineLength()); |
|
| 546 | + $body = "\r\n".$this->_encoder->encodeString($this->getBody(), 0, $this->getMaxLineLength()); |
|
| 547 | 547 | $this->_cache->setString($this->_cacheKey, 'body', $body, Swift_KeyCache::MODE_WRITE); |
| 548 | 548 | } |
| 549 | 549 | $string .= $body; |
@@ -551,10 +551,10 @@ discard block |
||
| 551 | 551 | |
| 552 | 552 | if (!empty($this->_immediateChildren)) { |
| 553 | 553 | foreach ($this->_immediateChildren as $child) { |
| 554 | - $string .= "\r\n\r\n--" . $this->getBoundary() . "\r\n"; |
|
| 554 | + $string .= "\r\n\r\n--".$this->getBoundary()."\r\n"; |
|
| 555 | 555 | $string .= $child->toString(); |
| 556 | 556 | } |
| 557 | - $string .= "\r\n\r\n--" . $this->getBoundary() . "--\r\n"; |
|
| 557 | + $string .= "\r\n\r\n--".$this->getBoundary()."--\r\n"; |
|
| 558 | 558 | } |
| 559 | 559 | |
| 560 | 560 | return $string; |
@@ -621,10 +621,10 @@ discard block |
||
| 621 | 621 | |
| 622 | 622 | if (!empty($this->_immediateChildren)) { |
| 623 | 623 | foreach ($this->_immediateChildren as $child) { |
| 624 | - $is->write("\r\n\r\n--" . $this->getBoundary() . "\r\n"); |
|
| 624 | + $is->write("\r\n\r\n--".$this->getBoundary()."\r\n"); |
|
| 625 | 625 | $child->toByteStream($is); |
| 626 | 626 | } |
| 627 | - $is->write("\r\n\r\n--" . $this->getBoundary() . "--\r\n"); |
|
| 627 | + $is->write("\r\n\r\n--".$this->getBoundary()."--\r\n"); |
|
| 628 | 628 | } |
| 629 | 629 | } |
| 630 | 630 | |
@@ -753,7 +753,7 @@ discard block |
||
| 753 | 753 | */ |
| 754 | 754 | private function _generateNewCacheKey() |
| 755 | 755 | { |
| 756 | - return md5(getmypid() . '.' . time() . '.' . uniqid(mt_rand(), true)); |
|
| 756 | + return md5(getmypid().'.'.time().'.'.uniqid(mt_rand(), true)); |
|
| 757 | 757 | } |
| 758 | 758 | |
| 759 | 759 | /** |
@@ -846,13 +846,13 @@ discard block |
||
| 846 | 846 | } |
| 847 | 847 | |
| 848 | 848 | $realLevel = $child->getNestingLevel(); |
| 849 | - $lowercaseType = Swift::strtolowerWithStaticCache((string)$child->getContentType()); |
|
| 849 | + $lowercaseType = Swift::strtolowerWithStaticCache((string) $child->getContentType()); |
|
| 850 | 850 | |
| 851 | 851 | if (isset($filter[$realLevel], $filter[$realLevel][$lowercaseType])) { |
| 852 | - return (int)$filter[$realLevel][$lowercaseType]; |
|
| 852 | + return (int) $filter[$realLevel][$lowercaseType]; |
|
| 853 | 853 | } |
| 854 | 854 | |
| 855 | - return (int)$realLevel; |
|
| 855 | + return (int) $realLevel; |
|
| 856 | 856 | } |
| 857 | 857 | |
| 858 | 858 | /** |
@@ -903,8 +903,7 @@ discard block |
||
| 903 | 903 | foreach ($this->_immediateChildren as $child) { |
| 904 | 904 | $type = $child->getContentType(); |
| 905 | 905 | $level = array_key_exists($type, $this->_alternativePartOrder) ? |
| 906 | - $this->_alternativePartOrder[$type] : |
|
| 907 | - max($this->_alternativePartOrder) + 1; |
|
| 906 | + $this->_alternativePartOrder[$type] : max($this->_alternativePartOrder) + 1; |
|
| 908 | 907 | |
| 909 | 908 | if (empty($sorted[$level])) { |
| 910 | 909 | $sorted[$level] = array(); |