@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | if ($part->getParent() !== null && $this !== $part->getParent()) { |
101 | 101 | $part->getParent()->addPart($part, $position); |
102 | 102 | } elseif ($part !== $this) { |
103 | - array_splice($this->parts, ($position === null) ? count($this->parts) : $position, 0, [ $part ]); |
|
103 | + array_splice($this->parts, ($position === null) ? count($this->parts) : $position, 0, [$part]); |
|
104 | 104 | } |
105 | 105 | $this->registerPart($part); |
106 | 106 | } |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | { |
187 | 187 | $aParts = []; |
188 | 188 | foreach ($this->parts as $part) { |
189 | - $aParts = array_merge($aParts, [ $part ], $part->getAllParts()); |
|
189 | + $aParts = array_merge($aParts, [$part], $part->getAllParts()); |
|
190 | 190 | } |
191 | 191 | return $aParts; |
192 | 192 | } |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | public function getPartCount() |
200 | 200 | { |
201 | 201 | return count($this->parts) + array_sum( |
202 | - array_map(function ($part) { |
|
202 | + array_map(function($part) { |
|
203 | 203 | return $part->getPartCount(); |
204 | 204 | }, |
205 | 205 | $this->parts) |
@@ -50,11 +50,11 @@ |
||
50 | 50 | |
51 | 51 | $this->setRawHeader( |
52 | 52 | 'Content-Type', |
53 | - 'application/octet-stream; name="' . addcslashes($filename, '"') . '"' |
|
53 | + 'application/octet-stream; name="'.addcslashes($filename, '"').'"' |
|
54 | 54 | ); |
55 | 55 | $this->setRawHeader( |
56 | 56 | 'Content-Disposition', |
57 | - 'attachment; filename="' . addcslashes($filename, '"') . '"' |
|
57 | + 'attachment; filename="'.addcslashes($filename, '"').'"' |
|
58 | 58 | ); |
59 | 59 | $this->setRawHeader('Content-Transfer-Encoding', 'x-uuencode'); |
60 | 60 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $this->addRawHeaderToPart($header, $part); |
97 | 97 | $header = ''; |
98 | 98 | } else { |
99 | - $line = "\r\n" . $line; |
|
99 | + $line = "\r\n".$line; |
|
100 | 100 | } |
101 | 101 | $header .= rtrim($line, "\r\n"); |
102 | 102 | } while ($header !== ''); |
@@ -177,8 +177,7 @@ discard block |
||
177 | 177 | private function getParentBoundary($curBoundary, MimePart $parent = null) |
178 | 178 | { |
179 | 179 | return $parent !== null ? |
180 | - $parent->getHeaderParameter('Content-Type', 'boundary') : |
|
181 | - $curBoundary; |
|
180 | + $parent->getHeaderParameter('Content-Type', 'boundary') : $curBoundary; |
|
182 | 181 | } |
183 | 182 | |
184 | 183 | /** |
@@ -481,7 +481,7 @@ |
||
481 | 481 | $first = false; |
482 | 482 | $read = ltrim($read, "\r\n"); |
483 | 483 | } |
484 | - $read = $lastChars . $read; |
|
484 | + $read = $lastChars.$read; |
|
485 | 485 | $read = preg_replace('/\r\n|\r|\n/', "\r\n", $read); |
486 | 486 | $lastChars = ''; |
487 | 487 | $matches = null; |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | private function getUniqueBoundary($mimeType) |
346 | 346 | { |
347 | 347 | $type = ltrim(strtoupper(preg_replace('/^(multipart\/(.{3}).*|.*)$/i', '$2-', $mimeType)), '-'); |
348 | - return uniqid('----=MMP-' . $type . $this->objectId . '.', true); |
|
348 | + return uniqid('----=MMP-'.$type.$this->objectId.'.', true); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | /** |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | $part->setRawHeader( |
361 | 361 | 'Content-Type', |
362 | 362 | "$mimeType;\r\n\tboundary=\"" |
363 | - . $this->getUniqueBoundary($mimeType) . "\"" |
|
363 | + . $this->getUniqueBoundary($mimeType)."\"" |
|
364 | 364 | ); |
365 | 365 | } |
366 | 366 | |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | */ |
527 | 527 | private function overwrite8bitContentEncoding() |
528 | 528 | { |
529 | - $parts = array_merge([ $this ], $this->getAllParts()); |
|
529 | + $parts = array_merge([$this], $this->getAllParts()); |
|
530 | 530 | foreach ($parts as $part) { |
531 | 531 | if ($part->getHeaderValue('Content-Transfer-Encoding') === '8bit') { |
532 | 532 | if (preg_match('/text\/.*/', $part->getHeaderValue('Content-Type'))) { |
@@ -799,7 +799,7 @@ discard block |
||
799 | 799 | public function addAttachmentPart($stringOrHandle, $mimeType, $filename = null, $disposition = 'attachment') |
800 | 800 | { |
801 | 801 | if ($filename === null) { |
802 | - $filename = 'file' . uniqid(); |
|
802 | + $filename = 'file'.uniqid(); |
|
803 | 803 | } |
804 | 804 | $filename = iconv('UTF-8', 'US-ASCII//translit//ignore', $filename); |
805 | 805 | $part = $this->createPartForAttachment(); |