Completed
Push — master ( a7526f...d27853 )
by Malte
09:59 queued 06:08
created
src/IMAP/Query/WhereQuery.php 1 patch
Braces   +9 added lines, -5 removed lines patch added patch discarded remove patch
@@ -77,17 +77,17 @@  discard block
 block discarded – undo
77 77
             foreach($criteria as $arguments){
78 78
                 if(count($arguments) == 1){
79 79
                     $this->where($arguments[0]);
80
-                }elseif(count($arguments) == 2){
80
+                } elseif(count($arguments) == 2){
81 81
                     $this->where($arguments[0], $arguments[1]);
82 82
                 }
83 83
             }
84
-        }else{
84
+        } else{
85 85
             $criteria = $this->validate_criteria($criteria);
86 86
             $value = $this->parse_value($value);
87 87
 
88 88
             if($value === null || $value === ''){
89 89
                 $this->query->push([$criteria]);
90
-            }else{
90
+            } else{
91 91
                 $this->query->push([$criteria, $value]);
92 92
             }
93 93
         }
@@ -102,7 +102,9 @@  discard block
 block discarded – undo
102 102
      */
103 103
     public function orWhere(\Closure $closure = null) {
104 104
         $this->query->push(['OR']);
105
-        if($closure !== null) $closure($this);
105
+        if($closure !== null) {
106
+            $closure($this);
107
+        }
106 108
 
107 109
         return $this;
108 110
     }
@@ -114,7 +116,9 @@  discard block
 block discarded – undo
114 116
      */
115 117
     public function andWhere(\Closure $closure = null) {
116 118
         $this->query->push(['AND']);
117
-        if($closure !== null) $closure($this);
119
+        if($closure !== null) {
120
+            $closure($this);
121
+        }
118 122
 
119 123
         return $this;
120 124
     }
Please login to merge, or discard this patch.
src/IMAP/Providers/LaravelServiceProvider.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -114,11 +114,15 @@  discard block
 block discarded – undo
114 114
         $arrays = func_get_args();
115 115
         $base = array_shift($arrays);
116 116
 
117
-        if(!is_array($base)) $base = empty($base) ? array() : array($base);
117
+        if(!is_array($base)) {
118
+            $base = empty($base) ? array() : array($base);
119
+        }
118 120
 
