Completed
Push — master ( bbfee2...cd9168 )
by Malte
02:04
created
src/Message.php 1 patch
Braces   +21 added lines, -13 removed lines patch added patch discarded remove patch
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
         if ($this->sequence === IMAP::ST_UID) {
228 228
             $this->uid = $uid;
229 229
             $this->msgn = $this->client->getConnection()->getMessageNumber($this->uid);
230
-        }else{
230
+        } else{
231 231
             $this->msgn = $uid;
232 232
             $this->uid = $this->client->getConnection()->getUid($this->msgn);
233 233
         }
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
         if ($instance->getSequence() === IMAP::ST_UID) {
295 295
             $instance->setUid($uid);
296 296
             $instance->setMsglist($msglist);
297
-        }else{
297
+        } else{
298 298
             $instance->setMsgn($uid, $msglist);
299 299
         }
300 300
 
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
         if(strtolower(substr($method, 0, 3)) === 'get') {
319 319
             $name = Str::snake(substr($method, 3));
320 320
             return $this->get($name);
321
-        }elseif (strtolower(substr($method, 0, 3)) === 'set') {
321
+        } elseif (strtolower(substr($method, 0, 3)) === 'set') {
322 322
             $name = Str::snake(substr($method, 3));
323 323
 
324 324
             if(in_array($name, array_keys($this->attributes))) {
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
             if ($this->getFlags()->get("seen") == null) {
522 522
                 $this->unsetFlag("Seen");
523 523
             }
524
-        }elseif ($this->getFlags()->get("seen") != null) {
524
+        } elseif ($this->getFlags()->get("seen") != null) {
525 525
             $this->setFlag("Seen");
526 526
         }
527 527
     }
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
     private function fetchPart(Part $part) {
564 564
         if ($part->isAttachment()) {
565 565
             $this->fetchAttachment($part);
566
-        }else{
566
+        } else{
567 567
             $encoding = $this->getEncoding($part);
568 568
 
569 569
             $content = $this->decodeString($part->content, $part->encoding);
@@ -755,9 +755,9 @@  discard block
 block discarded – undo
755 755
                     return EncodingAliases::get($parameter->value);
756 756
                 }
757 757
             }
758
-        }elseif (property_exists($structure, 'charset')){
758
+        } elseif (property_exists($structure, 'charset')){
759 759
             return EncodingAliases::get($structure->charset);
760
-        }elseif (is_string($structure) === true){
760
+        } elseif (is_string($structure) === true){
761 761
             return mb_detect_encoding($structure);
762 762
         }
763 763
 
@@ -858,13 +858,15 @@  discard block
 block discarded – undo
858 858
 
859 859
             $this->client->openFolder($this->folder_path);
860 860
             if ($this->client->getConnection()->copyMessage($folder->path, $this->getSequenceId(), null, $this->sequence === IMAP::ST_UID) == true) {
861
-                if($expunge) $this->client->expunge();
861
+                if($expunge) {
862
+                    $this->client->expunge();
863
+                }
862 864
 
863 865
                 $this->client->openFolder($folder->path);
864 866
 
865 867
                 if ($this->sequence === IMAP::ST_UID) {
866 868
                     $sequence_id = $next_uid;
867
-                }else{
869
+                } else{
868 870
                     $sequence_id = $this->client->getConnection()->getMessageNumber($next_uid);
869 871
                 }
870 872
 
@@ -905,13 +907,15 @@  discard block
 block discarded – undo
905 907
 
906 908
             $this->client->openFolder($this->folder_path);
907 909
             if ($this->client->getConnection()->moveMessage($folder->path, $this->getSequenceId(), null, $this->sequence === IMAP::ST_UID) == true) {
908
-                if($expunge) $this->client->expunge();
910
+                if($expunge) {
911
+                    $this->client->expunge();
912
+                }
909 913
 
910 914
                 $this->client->openFolder($folder->path);
911 915
 
912 916
                 if ($this->sequence === IMAP::ST_UID) {
913 917
                     $sequence_id = $next_uid;
914
-                }else{
918
+                } else{
915 919
                     $sequence_id = $this->client->getConnection()->getMessageNumber($next_uid);
916 920
                 }
917 921
 
@@ -937,7 +941,9 @@  discard block
 block discarded – undo
937 941
      */
938 942
     public function delete($expunge = true) {
939 943
         $status = $this->setFlag("Deleted");
940
-        if($expunge) $this->client->expunge();
944
+        if($expunge) {
945
+            $this->client->expunge();
946
+        }
941 947
 
942 948
         $event = $this->getEvent("message", "deleted");
943 949
         $event::dispatch($this);
@@ -956,7 +962,9 @@  discard block
 block discarded – undo
956 962
      */
957 963
     public function restore($expunge = true) {
958 964
         $status = $this->unsetFlag("Deleted");
959
-        if($expunge) $this->client->expunge();
965
+        if($expunge) {
966
+            $this->client->expunge();
967
+        }
960 968
 
961 969
         $event = $this->getEvent("message", "restored");
962 970
         $event::dispatch($this);
Please login to merge, or discard this patch.