@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * @var string[] non mime content fields that are not related to the content |
24 | 24 | * of a part. |
25 | 25 | */ |
26 | - private static $nonMimeContentFields = [ 'contentreturn', 'contentidentifier' ]; |
|
26 | + private static $nonMimeContentFields = ['contentreturn', 'contentidentifier']; |
|
27 | 27 | |
28 | 28 | /** |
29 | 29 | * Returns true if the passed header's name is a Content-* header other than |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $this->copyHeader($from, $to, HeaderConsts::CONTENT_TRANSFER_ENCODING); |
97 | 97 | } |
98 | 98 | foreach ($from->getAllHeaders() as $header) { |
99 | - if ($this->isMimeContentField($header, [ 'contenttype', 'contenttransferencoding' ])) { |
|
99 | + if ($this->isMimeContentField($header, ['contenttype', 'contenttransferencoding'])) { |
|
100 | 100 | $this->copyHeader($from, $to, $header->getName()); |
101 | 101 | } |
102 | 102 | } |
@@ -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 | } |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | public function createAndAddPartForAttachment(IMessage $message, $resource, $mimeType, $disposition, $filename = null, $encoding = 'base64') |
332 | 332 | { |
333 | 333 | if ($filename === null) { |
334 | - $filename = 'file' . uniqid(); |
|
334 | + $filename = 'file'.uniqid(); |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | $safe = iconv('UTF-8', 'US-ASCII//translit//ignore', $filename); |
@@ -108,8 +108,7 @@ |
||
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 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | $this->children, |
103 | 103 | $index, |
104 | 104 | 0, |
105 | - [ $part ] |
|
105 | + [$part] |
|
106 | 106 | ); |
107 | 107 | } |
108 | 108 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | { |
138 | 138 | if (!$value instanceof IMessagePart) { |
139 | 139 | throw new InvalidArgumentException( |
140 | - get_class($value) . ' is not a ZBateson\MailMimeParser\Message\IMessagePart' |
|
140 | + get_class($value).' is not a ZBateson\MailMimeParser\Message\IMessagePart' |
|
141 | 141 | ); |
142 | 142 | } |
143 | 143 | $index = ($offset === null) ? count($this->children) : $offset; |
@@ -167,7 +167,7 @@ |
||
167 | 167 | public function getContentDisposition($default = 'inline') |
168 | 168 | { |
169 | 169 | $value = strtolower($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 $value; |
@@ -30,9 +30,9 @@ |
||
30 | 30 | */ |
31 | 31 | public static function fromAttachmentFilter() |
32 | 32 | { |
33 | - return function (IMessagePart $part) { |
|
33 | + return function(IMessagePart $part) { |
|
34 | 34 | $type = strtolower($part->getContentType()); |
35 | - if (in_array($type, [ 'text/plain', 'text/html' ]) && strcasecmp($part->getContentDisposition(), 'inline') === 0) { |
|
35 | + if (in_array($type, ['text/plain', 'text/html']) && strcasecmp($part->getContentDisposition(), 'inline') === 0) { |
|
36 | 36 | return false; |
37 | 37 | } |
38 | 38 | return !(($part instanceof IMimePart) |
@@ -42,6 +42,6 @@ |
||
42 | 42 | foreach ($parts as $part) { |
43 | 43 | $strValue .= $part->getValue(); |
44 | 44 | } |
45 | - return [ $this->partFactory->newDatePart($strValue) ]; |
|
45 | + return [$this->partFactory->newDatePart($strValue)]; |
|
46 | 46 | } |
47 | 47 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | */ |
60 | 60 | public function getTokenSeparators() |
61 | 61 | { |
62 | - return [ '<', '>', ',', ';', '\s+' ]; |
|
62 | + return ['<', '>', ',', ';', '\s+']; |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
@@ -141,6 +141,6 @@ discard block |
||
141 | 141 | } |
142 | 142 | $this->processSinglePart($part, $strName, $strValue); |
143 | 143 | } |
144 | - return [ $this->partFactory->newAddressPart($strName, $strValue) ]; |
|
144 | + return [$this->partFactory->newAddressPart($strName, $strValue)]; |
|
145 | 145 | } |
146 | 146 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | protected function getTokenSeparators() |
42 | 42 | { |
43 | - return [ '\(', '\)' ]; |
|
43 | + return ['\(', '\)']; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
@@ -109,13 +109,13 @@ discard block |
||
109 | 109 | foreach ($parts as $part) { |
110 | 110 | // order is important here - CommentPart extends LiteralPart |
111 | 111 | if ($part instanceof CommentPart) { |
112 | - $comment .= '(' . $part->getComment() . ')'; |
|
112 | + $comment .= '('.$part->getComment().')'; |
|
113 | 113 | } elseif ($part instanceof LiteralPart) { |
114 | - $comment .= '"' . $part->getValue() . '"'; |
|
114 | + $comment .= '"'.$part->getValue().'"'; |
|
115 | 115 | } else { |
116 | 116 | $comment .= $part->getValue(); |
117 | 117 | } |
118 | 118 | } |
119 | - return [ $this->partFactory->newCommentPart($comment) ]; |
|
119 | + return [$this->partFactory->newCommentPart($comment)]; |
|
120 | 120 | } |
121 | 121 | } |