119 121
         foreach($arrays as $append) {
120 122
 
121
-            if(!is_array($append)) $append = array($append);
123
+            if(!is_array($append)) {
124
+                $append = array($append);
125
+            }
122 126
 
123 127
             foreach($append as $key => $value) {
124 128
 
@@ -130,7 +134,9 @@  discard block
 block discarded – undo
130 134
                 if(is_array($value) or is_array($base[$key])) {
131 135
                     $base[$key] = $this->array_merge_recursive_distinct($base[$key], $append[$key]);
132 136
                 } else if(is_numeric($key)) {
133
-                    if(!in_array($value, $base)) $base[] = $value;
137
+                    if(!in_array($value, $base)) {
138
+                        $base[] = $value;
139
+                    }
134 140
                 } else {
135 141
                     $base[$key] = $value;
136 142
                 }
Please login to merge, or discard this patch.
src/IMAP/Support/Masks/MessageMask.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,9 @@  discard block
 block discarded – undo
45 45
      */
46 46
     public function getCustomHTMLBody($callback = false) {
47 47
         $body = $this->getHtmlBody();
48
-        if($body === null) return null;
48
+        if($body === null) {
49
+            return null;
50
+        }
49 51
 
50 52
         if ($callback !== false) {
51 53
             $aAttachment = $this->parent->getAttachments();
@@ -53,7 +55,7 @@  discard block
 block discarded – undo
53 55
                 /** @var Attachment $oAttachment */
54 56
                 if(is_callable($callback)) {
55 57
                     $body = $callback($body, $oAttachment);
56
-                }elseif(is_string($callback)) {
58
+                } elseif(is_string($callback)) {
57 59
                     call_user_func($callback, [$body, $oAttachment]);
58 60
                 }
59 61
             });
Please login to merge, or discard this patch.
src/IMAP/Support/Masks/Mask.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
                 return $this->attributes[$name];
68 68
             }
69 69
 
70
-        }elseif (strtolower(substr($method, 0, 3)) === 'set') {
70
+        } elseif (strtolower(substr($method, 0, 3)) === 'set') {
71 71
             $name = Str::snake(substr($method, 3));
72 72
 
73 73
             if(isset($this->attributes[$name])) {
Please login to merge, or discard this patch.
src/IMAP/Query/Query.php 1 patch
Braces   +11 added lines, -5 removed lines patch added patch discarded remove patch
@@ -68,7 +68,9 @@  discard block
 block discarded – undo
68 68
     public function __construct(Client $client, $charset = 'UTF-8') {
69 69
         $this->setClient($client);
70 70
 
71
-        if(config('imap.options.fetch') === IMAP::FT_PEEK) $this->leaveUnread();
71
+        if(config('imap.options.fetch') === IMAP::FT_PEEK) {
72
+            $this->leaveUnread();
73
+        }
72 74
 
73 75
         $this->date_format = config('imap.date_format', 'd M y');
74 76
 
@@ -106,7 +108,9 @@  discard block
 block discarded – undo
106 108
      * @throws MessageSearchValidationException
107 109
      */
108 110
     protected function parse_date($date) {
109
-        if($date instanceof \Carbon\Carbon) return $date;
111
+        if($date instanceof \Carbon\Carbon) {
112
+            return $date;
113
+        }
110 114
 
111 115
         try {
112 116
             $date = Carbon::parse($date);
@@ -154,7 +158,7 @@  discard block
 block discarded – undo
154 158
          */
155 159
         if($this->getCharset() === null){
156 160
             $available_messages = \imap_search($this->getClient()->getConnection(), $this->getRawQuery(), IMAP::SE_UID);
157
-        }else{
161
+        } else{
158 162
             $available_messages = \imap_search($this->getClient()->getConnection(), $this->getRawQuery(), IMAP::SE_UID, $this->getCharset());
159 163
         }
160 164
 
@@ -253,7 +257,7 @@  discard block
 block discarded – undo
253 257
             } else {
254 258
                 if($statement[1] === null){
255 259
                     $query .= $statement[0];
256
-                }else{
260
+                } else{
257 261
                     $query .= $statement[0].' "'.$statement[1].'"';
258 262
                 }
259 263
             }
@@ -283,7 +287,9 @@  discard block
 block discarded – undo
283 287
      * @return $this
284 288
      */
285 289
     public function limit($limit, $page = 1) {
286
-        if($page >= 1) $this->page = $page;
290
+        if($page >= 1) {
291
+            $this->page = $page;
292
+        }
287 293
         $this->limit = $limit;
288 294
 
289 295
         return $this;
Please login to merge, or discard this patch.
src/IMAP/Client.php 1 patch
Braces   +19 added lines, -13 removed lines patch added patch discarded remove patch
@@ -179,39 +179,39 @@  discard block
 block discarded – undo
179 179
             if(isset($config['masks']['message'])) {
180 180
                 if(class_exists($config['masks']['message'])) {
181 181
                     $this->default_message_mask = $config['masks']['message'];
182
-                }else{
182
+                } else{
183 183
                     throw new MaskNotFoundException("Unknown mask provided: ".$config['masks']['message']);
184 184
                 }
185
-            }else{
185
+            } else{
186 186
                 if(class_exists($default_config['message'])) {
187 187
                     $this->default_message_mask = $default_config['message'];
188
-                }else{
188
+                } else{
189 189
                     throw new MaskNotFoundException("Unknown mask provided: ".$default_config['message']);
190 190
                 }
191 191
             }
192 192
             if(isset($config['masks']['attachment'])) {
193 193
                 if(class_exists($config['masks']['attachment'])) {
194 194
                     $this->default_message_mask = $config['masks']['attachment'];
195
-                }else{
195
+                } else{
196 196
                     throw new MaskNotFoundException("Unknown mask provided: ".$config['masks']['attachment']);
197 197
                 }
198
-            }else{
198
+            } else{
199 199
                 if(class_exists($default_config['attachment'])) {
200 200
                     $this->default_message_mask = $default_config['attachment'];
201
-                }else{
201
+                } else{
202 202
                     throw new MaskNotFoundException("Unknown mask provided: ".$default_config['attachment']);
203 203
                 }
204 204
             }
205
-        }else{
205
+        } else{
206 206
             if(class_exists($default_config['message'])) {
207 207
                 $this->default_message_mask = $default_config['message'];
208
-            }else{
208
+            } else{
209 209
                 throw new MaskNotFoundException("Unknown mask provided: ".$default_config['message']);
210 210
             }
211 211
 
212 212
             if(class_exists($default_config['attachment'])) {
213 213
                 $this->default_message_mask = $default_config['attachment'];
214
-            }else{
214
+            } else{
215 215
                 throw new MaskNotFoundException("Unknown mask provided: ".$default_config['attachment']);
216 216
             }
217 217
         }
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
             }
377 377
 
378 378
             return $folders;
379
-        }else{
379
+        } else{
380 380
             throw new MailboxFetchingException($this->getLastError());
381 381
         }
382 382
     }
@@ -414,7 +414,9 @@  discard block
 block discarded – undo
414 414
     public function createFolder($name, $expunge = true) {
415 415
         $this->checkConnection();
416 416
         $status = \imap_createmailbox($this->getConnection(), $this->getAddress() . \imap_utf7_encode($name));
417
-        if($expunge) $this->expunge();
417
+        if($expunge) {
418
+            $this->expunge();
419
+        }
418 420
 
419 421
         return $status;
420 422
     }
@@ -431,7 +433,9 @@  discard block
 block discarded – undo
431 433
     public function renameFolder($old_name, $new_name, $expunge = true) {
432 434
         $this->checkConnection();
433 435
         $status = \imap_renamemailbox($this->getConnection(), $this->getAddress() . \imap_utf7_encode($old_name), $this->getAddress() . \imap_utf7_encode($new_name));
434
-        if($expunge) $this->expunge();
436
+        if($expunge) {
437
+            $this->expunge();
438
+        }
435 439
 
436 440
         return $status;
437 441
     }
@@ -447,7 +451,9 @@  discard block
 block discarded – undo
447 451
     public function deleteFolder($name, $expunge = true) {
448 452
         $this->checkConnection();
449 453
         $status = \imap_deletemailbox($this->getConnection(), $this->getAddress() . \imap_utf7_encode($name));
450
-        if($expunge) $this->expunge();
454
+        if($expunge) {
455
+            $this->expunge();
456
+        }
451 457
 
452 458
         return $status;
453 459
     }
Please login to merge, or discard this patch.
src/IMAP/Message.php 1 patch
Braces   +17 added lines, -9 removed lines patch added patch discarded remove patch
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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,7 +399,7 @@  discard block
 block discarded – undo
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
-            }else{
402
+            } else{
403 403
                 $this->subject = mb_decode_mimeheader($header->subject);
404 404
             }
