@@ -167,7 +167,7 @@ |
||
| 167 | 167 | public function getContentDisposition($default = 'inline') |
| 168 | 168 | { |
| 169 | 169 | $value = $this->getHeaderValue(HeaderConsts::CONTENT_DISPOSITION); |
| 170 | - if ($value === null || !in_array($value, [ 'inline', 'attachment' ])) { |
|
| 170 | + if ($value === null || !in_array($value, ['inline', 'attachment'])) { |
|
| 171 | 171 | return $default; |
| 172 | 172 | } |
| 173 | 173 | return strtolower($value); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | public function overwrite8bitContentEncoding(IMessage $message) |
| 102 | 102 | { |
| 103 | - $parts = $message->getAllParts(function (IMessagePart $part) { |
|
| 103 | + $parts = $message->getAllParts(function(IMessagePart $part) { |
|
| 104 | 104 | return strcasecmp($part->getContentTransferEncoding(), '8bit') === 0; |
| 105 | 105 | }); |
| 106 | 106 | foreach ($parts as $part) { |
@@ -108,8 +108,7 @@ discard block |
||
| 108 | 108 | $part->setRawHeader( |
| 109 | 109 | HeaderConsts::CONTENT_TRANSFER_ENCODING, |
| 110 | 110 | ($contentType === 'text/plain' || $contentType === 'text/html') ? |
| 111 | - 'quoted-printable' : |
|
| 112 | - 'base64' |
|
| 111 | + 'quoted-printable' : 'base64' |
|
| 113 | 112 | ); |
| 114 | 113 | } |
| 115 | 114 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | public function getUniqueBoundary($mimeType) |
| 48 | 48 | { |
| 49 | 49 | $type = ltrim(strtoupper(preg_replace('/^(multipart\/(.{3}).*|.*)$/i', '$2-', $mimeType)), '-'); |
| 50 | - return uniqid('----=MMP-' . $type . '-', true); |
|
| 50 | + return uniqid('----=MMP-'.$type.'-', true); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | /** |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $part->setRawHeader( |
| 63 | 63 | HeaderConsts::CONTENT_TYPE, |
| 64 | 64 | "$mimeType;\r\n\tboundary=\"" |
| 65 | - . $this->getUniqueBoundary($mimeType) . '"' |
|
| 65 | + . $this->getUniqueBoundary($mimeType).'"' |
|
| 66 | 66 | ); |
| 67 | 67 | $part->notify(); |
| 68 | 68 | } |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | */ |
| 204 | 204 | public function moveAllNonMultiPartsToMessageExcept(IMessage $message, IMimePart $from, $exceptMimeType) |
| 205 | 205 | { |
| 206 | - $parts = $from->getAllParts(function (IMessagePart $part) use ($exceptMimeType) { |
|
| 206 | + $parts = $from->getAllParts(function(IMessagePart $part) use ($exceptMimeType) { |
|
| 207 | 207 | if ($part instanceof IMimePart && $part->isMultiPart()) { |
| 208 | 208 | return false; |
| 209 | 209 | } |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | public function createAndAddPartForAttachment(IMessage $message, $resource, $mimeType, $disposition, $filename = null, $encoding = 'base64') |
| 331 | 331 | { |
| 332 | 332 | if ($filename === null) { |
| 333 | - $filename = 'file' . uniqid(); |
|
| 333 | + $filename = 'file'.uniqid(); |
|
| 334 | 334 | } |
| 335 | 335 | |
| 336 | 336 | $safe = iconv('UTF-8', 'US-ASCII//translit//ignore', $filename); |
@@ -30,10 +30,10 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | public static function fromAttachmentFilter() |
| 32 | 32 | { |
| 33 | - return function (IMessagePart $part) { |
|
| 33 | + return function(IMessagePart $part) { |
|
| 34 | 34 | $type = $part->getContentType(); |
| 35 | 35 | $disp = $part->getContentDisposition(); |
| 36 | - if (in_array($type, [ 'text/plain', 'text/html' ]) && $disp !== null && strcasecmp($disp, 'inline') === 0) { |
|
| 36 | + if (in_array($type, ['text/plain', 'text/html']) && $disp !== null && strcasecmp($disp, 'inline') === 0) { |
|
| 37 | 37 | return false; |
| 38 | 38 | } |
| 39 | 39 | return !(($part instanceof IMimePart) |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | public static function fromHeaderValue($name, $value, $excludeSignedParts = true) |
| 58 | 58 | { |
| 59 | - return function (IMessagePart $part) use ($name, $value, $excludeSignedParts) { |
|
| 59 | + return function(IMessagePart $part) use ($name, $value, $excludeSignedParts) { |
|
| 60 | 60 | if ($part instanceof IMimePart) { |
| 61 | 61 | if ($excludeSignedParts && $part->isSignaturePart()) { |
| 62 | 62 | return false; |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | public static function fromContentType($mimeType) |
| 78 | 78 | { |
| 79 | - return function (IMessagePart $part) use ($mimeType) { |
|
| 79 | + return function(IMessagePart $part) use ($mimeType) { |
|
| 80 | 80 | return strcasecmp($part->getContentType(), $mimeType) === 0; |
| 81 | 81 | }; |
| 82 | 82 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | */ |
| 91 | 91 | public static function fromInlineContentType($mimeType) |
| 92 | 92 | { |
| 93 | - return function (IMessagePart $part) use ($mimeType) { |
|
| 93 | + return function(IMessagePart $part) use ($mimeType) { |
|
| 94 | 94 | $disp = $part->getContentDisposition(); |
| 95 | 95 | return (strcasecmp($part->getContentType(), $mimeType) === 0) && ($disp === null |
| 96 | 96 | || strcasecmp($disp, 'attachment') !== 0); |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | public static function fromDisposition($disposition, $includeMultipart = false, $includeSignedParts = false) |
| 113 | 113 | { |
| 114 | - return function (IMessagePart $part) use ($disposition, $includeMultipart, $includeSignedParts) { |
|
| 114 | + return function(IMessagePart $part) use ($disposition, $includeMultipart, $includeSignedParts) { |
|
| 115 | 115 | if (($part instanceof IMimePart) && ((!$includeMultipart && $part->isMultiPart()) || (!$includeSignedParts && $part->isSignaturePart()))) { |
| 116 | 116 | return false; |
| 117 | 117 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | private function getAllPartsIterator() |
| 43 | 43 | { |
| 44 | 44 | $iter = new AppendIterator(); |
| 45 | - $iter->append(new ArrayIterator([ $this ])); |
|
| 45 | + $iter->append(new ArrayIterator([$this])); |
|
| 46 | 46 | $iter->append(new RecursiveIteratorIterator($this->partChildrenContainer, RecursiveIteratorIterator::SELF_FIRST)); |
| 47 | 47 | return $iter; |
| 48 | 48 | } |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | public function getPartByContentId($contentId) |
| 130 | 130 | { |
| 131 | 131 | $sanitized = preg_replace('/^\s*<|>\s*$/', '', $contentId); |
| 132 | - return $this->getPart(0, function (IMessagePart $part) use ($sanitized) { |
|
| 132 | + return $this->getPart(0, function(IMessagePart $part) use ($sanitized) { |
|
| 133 | 133 | $cid = $part->getContentId(); |
| 134 | 134 | return ($cid !== null && strcasecmp($cid, $sanitized) === 0); |
| 135 | 135 | }); |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | */ |
| 54 | 54 | public function autoRegister($class) |
| 55 | 55 | { |
| 56 | - $fn = function ($c) use ($class) { |
|
| 56 | + $fn = function($c) use ($class) { |
|
| 57 | 57 | $ref = new ReflectionClass($class); |
| 58 | 58 | $cargs = ($ref->getConstructor() !== null) ? $ref->getConstructor()->getParameters() : []; |
| 59 | 59 | $ap = []; |