@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | public function __construct($uid, $msglist, Client $client, $fetch_options = null, $fetch_body = false, $fetch_attachment = false, $fetch_flags = false) { |
| 198 | 198 | |
| 199 | 199 | $default_mask = $client->getDefaultMessageMask(); |
| 200 | - if($default_mask != null) { |
|
| 200 | + if ($default_mask != null) { |
|
| 201 | 201 | $this->mask = $default_mask; |
| 202 | 202 | } |
| 203 | 203 | |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | $this->msglist = $msglist; |
| 217 | 217 | $this->client = $client; |
| 218 | 218 | |
| 219 | - $this->uid = ($this->fetch_options == IMAP::FT_UID) ? $uid : $uid; |
|
| 219 | + $this->uid = ($this->fetch_options == IMAP::FT_UID) ? $uid : $uid; |
|
| 220 | 220 | $this->msgn = ($this->fetch_options == IMAP::FT_UID) ? \imap_msgno($this->client->getConnection(), $uid) : $uid; |
| 221 | 221 | |
| 222 | 222 | $this->parseHeader(); |
@@ -239,17 +239,17 @@ 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 | |
| 245 | - if(in_array($name, array_keys($this->attributes))) { |
|
| 245 | + if (in_array($name, array_keys($this->attributes))) { |
|
| 246 | 246 | return $this->attributes[$name]; |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | }elseif (strtolower(substr($method, 0, 3)) === 'set') { |
| 250 | 250 | $name = Str::snake(substr($method, 3)); |
| 251 | 251 | |
| 252 | - if(in_array($name, array_keys($this->attributes))) { |
|
| 252 | + if (in_array($name, array_keys($this->attributes))) { |
|
| 253 | 253 | $this->attributes[$name] = array_pop($arguments); |
| 254 | 254 | |
| 255 | 255 | return $this->attributes[$name]; |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | * @return mixed|null |
| 279 | 279 | */ |
| 280 | 280 | public function __get($name) { |
| 281 | - if(isset($this->attributes[$name])) { |
|
| 281 | + if (isset($this->attributes[$name])) { |
|
| 282 | 282 | return $this->attributes[$name]; |
| 283 | 283 | } |
| 284 | 284 | |
@@ -364,11 +364,11 @@ discard block |
||
| 364 | 364 | if ($replaceImages !== false) { |
| 365 | 365 | $this->attachments->each(function($oAttachment) use(&$body, $replaceImages) { |
| 366 | 366 | /** @var Attachment $oAttachment */ |
| 367 | - if(is_callable($replaceImages)) { |
|
| 367 | + if (is_callable($replaceImages)) { |
|
| 368 | 368 | $body = $replaceImages($body, $oAttachment); |
| 369 | - }elseif(is_string($replaceImages)) { |
|
| 369 | + }elseif (is_string($replaceImages)) { |
|
| 370 | 370 | call_user_func($replaceImages, [$body, $oAttachment]); |
| 371 | - }else{ |
|
| 371 | + } else { |
|
| 372 | 372 | if ($oAttachment->id && $oAttachment->getImgSrc() != null) { |
| 373 | 373 | $body = str_replace('cid:'.$oAttachment->id, $oAttachment->getImgSrc(), $body); |
| 374 | 374 | } |
@@ -397,16 +397,16 @@ discard block |
||
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | if (property_exists($header, 'subject')) { |
| 400 | - if($this->config['decoder']['message']['subject'] === 'utf-8') { |
|
| 400 | + if ($this->config['decoder']['message']['subject'] === 'utf-8') { |
|
| 401 | 401 | $this->subject = \imap_utf8($header->subject); |
| 402 | - }elseif($this->config['decoder']['message']['subject'] === 'iconv') { |
|
| 402 | + }elseif ($this->config['decoder']['message']['subject'] === 'iconv') { |
|
| 403 | 403 | $this->subject = iconv_mime_decode($header->subject); |
| 404 | - }else{ |
|
| 404 | + } else { |
|
| 405 | 405 | $this->subject = mb_decode_mimeheader($header->subject); |
| 406 | 406 | } |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | - foreach(['from', 'to', 'cc', 'bcc', 'reply_to', 'sender'] as $part){ |
|
| 409 | + foreach (['from', 'to', 'cc', 'bcc', 'reply_to', 'sender'] as $part) { |
|
| 410 | 410 | $this->extractHeaderAddressPart($header, $part); |
| 411 | 411 | } |
| 412 | 412 | |
@@ -436,9 +436,9 @@ discard block |
||
| 436 | 436 | * @return int|null |
| 437 | 437 | */ |
| 438 | 438 | private function extractPriority($header) { |
| 439 | - if(preg_match('/x\-priority\:.*([0-9]{1,2})/i', $header, $priority)){ |
|
| 439 | + if (preg_match('/x\-priority\:.*([0-9]{1,2})/i', $header, $priority)) { |
|
| 440 | 440 | $priority = isset($priority[1]) ? (int) $priority[1] : 0; |
| 441 | - switch($priority){ |
|
| 441 | + switch ($priority) { |
|
| 442 | 442 | case IMAP::MESSAGE_PRIORITY_HIGHEST; |
| 443 | 443 | $priority = IMAP::MESSAGE_PRIORITY_HIGHEST; |
| 444 | 444 | break; |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | if (property_exists($header, 'date')) { |
| 490 | 490 | $date = $header->date; |
| 491 | 491 | |
| 492 | - if(preg_match('/\+0580/', $date)) { |
|
| 492 | + if (preg_match('/\+0580/', $date)) { |
|
| 493 | 493 | $date = str_replace('+0580', '+0530', $date); |
| 494 | 494 | } |
| 495 | 495 | |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | $date = trim(array_pop($array)); |
| 513 | 513 | break; |
| 514 | 514 | } |
| 515 | - try{ |
|
| 515 | + try { |
|
| 516 | 516 | $parsed_date = Carbon::parse($date); |
| 517 | 517 | } catch (\Exception $_e) { |
| 518 | 518 | throw new InvalidMessageDateException("Invalid message date. ID:".$this->getMessageId(), 1000, $e); |
@@ -535,7 +535,7 @@ discard block |
||
| 535 | 535 | $this->client->openFolder($this->folder_path); |
| 536 | 536 | $flags = \imap_fetch_overview($this->client->getConnection(), $this->uid, IMAP::FT_UID); |
| 537 | 537 | if (is_array($flags) && isset($flags[0])) { |
| 538 | - foreach($this->available_flags as $flag) { |
|
| 538 | + foreach ($this->available_flags as $flag) { |
|
| 539 | 539 | $this->parseFlag($flags, $flag); |
| 540 | 540 | } |
| 541 | 541 | } |
@@ -607,7 +607,7 @@ discard block |
||
| 607 | 607 | } else { |
| 608 | 608 | $personalParts = \imap_mime_header_decode($address->personal); |
| 609 | 609 | |
| 610 | - if(is_array($personalParts)) { |
|
| 610 | + if (is_array($personalParts)) { |
|
| 611 | 611 | $address->personal = ''; |
| 612 | 612 | foreach ($personalParts as $p) { |
| 613 | 613 | $encoding = (property_exists($p, 'charset')) ? $p->charset : $this->getEncoding($p->text); |
@@ -635,12 +635,12 @@ discard block |
||
| 635 | 635 | $this->client->openFolder($this->folder_path); |
| 636 | 636 | $this->structure = \imap_fetchstructure($this->client->getConnection(), $this->uid, IMAP::FT_UID); |
| 637 | 637 | |
| 638 | - if(property_exists($this->structure, 'parts')){ |
|
| 638 | + if (property_exists($this->structure, 'parts')) { |
|
| 639 | 639 | $parts = $this->structure->parts; |
| 640 | 640 | |
| 641 | - foreach ($parts as $part) { |
|
| 642 | - foreach ($part->parameters as $parameter) { |
|
| 643 | - if($parameter->attribute == "charset") { |
|
| 641 | + foreach ($parts as $part) { |
|
| 642 | + foreach ($part->parameters as $parameter) { |
|
| 643 | + if ($parameter->attribute == "charset") { |
|
| 644 | 644 | $encoding = $parameter->value; |
| 645 | 645 | |
| 646 | 646 | $encoding = preg_replace('/Content-Transfer-Encoding/', '', $encoding); |
@@ -919,7 +919,7 @@ discard block |
||
| 919 | 919 | return EncodingAliases::get($parameter->value); |
| 920 | 920 | } |
| 921 | 921 | } |
| 922 | - }elseif (is_string($structure) === true){ |
|
| 922 | + }elseif (is_string($structure) === true) { |
|
| 923 | 923 | return mb_detect_encoding($structure); |
| 924 | 924 | } |
| 925 | 925 | |
@@ -969,7 +969,7 @@ discard block |
||
| 969 | 969 | return null; |
| 970 | 970 | } |
| 971 | 971 | |
| 972 | - public function getFolder(){ |
|
| 972 | + public function getFolder() { |
|
| 973 | 973 | return $this->client->getFolder($this->folder_path); |
| 974 | 974 | } |
| 975 | 975 | |
@@ -985,7 +985,7 @@ discard block |
||
| 985 | 985 | */ |
| 986 | 986 | public function moveToFolder($mailbox = 'INBOX', $expunge = false, $create_folder = true) { |
| 987 | 987 | |
| 988 | - if($create_folder) $this->client->createFolder($mailbox, true); |
|
| 988 | + if ($create_folder) $this->client->createFolder($mailbox, true); |
|
| 989 | 989 | |
| 990 | 990 | $target_folder = $this->client->getFolder($mailbox); |
| 991 | 991 | $target_status = $target_folder->getStatus(IMAP::SA_ALL); |
@@ -993,8 +993,8 @@ discard block |
||
| 993 | 993 | $this->client->openFolder($this->folder_path); |
| 994 | 994 | $status = \imap_mail_move($this->client->getConnection(), $this->uid, $mailbox, IMAP::CP_UID); |
| 995 | 995 | |
| 996 | - if($status === true){ |
|
| 997 | - if($expunge) $this->client->expunge(); |
|
| 996 | + if ($status === true) { |
|
| 997 | + if ($expunge) $this->client->expunge(); |
|
| 998 | 998 | $this->client->openFolder($target_folder->path); |
| 999 | 999 | |
| 1000 | 1000 | return $target_folder->getMessage($target_status->uidnext, null, $this->fetch_options, $this->fetch_body, $this->fetch_attachment, $this->fetch_flags); |
@@ -1014,7 +1014,7 @@ discard block |
||
| 1014 | 1014 | $this->client->openFolder($this->folder_path); |
| 1015 | 1015 | |
| 1016 | 1016 | $status = \imap_delete($this->client->getConnection(), $this->uid, IMAP::FT_UID); |
| 1017 | - if($expunge) $this->client->expunge(); |
|
| 1017 | + if ($expunge) $this->client->expunge(); |
|
| 1018 | 1018 | |
| 1019 | 1019 | return $status; |
| 1020 | 1020 | } |
@@ -1030,7 +1030,7 @@ discard block |
||
| 1030 | 1030 | $this->client->openFolder($this->folder_path); |
| 1031 | 1031 | |
| 1032 | 1032 | $status = \imap_undelete($this->client->getConnection(), $this->uid, IMAP::FT_UID); |
| 1033 | - if($expunge) $this->client->expunge(); |
|
| 1033 | + if ($expunge) $this->client->expunge(); |
|
| 1034 | 1034 | |
| 1035 | 1035 | return $status; |
| 1036 | 1036 | } |
@@ -1160,7 +1160,7 @@ discard block |
||
| 1160 | 1160 | /** |
| 1161 | 1161 | * @return object|null |
| 1162 | 1162 | */ |
| 1163 | - public function getStructure(){ |
|
| 1163 | + public function getStructure() { |
|
| 1164 | 1164 | return $this->structure; |
| 1165 | 1165 | } |
| 1166 | 1166 | |
@@ -1186,7 +1186,7 @@ discard block |
||
| 1186 | 1186 | /** |
| 1187 | 1187 | * @return array |
| 1188 | 1188 | */ |
| 1189 | - public function getAttributes(){ |
|
| 1189 | + public function getAttributes() { |
|
| 1190 | 1190 | return $this->attributes; |
| 1191 | 1191 | } |
| 1192 | 1192 | |
@@ -1194,8 +1194,8 @@ discard block |
||
| 1194 | 1194 | * @param $mask |
| 1195 | 1195 | * @return $this |
| 1196 | 1196 | */ |
| 1197 | - public function setMask($mask){ |
|
| 1198 | - if(class_exists($mask)){ |
|
| 1197 | + public function setMask($mask) { |
|
| 1198 | + if (class_exists($mask)) { |
|
| 1199 | 1199 | $this->mask = $mask; |
| 1200 | 1200 | } |
| 1201 | 1201 | |
@@ -1205,7 +1205,7 @@ discard block |
||
| 1205 | 1205 | /** |
| 1206 | 1206 | * @return string |
| 1207 | 1207 | */ |
| 1208 | - public function getMask(){ |
|
| 1208 | + public function getMask() { |
|
| 1209 | 1209 | return $this->mask; |
| 1210 | 1210 | } |
| 1211 | 1211 | |
@@ -1216,9 +1216,9 @@ discard block |
||
| 1216 | 1216 | * @return mixed |
| 1217 | 1217 | * @throws MaskNotFoundException |
| 1218 | 1218 | */ |
| 1219 | - public function mask($mask = null){ |
|
| 1219 | + public function mask($mask = null) { |
|
| 1220 | 1220 | $mask = $mask !== null ? $mask : $this->mask; |
| 1221 | - if(class_exists($mask)){ |
|
| 1221 | + if (class_exists($mask)) { |
|
| 1222 | 1222 | return new $mask($this); |
| 1223 | 1223 | } |
| 1224 | 1224 | |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | return $this->attributes[$name]; |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | - }elseif (strtolower(substr($method, 0, 3)) === 'set') { |
|
| 249 | + } elseif (strtolower(substr($method, 0, 3)) === 'set') { |
|
| 250 | 250 | $name = Str::snake(substr($method, 3)); |
| 251 | 251 | |
| 252 | 252 | if(in_array($name, array_keys($this->attributes))) { |
@@ -366,9 +366,9 @@ discard block |
||
| 366 | 366 | /** @var Attachment $oAttachment */ |
| 367 | 367 | if(is_callable($replaceImages)) { |
| 368 | 368 | $body = $replaceImages($body, $oAttachment); |
| 369 | - }elseif(is_string($replaceImages)) { |
|
| 369 | + } elseif(is_string($replaceImages)) { |
|
| 370 | 370 | call_user_func($replaceImages, [$body, $oAttachment]); |
| 371 | - }else{ |
|
| 371 | + } else{ |
|
| 372 | 372 | if ($oAttachment->id && $oAttachment->getImgSrc() != null) { |
| 373 | 373 | $body = str_replace('cid:'.$oAttachment->id, $oAttachment->getImgSrc(), $body); |
| 374 | 374 | } |
@@ -399,9 +399,9 @@ discard block |
||
| 399 | 399 | if (property_exists($header, 'subject')) { |
| 400 | 400 | if($this->config['decoder']['message']['subject'] === 'utf-8') { |
| 401 | 401 | $this->subject = \imap_utf8($header->subject); |
| 402 | - }elseif($this->config['decoder']['message']['subject'] === 'iconv') { |
|
| 402 | + } elseif($this->config['decoder']['message']['subject'] === 'iconv') { |
|
| 403 | 403 | $this->subject = iconv_mime_decode($header->subject); |
| 404 | - }else{ |
|
| 404 | + } else{ |
|
| 405 | 405 | $this->subject = mb_decode_mimeheader($header->subject); |
| 406 | 406 | } |
| 407 | 407 | } |
@@ -919,7 +919,7 @@ discard block |
||
| 919 | 919 | return EncodingAliases::get($parameter->value); |
| 920 | 920 | } |
| 921 | 921 | } |
| 922 | - }elseif (is_string($structure) === true){ |
|
| 922 | + } elseif (is_string($structure) === true){ |
|
| 923 | 923 | return mb_detect_encoding($structure); |
| 924 | 924 | } |
| 925 | 925 | |
@@ -985,7 +985,9 @@ discard block |
||
| 985 | 985 | */ |
| 986 | 986 | public function moveToFolder($mailbox = 'INBOX', $expunge = false, $create_folder = true) { |
| 987 | 987 | |
| 988 | - if($create_folder) $this->client->createFolder($mailbox, true); |
|
| 988 | + if($create_folder) { |
|
| 989 | + $this->client->createFolder($mailbox, true); |
|
| 990 | + } |
|
| 989 | 991 | |
| 990 | 992 | $target_folder = $this->client->getFolder($mailbox); |
| 991 | 993 | $target_status = $target_folder->getStatus(IMAP::SA_ALL); |
@@ -994,7 +996,9 @@ discard block |
||
| 994 | 996 | $status = \imap_mail_move($this->client->getConnection(), $this->uid, $mailbox, IMAP::CP_UID); |
| 995 | 997 | |
| 996 | 998 | if($status === true){ |
| 997 | - if($expunge) $this->client->expunge(); |
|
| 999 | + if($expunge) { |
|
| 1000 | + $this->client->expunge(); |
|
| 1001 | + } |
|
| 998 | 1002 | $this->client->openFolder($target_folder->path); |
| 999 | 1003 | |
| 1000 | 1004 | return $target_folder->getMessage($target_status->uidnext, null, $this->fetch_options, $this->fetch_body, $this->fetch_attachment, $this->fetch_flags); |
@@ -1014,7 +1018,9 @@ discard block |
||
| 1014 | 1018 | $this->client->openFolder($this->folder_path); |
| 1015 | 1019 | |
| 1016 | 1020 | $status = \imap_delete($this->client->getConnection(), $this->uid, IMAP::FT_UID); |
| 1017 | - if($expunge) $this->client->expunge(); |
|
| 1021 | + if($expunge) { |
|
| 1022 | + $this->client->expunge(); |
|
| 1023 | + } |
|
| 1018 | 1024 | |
| 1019 | 1025 | return $status; |
| 1020 | 1026 | } |
@@ -1030,7 +1036,9 @@ discard block |
||
| 1030 | 1036 | $this->client->openFolder($this->folder_path); |
| 1031 | 1037 | |
| 1032 | 1038 | $status = \imap_undelete($this->client->getConnection(), $this->uid, IMAP::FT_UID); |
| 1033 | - if($expunge) $this->client->expunge(); |
|
| 1039 | + if($expunge) { |
|
| 1040 | + $this->client->expunge(); |
|
| 1041 | + } |
|
| 1034 | 1042 | |
| 1035 | 1043 | return $status; |
| 1036 | 1044 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $this->part_number = ($part_number) ? $part_number : $this->part_number; |
| 98 | 98 | |
| 99 | 99 | $default_mask = $this->oMessage->getClient()->getDefaultAttachmentMask(); |
| 100 | - if($default_mask != null) { |
|
| 100 | + if ($default_mask != null) { |
|
| 101 | 101 | $this->mask = $default_mask; |
| 102 | 102 | } |
| 103 | 103 | |
@@ -114,10 +114,10 @@ discard block |
||
| 114 | 114 | * @throws MethodNotFoundException |
| 115 | 115 | */ |
| 116 | 116 | public function __call($method, $arguments) { |
| 117 | - if(strtolower(substr($method, 0, 3)) === 'get') { |
|
| 117 | + if (strtolower(substr($method, 0, 3)) === 'get') { |
|
| 118 | 118 | $name = Str::snake(substr($method, 3)); |
| 119 | 119 | |
| 120 | - if(isset($this->attributes[$name])) { |
|
| 120 | + if (isset($this->attributes[$name])) { |
|
| 121 | 121 | return $this->attributes[$name]; |
| 122 | 122 | } |
| 123 | 123 | |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | * @return mixed|null |
| 152 | 152 | */ |
| 153 | 153 | public function __get($name) { |
| 154 | - if(isset($this->attributes[$name])) { |
|
| 154 | + if (isset($this->attributes[$name])) { |
|
| 155 | 155 | return $this->attributes[$name]; |
| 156 | 156 | } |
| 157 | 157 | |
@@ -263,11 +263,11 @@ discard block |
||
| 263 | 263 | * @param $name |
| 264 | 264 | */ |
| 265 | 265 | public function setName($name) { |
| 266 | - if($this->config['decoder']['attachment']['name'] === 'utf-8') { |
|
| 266 | + if ($this->config['decoder']['attachment']['name'] === 'utf-8') { |
|
| 267 | 267 | $this->name = \imap_utf8($name); |
| 268 | - }elseif($this->config['decoder']['attachment']['name'] === 'iconv') { |
|
| 268 | + }elseif ($this->config['decoder']['attachment']['name'] === 'iconv') { |
|
| 269 | 269 | $this->name = iconv_mime_decode($name); |
| 270 | - }else{ |
|
| 270 | + } else { |
|
| 271 | 271 | $this->name = mb_decode_mimeheader($name); |
| 272 | 272 | } |
| 273 | 273 | } |
@@ -287,16 +287,16 @@ discard block |
||
| 287 | 287 | /** |
| 288 | 288 | * @return string|null |
| 289 | 289 | */ |
| 290 | - public function getMimeType(){ |
|
| 290 | + public function getMimeType() { |
|
| 291 | 291 | return (new \finfo())->buffer($this->getContent(), FILEINFO_MIME_TYPE); |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | /** |
| 295 | 295 | * @return string|null |
| 296 | 296 | */ |
| 297 | - public function getExtension(){ |
|
| 297 | + public function getExtension() { |
|
| 298 | 298 | $deprecated_guesser = "\Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser"; |
| 299 | - if (class_exists($deprecated_guesser) !== false){ |
|
| 299 | + if (class_exists($deprecated_guesser) !== false) { |
|
| 300 | 300 | return $deprecated_guesser::getInstance()->guess($this->getMimeType()); |
| 301 | 301 | } |
| 302 | 302 | $guesser = "\Symfony\Component\Mime\MimeTypes"; |
@@ -307,14 +307,14 @@ discard block |
||
| 307 | 307 | /** |
| 308 | 308 | * @return array |
| 309 | 309 | */ |
| 310 | - public function getAttributes(){ |
|
| 310 | + public function getAttributes() { |
|
| 311 | 311 | return $this->attributes; |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | /** |
| 315 | 315 | * @return Message |
| 316 | 316 | */ |
| 317 | - public function getMessage(){ |
|
| 317 | + public function getMessage() { |
|
| 318 | 318 | return $this->oMessage; |
| 319 | 319 | } |
| 320 | 320 | |
@@ -322,8 +322,8 @@ discard block |
||
| 322 | 322 | * @param $mask |
| 323 | 323 | * @return $this |
| 324 | 324 | */ |
| 325 | - public function setMask($mask){ |
|
| 326 | - if(class_exists($mask)){ |
|
| 325 | + public function setMask($mask) { |
|
| 326 | + if (class_exists($mask)) { |
|
| 327 | 327 | $this->mask = $mask; |
| 328 | 328 | } |
| 329 | 329 | |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | /** |
| 334 | 334 | * @return string |
| 335 | 335 | */ |
| 336 | - public function getMask(){ |
|
| 336 | + public function getMask() { |
|
| 337 | 337 | return $this->mask; |
| 338 | 338 | } |
| 339 | 339 | |
@@ -344,9 +344,9 @@ discard block |
||
| 344 | 344 | * @return mixed |
| 345 | 345 | * @throws MaskNotFoundException |
| 346 | 346 | */ |
| 347 | - public function mask($mask = null){ |
|
| 347 | + public function mask($mask = null) { |
|
| 348 | 348 | $mask = $mask !== null ? $mask : $this->mask; |
| 349 | - if(class_exists($mask)){ |
|
| 349 | + if (class_exists($mask)) { |
|
| 350 | 350 | return new $mask($this); |
| 351 | 351 | } |
| 352 | 352 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | return null; |
| 125 | - }elseif (strtolower(substr($method, 0, 3)) === 'set') { |
|
| 125 | + } elseif (strtolower(substr($method, 0, 3)) === 'set') { |
|
| 126 | 126 | $name = Str::snake(substr($method, 3)); |
| 127 | 127 | |
| 128 | 128 | $this->attributes[$name] = array_pop($arguments); |
@@ -265,9 +265,9 @@ discard block |
||
| 265 | 265 | public function setName($name) { |
| 266 | 266 | if($this->config['decoder']['attachment']['name'] === 'utf-8') { |
| 267 | 267 | $this->name = \imap_utf8($name); |
| 268 | - }elseif($this->config['decoder']['attachment']['name'] === 'iconv') { |
|
| 268 | + } elseif($this->config['decoder']['attachment']['name'] === 'iconv') { |
|
| 269 | 269 | $this->name = iconv_mime_decode($name); |
| 270 | - }else{ |
|
| 270 | + } else{ |
|
| 271 | 271 | $this->name = mb_decode_mimeheader($name); |
| 272 | 272 | } |
| 273 | 273 | } |