@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | $boundary = $part->getHeaderParameter('Content-Type', 'boundary'); |
158 | 158 | if ($boundary === null) { |
159 | 159 | return array_map( |
160 | - function ($child) { |
|
160 | + function($child) { |
|
161 | 161 | return $child->getStream(); |
162 | 162 | }, |
163 | 163 | $part->getChildParts() |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | $content = Psr7\stream_for(); |
188 | 188 | $this->writePartContentTo($content); |
189 | 189 | $content->rewind(); |
190 | - $streams = [ $this->streamFactory->newHeaderStream($this->part), $content ]; |
|
190 | + $streams = [$this->streamFactory->newHeaderStream($this->part), $content]; |
|
191 | 191 | |
192 | 192 | if ($this->part instanceof IMimePart && $this->part->getChildCount() > 0) { |
193 | 193 | $streams = array_merge($streams, $this->getBoundaryAndChildStreams($this->part)); |
@@ -449,8 +449,7 @@ |
||
449 | 449 | |
450 | 450 | public function getStream() |
451 | 451 | { |
452 | - return ($this->messageStream !== null) ? $this->messageStream : |
|
453 | - $this->parent->getStream(); |
|
452 | + return ($this->messageStream !== null) ? $this->messageStream : $this->parent->getStream(); |
|
454 | 453 | } |
455 | 454 | |
456 | 455 | public function getMessageResourceHandle() |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $this->contentParsers, |
44 | 44 | $pos, |
45 | 45 | 0, |
46 | - [ $parser ] |
|
46 | + [$parser] |
|
47 | 47 | ); |
48 | 48 | } |
49 | 49 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $this->childParsers, |
61 | 61 | $pos, |
62 | 62 | 0, |
63 | - [ $parser ] |
|
63 | + [$parser] |
|
64 | 64 | ); |
65 | 65 | } |
66 | 66 |
@@ -33,10 +33,10 @@ |
||
33 | 33 | if (method_exists($param, 'getType')) { |
34 | 34 | $type = $param->getType(); |
35 | 35 | if ($type && !$type->isBuiltin()) { |
36 | - return '\\' . (method_exists($type, 'getName') ? $type->getName() : (string) $type); |
|
36 | + return '\\'.(method_exists($type, 'getName') ? $type->getName() : (string) $type); |
|
37 | 37 | } |
38 | 38 | } elseif ($param->getClass() !== null) { |
39 | - return '\\' . $param->getClass(); |
|
39 | + return '\\'.$param->getClass(); |
|
40 | 40 | } |
41 | 41 | return null; |
42 | 42 | } |
@@ -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) && ($part->isMultiPart() || $part->isSignaturePart())); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | private function getAllPartsIterator() |
52 | 52 | { |
53 | 53 | $iter = new AppendIterator(); |
54 | - $iter->append(new ArrayIterator([ $this ])); |
|
54 | + $iter->append(new ArrayIterator([$this])); |
|
55 | 55 | $iter->append(new RecursiveIteratorIterator($this->partChildrenContainer, RecursiveIteratorIterator::SELF_FIRST)); |
56 | 56 | return $iter; |
57 | 57 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | public function getPartByContentId($contentId) |
139 | 139 | { |
140 | 140 | $sanitized = preg_replace('/^\s*<|>\s*$/', '', $contentId); |
141 | - return $this->getPart(0, function (IMessagePart $part) use ($sanitized) { |
|
141 | + return $this->getPart(0, function(IMessagePart $part) use ($sanitized) { |
|
142 | 142 | return strcasecmp($part->getContentId(), $sanitized) === 0; |
143 | 143 | }); |
144 | 144 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | public function getUniqueBoundary($mimeType) |
47 | 47 | { |
48 | 48 | $type = ltrim(strtoupper(preg_replace('/^(multipart\/(.{3}).*|.*)$/i', '$2-', $mimeType)), '-'); |
49 | - return uniqid('----=MMP-' . $type . '-', true); |
|
49 | + return uniqid('----=MMP-'.$type.'-', true); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $part->setRawHeader( |
62 | 62 | 'Content-Type', |
63 | 63 | "$mimeType;\r\n\tboundary=\"" |
64 | - . $this->getUniqueBoundary($mimeType) . '"' |
|
64 | + . $this->getUniqueBoundary($mimeType).'"' |
|
65 | 65 | ); |
66 | 66 | $part->notify(); |
67 | 67 | } |
@@ -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); |
@@ -107,7 +107,7 @@ |
||
107 | 107 | * |
108 | 108 | * @param IMimePart $part |
109 | 109 | * @return MimePart the newly-created MimePart |
110 | - */ |
|
110 | + */ |
|
111 | 111 | public function createNewContentPartFrom(IMimePart $part) |
112 | 112 | { |
113 | 113 | $mime = $this->mimePartFactory->newInstance(); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | $this->children, |
102 | 102 | $index, |
103 | 103 | 0, |
104 | - [ $part ] |
|
104 | + [$part] |
|
105 | 105 | ); |
106 | 106 | } |
107 | 107 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | { |
137 | 137 | if (!$value instanceof IMessagePart) { |
138 | 138 | throw new InvalidArgumentException( |
139 | - get_class($value) . ' is not a \ZBateson\MailMimeParser\Message\IMessagePart' |
|
139 | + get_class($value).' is not a \ZBateson\MailMimeParser\Message\IMessagePart' |
|
140 | 140 | ); |
141 | 141 | } |
142 | 142 | $index = ($offset === null) ? count($this->children) : $offset; |