@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | $this->msglist = $msglist; |
| 188 | 188 | $this->client = $client; |
| 189 | 189 | |
| 190 | - $this->uid = ($this->fetch_options == FT_UID) ? $uid : $uid; |
|
| 190 | + $this->uid = ($this->fetch_options == FT_UID) ? $uid : $uid; |
|
| 191 | 191 | $this->msgn = ($this->fetch_options == FT_UID) ? imap_msgno($this->client->getConnection(), $uid) : $uid; |
| 192 | 192 | |
| 193 | 193 | $this->parseHeader(); |
@@ -295,9 +295,9 @@ discard block |
||
| 295 | 295 | $header = imap_rfc822_parse_headers($this->header); |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | - if(preg_match('/x\-priority\:.*([0-9]{1,2})/i', $this->header, $priority)){ |
|
| 298 | + if (preg_match('/x\-priority\:.*([0-9]{1,2})/i', $this->header, $priority)) { |
|
| 299 | 299 | $priority = isset($priority[1]) ? (int) $priority[1] : 0; |
| 300 | - switch($priority){ |
|
| 300 | + switch ($priority) { |
|
| 301 | 301 | case self::PRIORITY_HIGHEST; |
| 302 | 302 | $this->priority = self::PRIORITY_HIGHEST; |
| 303 | 303 | break; |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | * Please report any new invalid timestamps to [#45](https://github.com/Webklex/laravel-imap/issues/45) |
| 378 | 378 | */ |
| 379 | 379 | |
| 380 | - if(preg_match('/\+0580/', $date)) { |
|
| 380 | + if (preg_match('/\+0580/', $date)) { |
|
| 381 | 381 | $date = str_replace('+0580', '+0530', $date); |
| 382 | 382 | } |
| 383 | 383 | |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | $date .= 'C'; |
| 399 | 399 | break; |
| 400 | 400 | } |
| 401 | - try{ |
|
| 401 | + try { |
|
| 402 | 402 | $this->date = Carbon::parse($date); |
| 403 | 403 | } catch (\Exception $_e) { |
| 404 | 404 | throw new InvalidMessageDateException("Invalid message date. ID:".$this->getMessageId(), 1000, $e); |
@@ -500,12 +500,12 @@ discard block |
||
| 500 | 500 | public function parseBody() { |
| 501 | 501 | $structure = imap_fetchstructure($this->client->getConnection(), $this->uid, FT_UID); |
| 502 | 502 | |
| 503 | - if(property_exists($structure, 'parts')){ |
|
| 503 | + if (property_exists($structure, 'parts')) { |
|
| 504 | 504 | $parts = $structure->parts; |
| 505 | 505 | |
| 506 | - foreach ($parts as $part) { |
|
| 507 | - foreach ($part->parameters as $parameter) { |
|
| 508 | - if($parameter->attribute == "charset") { |
|
| 506 | + foreach ($parts as $part) { |
|
| 507 | + foreach ($part->parameters as $parameter) { |
|
| 508 | + if ($parameter->attribute == "charset") { |
|
| 509 | 509 | $encoding = $parameter->value; |
| 510 | 510 | |
| 511 | 511 | $encoding = preg_replace('/Content-Transfer-Encoding/', '', $encoding); |
@@ -776,7 +776,7 @@ discard block |
||
| 776 | 776 | return EncodingAliases::get($parameter->value); |
| 777 | 777 | } |
| 778 | 778 | } |
| 779 | - }elseif (is_string($structure) === true){ |
|
| 779 | + }elseif (is_string($structure) === true) { |
|
| 780 | 780 | return mb_detect_encoding($structure); |
| 781 | 781 | } |
| 782 | 782 | |
@@ -846,7 +846,7 @@ discard block |
||
| 846 | 846 | */ |
| 847 | 847 | public function delete($expunge = true) { |
| 848 | 848 | $status = imap_delete($this->client->getConnection(), $this->uid, FT_UID); |
| 849 | - if($expunge) $this->client->expunge(); |
|
| 849 | + if ($expunge) $this->client->expunge(); |
|
| 850 | 850 | |
| 851 | 851 | return $status; |
| 852 | 852 | } |
@@ -860,7 +860,7 @@ discard block |
||
| 860 | 860 | */ |
| 861 | 861 | public function restore($expunge = true) { |
| 862 | 862 | $status = imap_undelete($this->client->getConnection(), $this->uid, FT_UID); |
| 863 | - if($expunge) $this->client->expunge(); |
|
| 863 | + if ($expunge) $this->client->expunge(); |
|
| 864 | 864 | |
| 865 | 865 | return $status; |
| 866 | 866 | } |