405 405
         }
@@ -917,7 +917,7 @@  discard block
 block discarded – undo
917 917
                     return EncodingAliases::get($parameter->value);
918 918
                 }
919 919
             }
920
-        }elseif (is_string($structure) === true){
920
+        } elseif (is_string($structure) === true){
921 921
             return mb_detect_encoding($structure);
922 922
         }
923 923
 
@@ -983,7 +983,9 @@  discard block
 block discarded – undo
983 983
      */
984 984
     public function moveToFolder($mailbox = 'INBOX', $expunge = false, $create_folder = true) {
985 985
 
986
-        if($create_folder) $this->client->createFolder($mailbox, true);
986
+        if($create_folder) {
987
+            $this->client->createFolder($mailbox, true);
988
+        }
987 989
 
988 990
         $target_folder = $this->client->getFolder($mailbox);
989 991
         $target_status = $target_folder->getStatus(IMAP::SA_ALL);
@@ -992,7 +994,9 @@  discard block
 block discarded – undo
992 994
         $status = \imap_mail_move($this->client->getConnection(), $this->uid, $mailbox, IMAP::CP_UID);
993 995
 
994 996
         if($status === true){
995
-            if($expunge) $this->client->expunge();
997
+            if($expunge) {
998
+                $this->client->expunge();
999
+            }
996 1000
             $this->client->openFolder($target_folder->path);
997 1001
 
998 1002
             return $target_folder->getMessage($target_status->uidnext, null, $this->fetch_options, $this->fetch_body, $this->fetch_attachment, $this->fetch_flags);
@@ -1012,7 +1016,9 @@  discard block
 block discarded – undo
1012 1016
         $this->client->openFolder($this->folder_path);
1013 1017
 
1014 1018
         $status = \imap_delete($this->client->getConnection(), $this->uid, IMAP::FT_UID);
1015
-        if($expunge) $this->client->expunge();
1019
+        if($expunge) {
1020
+            $this->client->expunge();
1021
+        }
1016 1022
 
1017 1023
         return $status;
1018 1024
     }
@@ -1028,7 +1034,9 @@  discard block
 block discarded – undo
1028 1034
         $this->client->openFolder($this->folder_path);
1029 1035
 
1030 1036
         $status = \imap_undelete($this->client->getConnection(), $this->uid, IMAP::FT_UID);
1031
-        if($expunge) $this->client->expunge();
1037
+        if($expunge) {
1038
+            $this->client->expunge();
1039
+        }
1032 1040
 
1033 1041
         return $status;
1034 1042
     }
Please login to merge, or discard this patch.
src/IMAP/Folder.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -375,7 +375,9 @@  discard block
 block discarded – undo
375 375
      */
376 376
     public function delete($expunge = true) {
377 377
         $status = \imap_deletemailbox($this->client->getConnection(), $this->path);
378
-        if($expunge) $this->client->expunge();
378
+        if($expunge) {
379
+            $this->client->expunge();
380
+        }
379 381
 
380 382
         return $status;
381 383
     }
@@ -392,7 +394,9 @@  discard block
 block discarded – undo
392 394
      */
393 395
     public function move($target_mailbox, $expunge = true) {
394 396
         $status = \imap_renamemailbox($this->client->getConnection(), $this->path, $target_mailbox);
395
-        if($expunge) $this->client->expunge();
397
+        if($expunge) {
398
+            $this->client->expunge();
399
+        }
396 400
 
397 401
         return $status;
398 402
     }
Please login to merge, or discard this patch.
src/IMAP/Attachment.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
             }
124 124
 
125 125
             return null;
126
-        }elseif (strtolower(substr($method, 0, 3)) === 'set') {
126
+        } elseif (strtolower(substr($method, 0, 3)) === 'set') {
127 127
             $name = Str::snake(substr($method, 3));
128 128
 
129 129
             $this->attributes[$name] = array_pop($arguments);
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
     public function setName($name) {
267 267
         if($this->config['decoder']['message']['subject'] === 'utf-8') {
268 268
             $this->name = \imap_utf8($name);
269
-        }else{
269
+        } else{
270 270
             $this->name = mb_decode_mimeheader($name);
271 271
         }
272 272
     }
Please login to merge, or discard this patch.