@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | public function __construct($msgn, $msglist, Client $client, $fetch_options = null, $fetch_body = false, $fetch_flags = false) { |
| 195 | 195 | |
| 196 | 196 | $default_mask = $client->getDefaultMessageMask(); |
| 197 | - if($default_mask != null) { |
|
| 197 | + if ($default_mask != null) { |
|
| 198 | 198 | $this->mask = $default_mask; |
| 199 | 199 | } |
| 200 | 200 | $this->events["message"] = $client->getDefaultEvents("message"); |
@@ -239,13 +239,13 @@ discard block |
||
| 239 | 239 | * @throws MethodNotFoundException |
| 240 | 240 | */ |
| 241 | 241 | public function __call($method, $arguments) { |
| 242 | - if(strtolower(substr($method, 0, 3)) === 'get') { |
|
| 242 | + if (strtolower(substr($method, 0, 3)) === 'get') { |
|
| 243 | 243 | $name = Str::snake(substr($method, 3)); |
| 244 | 244 | return $this->get($name); |
| 245 | 245 | }elseif (strtolower(substr($method, 0, 3)) === 'set') { |
| 246 | 246 | $name = Str::snake(substr($method, 3)); |
| 247 | 247 | |
| 248 | - if(in_array($name, array_keys($this->attributes))) { |
|
| 248 | + if (in_array($name, array_keys($this->attributes))) { |
|
| 249 | 249 | $this->attributes[$name] = array_pop($arguments); |
| 250 | 250 | |
| 251 | 251 | return $this->attributes[$name]; |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | * @return mixed|null |
| 287 | 287 | */ |
| 288 | 288 | public function get($name) { |
| 289 | - if(isset($this->attributes[$name])) { |
|
| 289 | + if (isset($this->attributes[$name])) { |
|
| 290 | 290 | return $this->attributes[$name]; |
| 291 | 291 | } |
| 292 | 292 | |
@@ -368,8 +368,8 @@ discard block |
||
| 368 | 368 | $flags = $this->client->getConnection()->flags([$this->msgn]); |
| 369 | 369 | |
| 370 | 370 | if (isset($flags[$this->msgn])) { |
| 371 | - foreach($flags[$this->msgn] as $flag) { |
|
| 372 | - if (strpos($flag, "\\") === 0){ |
|
| 371 | + foreach ($flags[$this->msgn] as $flag) { |
|
| 372 | + if (strpos($flag, "\\") === 0) { |
|
| 373 | 373 | $flag = substr($flag, 1); |
| 374 | 374 | } |
| 375 | 375 | $flag_key = strtolower($flag); |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | } elseif ($part->ifdisposition == 1 && strtolower($part->disposition) == 'attachment') { |
| 467 | 467 | $this->fetchAttachment($part); |
| 468 | 468 | } |
| 469 | - } else { |
|
| 469 | + }else { |
|
| 470 | 470 | $this->fetchAttachment($part); |
| 471 | 471 | } |
| 472 | 472 | } |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | if (str_replace(' ', '_', $oAttachment->getName()) !== null) { |
| 483 | 483 | if ($oAttachment->getId() !== null) { |
| 484 | 484 | $this->attachments->put($oAttachment->getId(), $oAttachment); |
| 485 | - } else { |
|
| 485 | + }else { |
|
| 486 | 486 | $this->attachments->push($oAttachment); |
| 487 | 487 | } |
| 488 | 488 | } |
@@ -599,7 +599,7 @@ discard block |
||
| 599 | 599 | |
| 600 | 600 | if (function_exists('iconv') && $from != 'UTF-7' && $to != 'UTF-7') { |
| 601 | 601 | return @iconv($from, $to.'//IGNORE', $str); |
| 602 | - } else { |
|
| 602 | + }else { |
|
| 603 | 603 | if (!$from) { |
| 604 | 604 | return mb_convert_encoding($str, $to); |
| 605 | 605 | } |
@@ -620,9 +620,9 @@ discard block |
||
| 620 | 620 | return EncodingAliases::get($parameter->value); |
| 621 | 621 | } |
| 622 | 622 | } |
| 623 | - }elseif (property_exists($structure, 'charset')){ |
|
| 623 | + }elseif (property_exists($structure, 'charset')) { |
|
| 624 | 624 | return EncodingAliases::get($structure->charset); |
| 625 | - }elseif (is_string($structure) === true){ |
|
| 625 | + }elseif (is_string($structure) === true) { |
|
| 626 | 626 | return mb_detect_encoding($structure); |
| 627 | 627 | } |
| 628 | 628 | |
@@ -636,7 +636,7 @@ discard block |
||
| 636 | 636 | * @throws Exceptions\ConnectionFailedException |
| 637 | 637 | * @throws Exceptions\FolderFetchingException |
| 638 | 638 | */ |
| 639 | - public function getFolder(){ |
|
| 639 | + public function getFolder() { |
|
| 640 | 640 | return $this->client->getFolder($this->folder_path); |
| 641 | 641 | } |
| 642 | 642 | |
@@ -713,7 +713,7 @@ discard block |
||
| 713 | 713 | */ |
| 714 | 714 | public function delete($expunge = true) { |
| 715 | 715 | $status = $this->setFlag("Deleted"); |
| 716 | - if($expunge) $this->client->expunge(); |
|
| 716 | + if ($expunge) $this->client->expunge(); |
|
| 717 | 717 | |
| 718 | 718 | $event = $this->getEvent("message", "deleted"); |
| 719 | 719 | $event::dispatch($this); |
@@ -732,7 +732,7 @@ discard block |
||
| 732 | 732 | */ |
| 733 | 733 | public function restore($expunge = true) { |
| 734 | 734 | $status = $this->unsetFlag("Deleted"); |
| 735 | - if($expunge) $this->client->expunge(); |
|
| 735 | + if ($expunge) $this->client->expunge(); |
|
| 736 | 736 | |
| 737 | 737 | $event = $this->getEvent("message", "restored"); |
| 738 | 738 | $event::dispatch($this); |
@@ -885,7 +885,7 @@ discard block |
||
| 885 | 885 | * |
| 886 | 886 | * @return object|null |
| 887 | 887 | */ |
| 888 | - public function getStructure(){ |
|
| 888 | + public function getStructure() { |
|
| 889 | 889 | return $this->structure; |
| 890 | 890 | } |
| 891 | 891 | |
@@ -911,7 +911,7 @@ discard block |
||
| 911 | 911 | * |
| 912 | 912 | * @return array |
| 913 | 913 | */ |
| 914 | - public function getAttributes(){ |
|
| 914 | + public function getAttributes() { |
|
| 915 | 915 | return array_merge($this->attributes, $this->header->getAttributes()); |
| 916 | 916 | } |
| 917 | 917 | |
@@ -921,8 +921,8 @@ discard block |
||
| 921 | 921 | * |
| 922 | 922 | * @return $this |
| 923 | 923 | */ |
| 924 | - public function setMask($mask){ |
|
| 925 | - if(class_exists($mask)){ |
|
| 924 | + public function setMask($mask) { |
|
| 925 | + if (class_exists($mask)) { |
|
| 926 | 926 | $this->mask = $mask; |
| 927 | 927 | } |
| 928 | 928 | |
@@ -934,7 +934,7 @@ discard block |
||
| 934 | 934 | * |
| 935 | 935 | * @return string |
| 936 | 936 | */ |
| 937 | - public function getMask(){ |
|
| 937 | + public function getMask() { |
|
| 938 | 938 | return $this->mask; |
| 939 | 939 | } |
| 940 | 940 | |
@@ -945,9 +945,9 @@ discard block |
||
| 945 | 945 | * @return mixed |
| 946 | 946 | * @throws MaskNotFoundException |
| 947 | 947 | */ |
| 948 | - public function mask($mask = null){ |
|
| 948 | + public function mask($mask = null) { |
|
| 949 | 949 | $mask = $mask !== null ? $mask : $this->mask; |
| 950 | - if(class_exists($mask)){ |
|
| 950 | + if (class_exists($mask)) { |
|
| 951 | 951 | return new $mask($this); |
| 952 | 952 | } |
| 953 | 953 | |