@@ -130,20 +130,20 @@ discard block |
||
130 | 130 | if(isset($this->attributes[$name]) && $strict === false) { |
131 | 131 | if ($this->attributize) { |
132 | 132 | $this->attributes[$name]->add($value, true); |
133 | - }else{ |
|
133 | + } else{ |
|
134 | 134 | if(isset($this->attributes[$name])) { |
135 | 135 | if (is_array($this->attributes[$name]) == false) { |
136 | 136 | $this->attributes[$name] = [$this->attributes[$name], $value]; |
137 | - }else{ |
|
137 | + } else{ |
|
138 | 138 | $this->attributes[$name][] = $value; |
139 | 139 | } |
140 | - }else{ |
|
140 | + } else{ |
|
141 | 141 | $this->attributes[$name] = $value; |
142 | 142 | } |
143 | 143 | } |
144 | - }elseif($this->attributize == false){ |
|
144 | + } elseif($this->attributize == false){ |
|
145 | 145 | $this->attributes[$name] = $value; |
146 | - }else{ |
|
146 | + } else{ |
|
147 | 147 | $this->attributes[$name] = new Attribute($name, $value); |
148 | 148 | } |
149 | 149 | |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | if ($prev_header !== null) { |
231 | 231 | $headers[$prev_header][] = $line; |
232 | 232 | } |
233 | - }elseif (substr($line, 0, 1) === " ") { |
|
233 | + } elseif (substr($line, 0, 1) === " ") { |
|
234 | 234 | $line = substr($line, 1); |
235 | 235 | $line = trim(rtrim($line)); |
236 | 236 | if ($prev_header !== null) { |
@@ -239,11 +239,11 @@ discard block |
||
239 | 239 | } |
240 | 240 | if (is_array($headers[$prev_header])) { |
241 | 241 | $headers[$prev_header][] = $line; |
242 | - }else{ |
|
242 | + } else{ |
|
243 | 243 | $headers[$prev_header] .= $line; |
244 | 244 | } |
245 | 245 | } |
246 | - }else{ |
|
246 | + } else{ |
|
247 | 247 | if (($pos = strpos($line, ":")) > 0) { |
248 | 248 | $key = trim(rtrim(strtolower(substr($line, 0, $pos)))); |
249 | 249 | $key = str_replace("-", "_", $key); |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | $value = trim(rtrim(substr($line, $pos + 1))); |
252 | 252 | if (isset($headers[$key])) { |
253 | 253 | $headers[$key][] = $value; |
254 | - }else{ |
|
254 | + } else{ |
|
255 | 255 | $headers[$key] = [$value]; |
256 | 256 | } |
257 | 257 | $prev_header = $key; |
@@ -260,7 +260,9 @@ discard block |
||
260 | 260 | } |
261 | 261 | |
262 | 262 | foreach($headers as $key => $values) { |
263 | - if (isset($imap_headers[$key])) continue; |
|
263 | + if (isset($imap_headers[$key])) { |
|
264 | + continue; |
|
265 | + } |
|
264 | 266 | $value = null; |
265 | 267 | switch($key){ |
266 | 268 | case 'from': |
@@ -397,9 +399,9 @@ discard block |
||
397 | 399 | return EncodingAliases::get($parameter->value, $this->fallback_encoding); |
398 | 400 | } |
399 | 401 | } |
400 | - }elseif (property_exists($structure, 'charset')) { |
|
402 | + } elseif (property_exists($structure, 'charset')) { |
|
401 | 403 | return EncodingAliases::get($structure->charset, $this->fallback_encoding); |
402 | - }elseif (is_string($structure) === true){ |
|
404 | + } elseif (is_string($structure) === true){ |
|
403 | 405 | return mb_detect_encoding($structure); |
404 | 406 | } |
405 | 407 | |
@@ -446,9 +448,9 @@ discard block |
||
446 | 448 | } |
447 | 449 | } |
448 | 450 | } |
449 | - }elseif($decoder === 'iconv' && $is_utf8_base) { |
|
451 | + } elseif($decoder === 'iconv' && $is_utf8_base) { |
|
450 | 452 | $value = iconv_mime_decode($value); |
451 | - }elseif($is_utf8_base){ |
|
453 | + } elseif($is_utf8_base){ |
|
452 | 454 | $value = mb_decode_mimeheader($value); |
453 | 455 | } |
454 | 456 | |
@@ -481,7 +483,9 @@ discard block |
||
481 | 483 | * Try to extract the priority from a given raw header string |
482 | 484 | */ |
483 | 485 | private function findPriority() { |
484 | - if(($priority = $this->get("x_priority")) === null) return; |
|
486 | + if(($priority = $this->get("x_priority")) === null) { |
|
487 | + return; |
|
488 | + } |
|
485 | 489 | switch((int)"$priority"){ |
486 | 490 | case IMAP::MESSAGE_PRIORITY_HIGHEST; |
487 | 491 | $priority = IMAP::MESSAGE_PRIORITY_HIGHEST; |
@@ -604,7 +608,7 @@ discard block |
||
604 | 608 | foreach ($this->attributes as $key => $value) { |
605 | 609 | if (is_array($value)) { |
606 | 610 | $value = implode(", ", $value); |
607 | - }else{ |
|
611 | + } else{ |
|
608 | 612 | $value = (string)$value; |
609 | 613 | } |
610 | 614 | // Only parse strings and don't parse any attributes like the user-agent |
@@ -82,10 +82,10 @@ discard block |
||
82 | 82 | * @throws MethodNotFoundException |
83 | 83 | */ |
84 | 84 | public function __call($method, $arguments) { |
85 | - if(strtolower(substr($method, 0, 3)) === 'get') { |
|
85 | + if (strtolower(substr($method, 0, 3)) === 'get') { |
|
86 | 86 | $name = preg_replace('/(.)(?=[A-Z])/u', '$1_', substr(strtolower($method), 3)); |
87 | 87 | |
88 | - if(in_array($name, array_keys($this->attributes))) { |
|
88 | + if (in_array($name, array_keys($this->attributes))) { |
|
89 | 89 | return $this->attributes[$name]; |
90 | 90 | } |
91 | 91 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | * @return Attribute|mixed |
112 | 112 | */ |
113 | 113 | public function get($name) { |
114 | - if(isset($this->attributes[$name])) { |
|
114 | + if (isset($this->attributes[$name])) { |
|
115 | 115 | return $this->attributes[$name]; |
116 | 116 | } |
117 | 117 | |
@@ -127,23 +127,23 @@ discard block |
||
127 | 127 | * @return Attribute |
128 | 128 | */ |
129 | 129 | public function set($name, $value, $strict = false) { |
130 | - if(isset($this->attributes[$name]) && $strict === false) { |
|
130 | + if (isset($this->attributes[$name]) && $strict === false) { |
|
131 | 131 | if ($this->attributize) { |
132 | 132 | $this->attributes[$name]->add($value, true); |
133 | - }else{ |
|
134 | - if(isset($this->attributes[$name])) { |
|
133 | + }else { |
|
134 | + if (isset($this->attributes[$name])) { |
|
135 | 135 | if (is_array($this->attributes[$name]) == false) { |
136 | 136 | $this->attributes[$name] = [$this->attributes[$name], $value]; |
137 | - }else{ |
|
137 | + }else { |
|
138 | 138 | $this->attributes[$name][] = $value; |
139 | 139 | } |
140 | - }else{ |
|
140 | + }else { |
|
141 | 141 | $this->attributes[$name] = $value; |
142 | 142 | } |
143 | 143 | } |
144 | - }elseif($this->attributize == false){ |
|
144 | + }elseif ($this->attributize == false) { |
|
145 | 145 | $this->attributes[$name] = $value; |
146 | - }else{ |
|
146 | + }else { |
|
147 | 147 | $this->attributes[$name] = new Attribute($name, $value); |
148 | 148 | } |
149 | 149 | |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | public function find($pattern) { |
160 | 160 | if (preg_match_all($pattern, $this->raw, $matches)) { |
161 | 161 | if (isset($matches[1])) { |
162 | - if(count($matches[1]) > 0) { |
|
162 | + if (count($matches[1]) > 0) { |
|
163 | 163 | return $matches[1][0]; |
164 | 164 | } |
165 | 165 | } |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | * |
173 | 173 | * @return string|null |
174 | 174 | */ |
175 | - public function getBoundary(){ |
|
175 | + public function getBoundary() { |
|
176 | 176 | $boundary = $this->find("/boundary\=(.*)/i"); |
177 | 177 | |
178 | 178 | if ($boundary === null) { |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | * |
198 | 198 | * @throws InvalidMessageDateException |
199 | 199 | */ |
200 | - protected function parse(){ |
|
200 | + protected function parse() { |
|
201 | 201 | $header = $this->rfc822_parse_headers($this->raw); |
202 | 202 | |
203 | 203 | $this->extractAddresses($header); |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $this->parseDate($header); |
216 | 216 | foreach ($header as $key => $value) { |
217 | 217 | $key = trim(rtrim(strtolower($key))); |
218 | - if(!isset($this->attributes[$key])){ |
|
218 | + if (!isset($this->attributes[$key])) { |
|
219 | 219 | $this->set($key, $value); |
220 | 220 | } |
221 | 221 | } |
@@ -231,12 +231,12 @@ discard block |
||
231 | 231 | * |
232 | 232 | * @return object |
233 | 233 | */ |
234 | - public function rfc822_parse_headers($raw_headers){ |
|
234 | + public function rfc822_parse_headers($raw_headers) { |
|
235 | 235 | $headers = []; |
236 | 236 | $imap_headers = []; |
237 | 237 | if (extension_loaded('imap')) { |
238 | 238 | $raw_imap_headers = (array) \imap_rfc822_parse_headers($this->raw); |
239 | - foreach($raw_imap_headers as $key => $values) { |
|
239 | + foreach ($raw_imap_headers as $key => $values) { |
|
240 | 240 | $key = str_replace("-", "_", $key); |
241 | 241 | $imap_headers[$key] = $values; |
242 | 242 | } |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | |
245 | 245 | $lines = explode("\r\n", $raw_headers); |
246 | 246 | $prev_header = null; |
247 | - foreach($lines as $line) { |
|
247 | + foreach ($lines as $line) { |
|
248 | 248 | if (substr($line, 0, 1) === "\n") { |
249 | 249 | $line = substr($line, 1); |
250 | 250 | } |
@@ -264,19 +264,19 @@ discard block |
||
264 | 264 | } |
265 | 265 | if (is_array($headers[$prev_header])) { |
266 | 266 | $headers[$prev_header][] = $line; |
267 | - }else{ |
|
267 | + }else { |
|
268 | 268 | $headers[$prev_header] .= $line; |
269 | 269 | } |
270 | 270 | } |
271 | - }else{ |
|
271 | + }else { |
|
272 | 272 | if (($pos = strpos($line, ":")) > 0) { |
273 | 273 | $key = trim(rtrim(strtolower(substr($line, 0, $pos)))); |
274 | 274 | $key = str_replace("-", "_", $key); |
275 | 275 | |
276 | 276 | $value = trim(rtrim(substr($line, $pos + 1))); |
277 | 277 | if (isset($headers[$key])) { |
278 | - $headers[$key][] = $value; |
|
279 | - }else{ |
|
278 | + $headers[$key][] = $value; |
|
279 | + }else { |
|
280 | 280 | $headers[$key] = [$value]; |
281 | 281 | } |
282 | 282 | $prev_header = $key; |
@@ -284,10 +284,10 @@ discard block |
||
284 | 284 | } |
285 | 285 | } |
286 | 286 | |
287 | - foreach($headers as $key => $values) { |
|
287 | + foreach ($headers as $key => $values) { |
|
288 | 288 | if (isset($imap_headers[$key])) continue; |
289 | 289 | $value = null; |
290 | - switch($key){ |
|
290 | + switch ($key) { |
|
291 | 291 | case 'from': |
292 | 292 | case 'to': |
293 | 293 | case 'cc': |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | break; |
303 | 303 | default: |
304 | 304 | if (is_array($values)) { |
305 | - foreach($values as $k => $v) { |
|
305 | + foreach ($values as $k => $v) { |
|
306 | 306 | if ($v == "") { |
307 | 307 | unset($values[$k]); |
308 | 308 | } |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | $value = implode(" ", $values); |
315 | 315 | } elseif ($available_values > 2) { |
316 | 316 | $value = array_values($values); |
317 | - } else { |
|
317 | + }else { |
|
318 | 318 | $value = ""; |
319 | 319 | } |
320 | 320 | } |
@@ -334,12 +334,12 @@ discard block |
||
334 | 334 | * @return array The decoded elements are returned in an array of objects, where each |
335 | 335 | * object has two properties, charset and text. |
336 | 336 | */ |
337 | - public function mime_header_decode($text){ |
|
337 | + public function mime_header_decode($text) { |
|
338 | 338 | if (extension_loaded('imap')) { |
339 | 339 | return \imap_mime_header_decode($text); |
340 | 340 | } |
341 | 341 | $charset = $this->getEncoding($text); |
342 | - return [(object)[ |
|
342 | + return [(object) [ |
|
343 | 343 | "charset" => $charset, |
344 | 344 | "text" => $this->convertEncoding($text, $charset) |
345 | 345 | ]]; |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | try { |
394 | 394 | if (function_exists('iconv') && $from != 'UTF-7' && $to != 'UTF-7') { |
395 | 395 | return iconv($from, $to, $str); |
396 | - } else { |
|
396 | + }else { |
|
397 | 397 | if (!$from) { |
398 | 398 | return mb_convert_encoding($str, $to); |
399 | 399 | } |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | if (strstr($from, '-')) { |
404 | 404 | $from = str_replace('-', '', $from); |
405 | 405 | return $this->convertEncoding($str, $from, $to); |
406 | - } else { |
|
406 | + }else { |
|
407 | 407 | return $str; |
408 | 408 | } |
409 | 409 | } |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | } |
425 | 425 | }elseif (property_exists($structure, 'charset')) { |
426 | 426 | return EncodingAliases::get($structure->charset, $this->fallback_encoding); |
427 | - }elseif (is_string($structure) === true){ |
|
427 | + }elseif (is_string($structure) === true) { |
|
428 | 428 | return mb_detect_encoding($structure); |
429 | 429 | } |
430 | 430 | |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | if ($value !== null) { |
458 | 458 | $is_utf8_base = $this->is_uft8($value); |
459 | 459 | |
460 | - if($decoder === 'utf-8' && extension_loaded('imap')) { |
|
460 | + if ($decoder === 'utf-8' && extension_loaded('imap')) { |
|
461 | 461 | $value = \imap_utf8($value); |
462 | 462 | $is_utf8_base = $this->is_uft8($value); |
463 | 463 | if ($is_utf8_base) { |
@@ -466,14 +466,14 @@ discard block |
||
466 | 466 | if ($this->notDecoded($original_value, $value)) { |
467 | 467 | $decoded_value = $this->mime_header_decode($value); |
468 | 468 | if (count($decoded_value) > 0) { |
469 | - if(property_exists($decoded_value[0], "text")) { |
|
469 | + if (property_exists($decoded_value[0], "text")) { |
|
470 | 470 | $value = $decoded_value[0]->text; |
471 | 471 | } |
472 | 472 | } |
473 | 473 | } |
474 | - }elseif($decoder === 'iconv' && $is_utf8_base) { |
|
474 | + }elseif ($decoder === 'iconv' && $is_utf8_base) { |
|
475 | 475 | $value = iconv_mime_decode($value); |
476 | - }elseif($is_utf8_base){ |
|
476 | + }elseif ($is_utf8_base) { |
|
477 | 477 | $value = mb_decode_mimeheader($value); |
478 | 478 | } |
479 | 479 | |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | * @return array |
497 | 497 | */ |
498 | 498 | private function decodeArray($values) { |
499 | - foreach($values as $key => $value) { |
|
499 | + foreach ($values as $key => $value) { |
|
500 | 500 | $values[$key] = $this->decode($value); |
501 | 501 | } |
502 | 502 | return $values; |
@@ -506,8 +506,8 @@ discard block |
||
506 | 506 | * Try to extract the priority from a given raw header string |
507 | 507 | */ |
508 | 508 | private function findPriority() { |
509 | - if(($priority = $this->get("x_priority")) === null) return; |
|
510 | - switch((int)"$priority"){ |
|
509 | + if (($priority = $this->get("x_priority")) === null) return; |
|
510 | + switch ((int) "$priority") { |
|
511 | 511 | case IMAP::MESSAGE_PRIORITY_HIGHEST; |
512 | 512 | $priority = IMAP::MESSAGE_PRIORITY_HIGHEST; |
513 | 513 | break; |
@@ -539,7 +539,7 @@ discard block |
||
539 | 539 | */ |
540 | 540 | private function decodeAddresses($values) { |
541 | 541 | $addresses = []; |
542 | - foreach($values as $address) { |
|
542 | + foreach ($values as $address) { |
|
543 | 543 | $address = trim(rtrim($address)); |
544 | 544 | if (strpos($address, ",") == strlen($address) - 1) { |
545 | 545 | $address = substr($address, 0, -1); |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | '/^(?:(?P<name>.+)\s)?(?(name)<|<?)(?P<email>[^\s]+?)(?(name)>|>?)$/', |
549 | 549 | $address, |
550 | 550 | $matches |
551 | - )){ |
|
551 | + )) { |
|
552 | 552 | $name = trim(rtrim($matches["name"])); |
553 | 553 | $email = trim(rtrim($matches["email"])); |
554 | 554 | list($mailbox, $host) = array_pad(explode("@", $email), 2, null); |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | * @param object $header |
568 | 568 | */ |
569 | 569 | private function extractAddresses($header) { |
570 | - foreach(['from', 'to', 'cc', 'bcc', 'reply_to', 'sender'] as $key){ |
|
570 | + foreach (['from', 'to', 'cc', 'bcc', 'reply_to', 'sender'] as $key) { |
|
571 | 571 | if (property_exists($header, $key)) { |
572 | 572 | $this->set($key, $this->parseAddresses($header->$key)); |
573 | 573 | } |
@@ -598,10 +598,10 @@ discard block |
||
598 | 598 | } |
599 | 599 | if (!property_exists($address, 'personal')) { |
600 | 600 | $address->personal = false; |
601 | - } else { |
|
601 | + }else { |
|
602 | 602 | $personalParts = $this->mime_header_decode($address->personal); |
603 | 603 | |
604 | - if(is_array($personalParts)) { |
|
604 | + if (is_array($personalParts)) { |
|
605 | 605 | $address->personal = ''; |
606 | 606 | foreach ($personalParts as $p) { |
607 | 607 | $address->personal .= $this->convertEncoding($p->text, $this->getEncoding($p)); |
@@ -625,23 +625,23 @@ discard block |
||
625 | 625 | /** |
626 | 626 | * Search and extract potential header extensions |
627 | 627 | */ |
628 | - private function extractHeaderExtensions(){ |
|
628 | + private function extractHeaderExtensions() { |
|
629 | 629 | foreach ($this->attributes as $key => $value) { |
630 | 630 | if (is_array($value)) { |
631 | 631 | $value = implode(", ", $value); |
632 | - }else{ |
|
633 | - $value = (string)$value; |
|
632 | + }else { |
|
633 | + $value = (string) $value; |
|
634 | 634 | } |
635 | 635 | // Only parse strings and don't parse any attributes like the user-agent |
636 | 636 | if (in_array($key, ["user_agent"]) === false) { |
637 | - if (($pos = strpos($value, ";")) !== false){ |
|
637 | + if (($pos = strpos($value, ";")) !== false) { |
|
638 | 638 | $original = substr($value, 0, $pos); |
639 | 639 | $this->set($key, trim(rtrim($original)), true); |
640 | 640 | |
641 | 641 | // Get all potential extensions |
642 | 642 | $extensions = explode(";", substr($value, $pos + 1)); |
643 | - foreach($extensions as $extension) { |
|
644 | - if (($pos = strpos($extension, "=")) !== false){ |
|
643 | + foreach ($extensions as $extension) { |
|
644 | + if (($pos = strpos($extension, "=")) !== false) { |
|
645 | 645 | $key = substr($extension, 0, $pos); |
646 | 646 | $key = trim(rtrim(strtolower($key))); |
647 | 647 | |
@@ -684,7 +684,7 @@ discard block |
||
684 | 684 | $parsed_date = null; |
685 | 685 | $date = $header->date; |
686 | 686 | |
687 | - if(preg_match('/\+0580/', $date)) { |
|
687 | + if (preg_match('/\+0580/', $date)) { |
|
688 | 688 | $date = str_replace('+0580', '+0530', $date); |
689 | 689 | } |
690 | 690 | |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | $date = trim(array_pop($array)); |
708 | 708 | break; |
709 | 709 | } |
710 | - try{ |
|
710 | + try { |
|
711 | 711 | $parsed_date = Carbon::parse($date); |
712 | 712 | } catch (\Exception $_e) { |
713 | 713 | throw new InvalidMessageDateException("Invalid message date. ID:".$this->get("message_id"), 1100, $e); |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | public function __construct($uid, $msglist, Client $client, $fetch_options = null, $fetch_body = false, $fetch_flags = false, $sequence = null) { |
203 | 203 | |
204 | 204 | $default_mask = $client->getDefaultMessageMask(); |
205 | - if($default_mask != null) { |
|
205 | + if ($default_mask != null) { |
|
206 | 206 | $this->mask = $default_mask; |
207 | 207 | } |
208 | 208 | $this->events["message"] = $client->getDefaultEvents("message"); |
@@ -261,13 +261,13 @@ discard block |
||
261 | 261 | * @throws MessageFlagException |
262 | 262 | * @throws Exceptions\RuntimeException |
263 | 263 | */ |
264 | - public static function make($uid, $msglist, Client $client, $raw_header, $raw_body, $raw_flags, $fetch_options = null, $sequence = null){ |
|
264 | + public static function make($uid, $msglist, Client $client, $raw_header, $raw_body, $raw_flags, $fetch_options = null, $sequence = null) { |
|
265 | 265 | $reflection = new \ReflectionClass(self::class); |
266 | 266 | /** @var self $instance */ |
267 | 267 | $instance = $reflection->newInstanceWithoutConstructor(); |
268 | 268 | |
269 | 269 | $default_mask = $client->getDefaultMessageMask(); |
270 | - if($default_mask != null) { |
|
270 | + if ($default_mask != null) { |
|
271 | 271 | $instance->setMask($default_mask); |
272 | 272 | } |
273 | 273 | $instance->setEvents([ |
@@ -302,13 +302,13 @@ discard block |
||
302 | 302 | * @throws MethodNotFoundException |
303 | 303 | */ |
304 | 304 | public function __call($method, $arguments) { |
305 | - if(strtolower(substr($method, 0, 3)) === 'get') { |
|
305 | + if (strtolower(substr($method, 0, 3)) === 'get') { |
|
306 | 306 | $name = Str::snake(substr($method, 3)); |
307 | 307 | return $this->get($name); |
308 | 308 | }elseif (strtolower(substr($method, 0, 3)) === 'set') { |
309 | 309 | $name = Str::snake(substr($method, 3)); |
310 | 310 | |
311 | - if(in_array($name, array_keys($this->attributes))) { |
|
311 | + if (in_array($name, array_keys($this->attributes))) { |
|
312 | 312 | return $this->__set($name, array_pop($arguments)); |
313 | 313 | } |
314 | 314 | |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | * @return mixed|null |
348 | 348 | */ |
349 | 349 | public function get($name) { |
350 | - if(isset($this->attributes[$name])) { |
|
350 | + if (isset($this->attributes[$name])) { |
|
351 | 351 | return $this->attributes[$name]; |
352 | 352 | } |
353 | 353 | |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | * |
422 | 422 | * @throws InvalidMessageDateException |
423 | 423 | */ |
424 | - public function parseRawHeader($raw_header){ |
|
424 | + public function parseRawHeader($raw_header) { |
|
425 | 425 | $this->header = new Header($raw_header); |
426 | 426 | } |
427 | 427 | |
@@ -432,8 +432,8 @@ discard block |
||
432 | 432 | public function parseRawFlags($raw_flags) { |
433 | 433 | $this->flags = FlagCollection::make([]); |
434 | 434 | |
435 | - foreach($raw_flags as $flag) { |
|
436 | - if (strpos($flag, "\\") === 0){ |
|
435 | + foreach ($raw_flags as $flag) { |
|
436 | + if (strpos($flag, "\\") === 0) { |
|
437 | 437 | $flag = substr($flag, 1); |
438 | 438 | } |
439 | 439 | $flag_key = strtolower($flag); |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | * @throws MessageFlagException |
507 | 507 | * @throws Exceptions\RuntimeException |
508 | 508 | */ |
509 | - public function peek(){ |
|
509 | + public function peek() { |
|
510 | 510 | if ($this->fetch_options == IMAP::FT_PEEK) { |
511 | 511 | if ($this->getFlags()->get("seen") == null) { |
512 | 512 | $this->unsetFlag("Seen"); |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | private function fetchPart(Part $part) { |
556 | 556 | if ($part->isAttachment()) { |
557 | 557 | $this->fetchAttachment($part); |
558 | - }else{ |
|
558 | + }else { |
|
559 | 559 | $encoding = $this->getEncoding($part); |
560 | 560 | |
561 | 561 | $content = $this->decodeString($part->content, $part->encoding); |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | |
581 | 581 | if (isset($this->bodies[$subtype])) { |
582 | 582 | $this->bodies[$subtype] .= "\n".$content; |
583 | - }else{ |
|
583 | + }else { |
|
584 | 584 | $this->bodies[$subtype] = $content; |
585 | 585 | } |
586 | 586 | } |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | if ($oAttachment->getName() !== null && $oAttachment->getSize() > 0) { |
597 | 597 | if ($oAttachment->getId() !== null) { |
598 | 598 | $this->attachments->put($oAttachment->getId(), $oAttachment); |
599 | - } else { |
|
599 | + }else { |
|
600 | 600 | $this->attachments->push($oAttachment); |
601 | 601 | } |
602 | 602 | } |
@@ -730,7 +730,7 @@ discard block |
||
730 | 730 | |
731 | 731 | if (function_exists('iconv') && $from != 'UTF-7' && $to != 'UTF-7') { |
732 | 732 | return @iconv($from, $to.'//IGNORE', $str); |
733 | - } else { |
|
733 | + }else { |
|
734 | 734 | if (!$from) { |
735 | 735 | return mb_convert_encoding($str, $to); |
736 | 736 | } |
@@ -751,9 +751,9 @@ discard block |
||
751 | 751 | return EncodingAliases::get($parameter->value); |
752 | 752 | } |
753 | 753 | } |
754 | - }elseif (property_exists($structure, 'charset')){ |
|
754 | + }elseif (property_exists($structure, 'charset')) { |
|
755 | 755 | return EncodingAliases::get($structure->charset); |
756 | - }elseif (is_string($structure) === true){ |
|
756 | + }elseif (is_string($structure) === true) { |
|
757 | 757 | return mb_detect_encoding($structure); |
758 | 758 | } |
759 | 759 | |
@@ -768,7 +768,7 @@ discard block |
||
768 | 768 | * @throws Exceptions\FolderFetchingException |
769 | 769 | * @throws Exceptions\RuntimeException |
770 | 770 | */ |
771 | - public function getFolder(){ |
|
771 | + public function getFolder() { |
|
772 | 772 | return $this->client->getFolder($this->folder_path); |
773 | 773 | } |
774 | 774 | |
@@ -784,13 +784,13 @@ discard block |
||
784 | 784 | * @throws Exceptions\GetMessagesFailedException |
785 | 785 | * @throws Exceptions\RuntimeException |
786 | 786 | */ |
787 | - public function thread($sent_folder = null, &$thread = null, $folder = null){ |
|
787 | + public function thread($sent_folder = null, &$thread = null, $folder = null) { |
|
788 | 788 | $thread = $thread ? $thread : MessageCollection::make([]); |
789 | - $folder = $folder ? $folder : $this->getFolder(); |
|
789 | + $folder = $folder ? $folder : $this->getFolder(); |
|
790 | 790 | $sent_folder = $sent_folder ? $sent_folder : $this->client->getFolder(ClientManager::get("options.common_folders.sent", "INBOX/Sent")); |
791 | 791 | |
792 | 792 | /** @var Message $message */ |
793 | - foreach($thread as $message) { |
|
793 | + foreach ($thread as $message) { |
|
794 | 794 | if ($message->message_id == $this->message_id) { |
795 | 795 | return $thread; |
796 | 796 | } |
@@ -801,7 +801,7 @@ discard block |
||
801 | 801 | $this->fetchThreadByInReplyTo($thread, $this->message_id, $sent_folder, $folder, $sent_folder); |
802 | 802 | |
803 | 803 | if (is_array($this->in_reply_to)) { |
804 | - foreach($this->in_reply_to as $in_reply_to) { |
|
804 | + foreach ($this->in_reply_to as $in_reply_to) { |
|
805 | 805 | $this->fetchThreadByMessageId($thread, $in_reply_to, $folder, $folder, $sent_folder); |
806 | 806 | $this->fetchThreadByMessageId($thread, $in_reply_to, $sent_folder, $folder, $sent_folder); |
807 | 807 | } |
@@ -822,7 +822,7 @@ discard block |
||
822 | 822 | * @throws Exceptions\GetMessagesFailedException |
823 | 823 | * @throws Exceptions\RuntimeException |
824 | 824 | */ |
825 | - protected function fetchThreadByInReplyTo(&$thread, $in_reply_to, $primary_folder, $secondary_folder, $sent_folder){ |
|
825 | + protected function fetchThreadByInReplyTo(&$thread, $in_reply_to, $primary_folder, $secondary_folder, $sent_folder) { |
|
826 | 826 | $primary_folder->query()->inReplyTo($in_reply_to) |
827 | 827 | ->setFetchBody($this->getFetchBodyOption()) |
828 | 828 | ->leaveUnread()->get()->each(function($message) use(&$thread, $secondary_folder, $sent_folder){ |
@@ -843,7 +843,7 @@ discard block |
||
843 | 843 | * @throws Exceptions\GetMessagesFailedException |
844 | 844 | * @throws Exceptions\RuntimeException |
845 | 845 | */ |
846 | - protected function fetchThreadByMessageId(&$thread, $message_id, $primary_folder, $secondary_folder, $sent_folder){ |
|
846 | + protected function fetchThreadByMessageId(&$thread, $message_id, $primary_folder, $secondary_folder, $sent_folder) { |
|
847 | 847 | $primary_folder->query()->messageId($message_id) |
848 | 848 | ->setFetchBody($this->getFetchBodyOption()) |
849 | 849 | ->leaveUnread()->get()->each(function($message) use(&$thread, $secondary_folder, $sent_folder){ |
@@ -936,14 +936,14 @@ discard block |
||
936 | 936 | * @throws MessageFlagException |
937 | 937 | * @throws MessageHeaderFetchingException |
938 | 938 | */ |
939 | - protected function fetchNewMail($folder, $next_uid, $event, $expunge){ |
|
940 | - if($expunge) $this->client->expunge(); |
|
939 | + protected function fetchNewMail($folder, $next_uid, $event, $expunge) { |
|
940 | + if ($expunge) $this->client->expunge(); |
|
941 | 941 | |
942 | 942 | $this->client->openFolder($folder->path); |
943 | 943 | |
944 | 944 | if ($this->sequence === IMAP::ST_UID) { |
945 | 945 | $sequence_id = $next_uid; |
946 | - }else{ |
|
946 | + }else { |
|
947 | 947 | $sequence_id = $this->client->getConnection()->getMessageNumber($next_uid); |
948 | 948 | } |
949 | 949 | |
@@ -966,7 +966,7 @@ discard block |
||
966 | 966 | */ |
967 | 967 | public function delete($expunge = true) { |
968 | 968 | $status = $this->setFlag("Deleted"); |
969 | - if($expunge) $this->client->expunge(); |
|
969 | + if ($expunge) $this->client->expunge(); |
|
970 | 970 | |
971 | 971 | $event = $this->getEvent("message", "deleted"); |
972 | 972 | $event::dispatch($this); |
@@ -986,7 +986,7 @@ discard block |
||
986 | 986 | */ |
987 | 987 | public function restore($expunge = true) { |
988 | 988 | $status = $this->unsetFlag("Deleted"); |
989 | - if($expunge) $this->client->expunge(); |
|
989 | + if ($expunge) $this->client->expunge(); |
|
990 | 990 | |
991 | 991 | $event = $this->getEvent("message", "restored"); |
992 | 992 | $event::dispatch($this); |
@@ -1091,7 +1091,7 @@ discard block |
||
1091 | 1091 | * |
1092 | 1092 | * @return AttachmentCollection |
1093 | 1093 | */ |
1094 | - public function attachments(){ |
|
1094 | + public function attachments() { |
|
1095 | 1095 | return $this->getAttachments(); |
1096 | 1096 | } |
1097 | 1097 | |
@@ -1189,7 +1189,7 @@ discard block |
||
1189 | 1189 | * |
1190 | 1190 | * @return FlagCollection |
1191 | 1191 | */ |
1192 | - public function flags(){ |
|
1192 | + public function flags() { |
|
1193 | 1193 | return $this->getFlags(); |
1194 | 1194 | } |
1195 | 1195 | |
@@ -1198,7 +1198,7 @@ discard block |
||
1198 | 1198 | * |
1199 | 1199 | * @return Structure|null |
1200 | 1200 | */ |
1201 | - public function getStructure(){ |
|
1201 | + public function getStructure() { |
|
1202 | 1202 | return $this->structure; |
1203 | 1203 | } |
1204 | 1204 | |
@@ -1224,7 +1224,7 @@ discard block |
||
1224 | 1224 | * |
1225 | 1225 | * @return array |
1226 | 1226 | */ |
1227 | - public function getAttributes(){ |
|
1227 | + public function getAttributes() { |
|
1228 | 1228 | return array_merge($this->attributes, $this->header->getAttributes()); |
1229 | 1229 | } |
1230 | 1230 | |
@@ -1234,8 +1234,8 @@ discard block |
||
1234 | 1234 | * |
1235 | 1235 | * @return $this |
1236 | 1236 | */ |
1237 | - public function setMask($mask){ |
|
1238 | - if(class_exists($mask)){ |
|
1237 | + public function setMask($mask) { |
|
1238 | + if (class_exists($mask)) { |
|
1239 | 1239 | $this->mask = $mask; |
1240 | 1240 | } |
1241 | 1241 | |
@@ -1247,7 +1247,7 @@ discard block |
||
1247 | 1247 | * |
1248 | 1248 | * @return string |
1249 | 1249 | */ |
1250 | - public function getMask(){ |
|
1250 | + public function getMask() { |
|
1251 | 1251 | return $this->mask; |
1252 | 1252 | } |
1253 | 1253 | |
@@ -1258,9 +1258,9 @@ discard block |
||
1258 | 1258 | * @return mixed |
1259 | 1259 | * @throws MaskNotFoundException |
1260 | 1260 | */ |
1261 | - public function mask($mask = null){ |
|
1261 | + public function mask($mask = null) { |
|
1262 | 1262 | $mask = $mask !== null ? $mask : $this->mask; |
1263 | - if(class_exists($mask)){ |
|
1263 | + if (class_exists($mask)) { |
|
1264 | 1264 | return new $mask($this); |
1265 | 1265 | } |
1266 | 1266 | |
@@ -1273,7 +1273,7 @@ discard block |
||
1273 | 1273 | * |
1274 | 1274 | * @return $this |
1275 | 1275 | */ |
1276 | - public function setFolderPath($folder_path){ |
|
1276 | + public function setFolderPath($folder_path) { |
|
1277 | 1277 | $this->folder_path = $folder_path; |
1278 | 1278 | |
1279 | 1279 | return $this; |
@@ -1285,7 +1285,7 @@ discard block |
||
1285 | 1285 | * |
1286 | 1286 | * @return $this |
1287 | 1287 | */ |
1288 | - public function setConfig($config){ |
|
1288 | + public function setConfig($config) { |
|
1289 | 1289 | $this->config = $config; |
1290 | 1290 | |
1291 | 1291 | return $this; |
@@ -1297,7 +1297,7 @@ discard block |
||
1297 | 1297 | * |
1298 | 1298 | * @return $this |
1299 | 1299 | */ |
1300 | - public function setAvailableFlags($available_flags){ |
|
1300 | + public function setAvailableFlags($available_flags) { |
|
1301 | 1301 | $this->available_flags = $available_flags; |
1302 | 1302 | |
1303 | 1303 | return $this; |
@@ -1309,7 +1309,7 @@ discard block |
||
1309 | 1309 | * |
1310 | 1310 | * @return $this |
1311 | 1311 | */ |
1312 | - public function setAttachments($attachments){ |
|
1312 | + public function setAttachments($attachments) { |
|
1313 | 1313 | $this->attachments = $attachments; |
1314 | 1314 | |
1315 | 1315 | return $this; |
@@ -1321,7 +1321,7 @@ discard block |
||
1321 | 1321 | * |
1322 | 1322 | * @return $this |
1323 | 1323 | */ |
1324 | - public function setFlags($flags){ |
|
1324 | + public function setFlags($flags) { |
|
1325 | 1325 | $this->flags = $flags; |
1326 | 1326 | |
1327 | 1327 | return $this; |
@@ -1335,7 +1335,7 @@ discard block |
||
1335 | 1335 | * @throws Exceptions\RuntimeException |
1336 | 1336 | * @throws Exceptions\ConnectionFailedException |
1337 | 1337 | */ |
1338 | - public function setClient($client){ |
|
1338 | + public function setClient($client) { |
|
1339 | 1339 | $this->client = $client; |
1340 | 1340 | $this->client->openFolder($this->folder_path); |
1341 | 1341 | |
@@ -1350,7 +1350,7 @@ discard block |
||
1350 | 1350 | * @throws Exceptions\RuntimeException |
1351 | 1351 | * @return $this |
1352 | 1352 | */ |
1353 | - public function setUid($uid){ |
|
1353 | + public function setUid($uid) { |
|
1354 | 1354 | $this->uid = $uid; |
1355 | 1355 | $this->msgn = $this->client->getConnection()->getMessageNumber($this->uid); |
1356 | 1356 | $this->msglist = null; |
@@ -1367,7 +1367,7 @@ discard block |
||
1367 | 1367 | * @throws Exceptions\RuntimeException |
1368 | 1368 | * @return $this |
1369 | 1369 | */ |
1370 | - public function setMsgn($msgn, $msglist = null){ |
|
1370 | + public function setMsgn($msgn, $msglist = null) { |
|
1371 | 1371 | $this->msgn = $msgn; |
1372 | 1372 | $this->msglist = $msglist; |
1373 | 1373 | $this->uid = $this->client->getConnection()->getUid($this->msgn); |
@@ -1380,7 +1380,7 @@ discard block |
||
1380 | 1380 | * |
1381 | 1381 | * @return int |
1382 | 1382 | */ |
1383 | - public function getSequence(){ |
|
1383 | + public function getSequence() { |
|
1384 | 1384 | return $this->sequence; |
1385 | 1385 | } |
1386 | 1386 | |
@@ -1389,7 +1389,7 @@ discard block |
||
1389 | 1389 | * |
1390 | 1390 | * @return int |
1391 | 1391 | */ |
1392 | - public function getSequenceId(){ |
|
1392 | + public function getSequenceId() { |
|
1393 | 1393 | return $this->sequence === IMAP::ST_UID ? $this->uid : $this->msgn; |
1394 | 1394 | } |
1395 | 1395 | |
@@ -1401,11 +1401,11 @@ discard block |
||
1401 | 1401 | * @throws Exceptions\ConnectionFailedException |
1402 | 1402 | * @throws Exceptions\RuntimeException |
1403 | 1403 | */ |
1404 | - public function setSequenceId($uid, $msglist = null){ |
|
1404 | + public function setSequenceId($uid, $msglist = null) { |
|
1405 | 1405 | if ($this->getSequence() === IMAP::ST_UID) { |
1406 | 1406 | $this->setUid($uid); |
1407 | 1407 | $this->setMsglist($msglist); |
1408 | - }else{ |
|
1408 | + }else { |
|
1409 | 1409 | $this->setMsgn($uid, $msglist); |
1410 | 1410 | } |
1411 | 1411 | } |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | if(strtolower(substr($method, 0, 3)) === 'get') { |
306 | 306 | $name = Str::snake(substr($method, 3)); |
307 | 307 | return $this->get($name); |
308 | - }elseif (strtolower(substr($method, 0, 3)) === 'set') { |
|
308 | + } elseif (strtolower(substr($method, 0, 3)) === 'set') { |
|
309 | 309 | $name = Str::snake(substr($method, 3)); |
310 | 310 | |
311 | 311 | if(in_array($name, array_keys($this->attributes))) { |
@@ -511,7 +511,7 @@ discard block |
||
511 | 511 | if ($this->getFlags()->get("seen") == null) { |
512 | 512 | $this->unsetFlag("Seen"); |
513 | 513 | } |
514 | - }elseif ($this->getFlags()->get("seen") != null) { |
|
514 | + } elseif ($this->getFlags()->get("seen") != null) { |
|
515 | 515 | $this->setFlag("Seen"); |
516 | 516 | } |
517 | 517 | } |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | private function fetchPart(Part $part) { |
556 | 556 | if ($part->isAttachment()) { |
557 | 557 | $this->fetchAttachment($part); |
558 | - }else{ |
|
558 | + } else{ |
|
559 | 559 | $encoding = $this->getEncoding($part); |
560 | 560 | |
561 | 561 | $content = $this->decodeString($part->content, $part->encoding); |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | |
581 | 581 | if (isset($this->bodies[$subtype])) { |
582 | 582 | $this->bodies[$subtype] .= "\n".$content; |
583 | - }else{ |
|
583 | + } else{ |
|
584 | 584 | $this->bodies[$subtype] = $content; |
585 | 585 | } |
586 | 586 | } |
@@ -751,9 +751,9 @@ discard block |
||
751 | 751 | return EncodingAliases::get($parameter->value); |
752 | 752 | } |
753 | 753 | } |
754 | - }elseif (property_exists($structure, 'charset')){ |
|
754 | + } elseif (property_exists($structure, 'charset')){ |
|
755 | 755 | return EncodingAliases::get($structure->charset); |
756 | - }elseif (is_string($structure) === true){ |
|
756 | + } elseif (is_string($structure) === true){ |
|
757 | 757 | return mb_detect_encoding($structure); |
758 | 758 | } |
759 | 759 | |
@@ -937,13 +937,15 @@ discard block |
||
937 | 937 | * @throws MessageHeaderFetchingException |
938 | 938 | */ |
939 | 939 | protected function fetchNewMail($folder, $next_uid, $event, $expunge){ |
940 | - if($expunge) $this->client->expunge(); |
|
940 | + if($expunge) { |
|
941 | + $this->client->expunge(); |
|
942 | + } |
|
941 | 943 | |
942 | 944 | $this->client->openFolder($folder->path); |
943 | 945 | |
944 | 946 | if ($this->sequence === IMAP::ST_UID) { |
945 | 947 | $sequence_id = $next_uid; |
946 | - }else{ |
|
948 | + } else{ |
|
947 | 949 | $sequence_id = $this->client->getConnection()->getMessageNumber($next_uid); |
948 | 950 | } |
949 | 951 | |
@@ -966,7 +968,9 @@ discard block |
||
966 | 968 | */ |
967 | 969 | public function delete($expunge = true) { |
968 | 970 | $status = $this->setFlag("Deleted"); |
969 | - if($expunge) $this->client->expunge(); |
|
971 | + if($expunge) { |
|
972 | + $this->client->expunge(); |
|
973 | + } |
|
970 | 974 | |
971 | 975 | $event = $this->getEvent("message", "deleted"); |
972 | 976 | $event::dispatch($this); |
@@ -986,7 +990,9 @@ discard block |
||
986 | 990 | */ |
987 | 991 | public function restore($expunge = true) { |
988 | 992 | $status = $this->unsetFlag("Deleted"); |
989 | - if($expunge) $this->client->expunge(); |
|
993 | + if($expunge) { |
|
994 | + $this->client->expunge(); |
|
995 | + } |
|
990 | 996 | |
991 | 997 | $event = $this->getEvent("message", "restored"); |
992 | 998 | $event::dispatch($this); |
@@ -1405,7 +1411,7 @@ discard block |
||
1405 | 1411 | if ($this->getSequence() === IMAP::ST_UID) { |
1406 | 1412 | $this->setUid($uid); |
1407 | 1413 | $this->setMsglist($msglist); |
1408 | - }else{ |
|
1414 | + } else{ |
|
1409 | 1415 | $this->setMsgn($uid, $msglist); |
1410 | 1416 | } |
1411 | 1417 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * @throws MessageContentFetchingException |
78 | 78 | * @throws InvalidMessageDateException |
79 | 79 | */ |
80 | - protected function parse(){ |
|
80 | + protected function parse() { |
|
81 | 81 | $this->findContentType(); |
82 | 82 | $this->parts = $this->find_parts(); |
83 | 83 | } |
@@ -85,12 +85,12 @@ discard block |
||
85 | 85 | /** |
86 | 86 | * Determine the message content type |
87 | 87 | */ |
88 | - public function findContentType(){ |
|
88 | + public function findContentType() { |
|
89 | 89 | $content_type = $this->header->get("content_type"); |
90 | 90 | $content_type = (is_array($content_type)) ? implode(' ', $content_type) : $content_type; |
91 | - if(stripos($content_type, 'multipart') === 0) { |
|
91 | + if (stripos($content_type, 'multipart') === 0) { |
|
92 | 92 | $this->type = IMAP::MESSAGE_TYPE_MULTIPART; |
93 | - }else{ |
|
93 | + }else { |
|
94 | 94 | $this->type = IMAP::MESSAGE_TYPE_TEXT; |
95 | 95 | } |
96 | 96 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * @return Part[] |
104 | 104 | * @throws InvalidMessageDateException |
105 | 105 | */ |
106 | - private function parsePart($context, $part_number = 0){ |
|
106 | + private function parsePart($context, $part_number = 0) { |
|
107 | 107 | $body = $context; |
108 | 108 | while (($pos = strpos($body, "\r\n")) > 0) { |
109 | 109 | $body = substr($body, $pos + 2); |
@@ -126,10 +126,10 @@ discard block |
||
126 | 126 | * @return array |
127 | 127 | * @throws InvalidMessageDateException |
128 | 128 | */ |
129 | - private function detectParts($boundary, $context, $part_number = 0){ |
|
130 | - $base_parts = explode( $boundary, $context); |
|
129 | + private function detectParts($boundary, $context, $part_number = 0) { |
|
130 | + $base_parts = explode($boundary, $context); |
|
131 | 131 | $final_parts = []; |
132 | - foreach($base_parts as $ctx) { |
|
132 | + foreach ($base_parts as $ctx) { |
|
133 | 133 | $ctx = substr($ctx, 2); |
134 | 134 | if ($ctx !== "--" && $ctx != "") { |
135 | 135 | $parts = $this->parsePart($ctx, $part_number); |
@@ -150,9 +150,9 @@ discard block |
||
150 | 150 | * @throws MessageContentFetchingException |
151 | 151 | * @throws InvalidMessageDateException |
152 | 152 | */ |
153 | - public function find_parts(){ |
|
154 | - if($this->type === IMAP::MESSAGE_TYPE_MULTIPART) { |
|
155 | - if (($boundary = $this->header->getBoundary()) === null) { |
|
153 | + public function find_parts() { |
|
154 | + if ($this->type === IMAP::MESSAGE_TYPE_MULTIPART) { |
|
155 | + if (($boundary = $this->header->getBoundary()) === null) { |
|
156 | 156 | throw new MessageContentFetchingException("no content found", 0); |
157 | 157 | } |
158 | 158 | |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | * @return string|null |
169 | 169 | * @Depricated since version 2.4.4 |
170 | 170 | */ |
171 | - public function getBoundary(){ |
|
171 | + public function getBoundary() { |
|
172 | 172 | return $this->header->getBoundary(); |
173 | 173 | } |
174 | 174 | } |
@@ -90,7 +90,7 @@ |
||
90 | 90 | $content_type = (is_array($content_type)) ? implode(' ', $content_type) : $content_type; |
91 | 91 | if(stripos($content_type, 'multipart') === 0) { |
92 | 92 | $this->type = IMAP::MESSAGE_TYPE_MULTIPART; |
93 | - }else{ |
|
93 | + } else{ |
|
94 | 94 | $this->type = IMAP::MESSAGE_TYPE_TEXT; |
95 | 95 | } |
96 | 96 | } |