@@ -346,7 +346,9 @@ discard block |
||
346 | 346 | public function createFolder($name, $expunge = true) { |
347 | 347 | $this->checkConnection(); |
348 | 348 | $status = imap_createmailbox($this->getConnection(), $this->getAddress() . imap_utf7_encode($name)); |
349 | - if($expunge) $this->expunge(); |
|
349 | + if($expunge) { |
|
350 | + $this->expunge(); |
|
351 | + } |
|
350 | 352 | |
351 | 353 | return $status; |
352 | 354 | } |
@@ -363,7 +365,9 @@ discard block |
||
363 | 365 | public function renameFolder($old_name, $new_name, $expunge = true) { |
364 | 366 | $this->checkConnection(); |
365 | 367 | $status = imap_renamemailbox($this->getConnection(), $this->getAddress() . imap_utf7_encode($old_name), $this->getAddress() . imap_utf7_encode($new_name)); |
366 | - if($expunge) $this->expunge(); |
|
368 | + if($expunge) { |
|
369 | + $this->expunge(); |
|
370 | + } |
|
367 | 371 | |
368 | 372 | return $status; |
369 | 373 | } |
@@ -379,7 +383,9 @@ discard block |
||
379 | 383 | public function deleteFolder($name, $expunge = true) { |
380 | 384 | $this->checkConnection(); |
381 | 385 | $status = imap_deletemailbox($this->getConnection(), $this->getAddress() . imap_utf7_encode($name)); |
382 | - if($expunge) $this->expunge(); |
|
386 | + if($expunge) { |
|
387 | + $this->expunge(); |
|
388 | + } |
|
383 | 389 | |
384 | 390 | return $status; |
385 | 391 | } |
@@ -594,9 +600,9 @@ discard block |
||
594 | 600 | public function setTimeout($type, $timeout) { |
595 | 601 | if(is_numeric($type)) { |
596 | 602 | $type = (int) $type; |
597 | - }elseif (isset($this->timeout_type[$type])){ |
|
603 | + } elseif (isset($this->timeout_type[$type])){ |
|
598 | 604 | $type = $this->timeout_type[$type]; |
599 | - }else{ |
|
605 | + } else{ |
|
600 | 606 | throw new InvalidImapTimeoutTypeException("Invalid imap timeout type provided."); |
601 | 607 | } |
602 | 608 | |
@@ -613,9 +619,9 @@ discard block |
||
613 | 619 | public function getTimeout($type){ |
614 | 620 | if(is_numeric($type)) { |
615 | 621 | $type = (int) $type; |
616 | - }elseif (isset($this->timeout_type[$type])){ |
|
622 | + } elseif (isset($this->timeout_type[$type])){ |
|
617 | 623 | $type = $this->timeout_type[$type]; |
618 | - }else{ |
|
624 | + } else{ |
|
619 | 625 | throw new InvalidImapTimeoutTypeException("Invalid imap timeout type provided."); |
620 | 626 | } |
621 | 627 |
@@ -229,7 +229,7 @@ |
||
229 | 229 | public function setName($name) { |
230 | 230 | if($this->config['decoder']['message']['subject'] === 'utf-8') { |
231 | 231 | $this->name = imap_utf8($name); |
232 | - }else{ |
|
232 | + } else{ |
|
233 | 233 | $this->name = mb_decode_mimeheader($name); |
234 | 234 | } |
235 | 235 | } |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | if (property_exists($header, 'subject')) { |
331 | 331 | if($this->config['decoder']['message']['subject'] === 'utf-8') { |
332 | 332 | $this->subject = imap_utf8($header->subject); |
333 | - }else{ |
|
333 | + } else{ |
|
334 | 334 | $this->subject = mb_decode_mimeheader($header->subject); |
335 | 335 | } |
336 | 336 | } |
@@ -788,7 +788,7 @@ discard block |
||
788 | 788 | return EncodingAliases::get($parameter->value); |
789 | 789 | } |
790 | 790 | } |
791 | - }elseif (is_string($structure) === true){ |
|
791 | + } elseif (is_string($structure) === true){ |
|
792 | 792 | return mb_detect_encoding($structure); |
793 | 793 | } |
794 | 794 | |
@@ -859,7 +859,9 @@ discard block |
||
859 | 859 | */ |
860 | 860 | public function delete($expunge = true) { |
861 | 861 | $status = imap_delete($this->client->getConnection(), $this->uid, FT_UID); |
862 | - if($expunge) $this->client->expunge(); |
|
862 | + if($expunge) { |
|
863 | + $this->client->expunge(); |
|
864 | + } |
|
863 | 865 | |
864 | 866 | return $status; |
865 | 867 | } |
@@ -873,7 +875,9 @@ discard block |
||
873 | 875 | */ |
874 | 876 | public function restore($expunge = true) { |
875 | 877 | $status = imap_undelete($this->client->getConnection(), $this->uid, FT_UID); |
876 | - if($expunge) $this->client->expunge(); |
|
878 | + if($expunge) { |
|
879 | + $this->client->expunge(); |
|
880 | + } |
|
877 | 881 | |
878 | 882 | return $status; |
879 | 883 | } |