@@ -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; |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | private function getUniqueBoundary($mimeType) |
348 | 348 | { |
349 | 349 | $type = ltrim(strtoupper(preg_replace('/^(multipart\/(.{3}).*|.*)$/i', '$2-', $mimeType)), '-'); |
350 | - return uniqid('----=MMP-' . $type . $this->objectId . '.', true); |
|
350 | + return uniqid('----=MMP-'.$type.$this->objectId.'.', true); |
|
351 | 351 | } |
352 | 352 | |
353 | 353 | /** |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | $part->setRawHeader( |
363 | 363 | 'Content-Type', |
364 | 364 | "$mimeType;\r\n\tboundary=\"" |
365 | - . $this->getUniqueBoundary($mimeType) . '"' |
|
365 | + . $this->getUniqueBoundary($mimeType).'"' |
|
366 | 366 | ); |
367 | 367 | } |
368 | 368 | |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | */ |
529 | 529 | private function overwrite8bitContentEncoding() |
530 | 530 | { |
531 | - $parts = array_merge([ $this ], $this->getAllParts()); |
|
531 | + $parts = array_merge([$this], $this->getAllParts()); |
|
532 | 532 | foreach ($parts as $part) { |
533 | 533 | if ($part->getHeaderValue('Content-Transfer-Encoding') === '8bit') { |
534 | 534 | if (preg_match('/text\/.*/', $part->getHeaderValue('Content-Type'))) { |
@@ -801,7 +801,7 @@ discard block |
||
801 | 801 | public function addAttachmentPart($stringOrHandle, $mimeType, $filename = null, $disposition = 'attachment') |
802 | 802 | { |
803 | 803 | if ($filename === null) { |
804 | - $filename = 'file' . uniqid(); |
|
804 | + $filename = 'file'.uniqid(); |
|
805 | 805 | } |
806 | 806 | $filename = iconv('UTF-8', 'US-ASCII//translit//ignore', $filename); |
807 | 807 | $part = $this->createPartForAttachment(); |