Passed
Push — master ( 556262...0c61e0 )
by Malte
02:02
created
examples/folder_structure.blade.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,11 +31,14 @@
 block discarded – undo
31 31
                     <td><?php echo $folder->search()->unseen()->setFetchBody(false)->count(); ?></td>
32 32
                 </tr>
33 33
         <?php endforeach; ?>
34
-    <?php else: ?>
34
+    <?php else {
35
+    : ?>
35 36
         <tr>
36 37
             <td colspan="4">No folders found</td>
37 38
         </tr>
38
-    <?php endif; ?>
39
+    <?php endif;
40
+}
41
+?>
39 42
     </tbody>
40 43
 </table>
41 44
 
Please login to merge, or discard this patch.
src/Header.php 1 patch
Braces   +11 added lines, -7 removed lines patch added patch discarded remove patch
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
                 if ($prev_header !== null) {
169 169
                     $headers[$prev_header][] = $line;
170 170
                 }
171
-            }else{
171
+            } else{
172 172
                 if (($pos = strpos($line, ":")) > 0) {
173 173
                     $key = strtolower(substr($line, 0, $pos));
174 174
                     $value = trim(rtrim(strtolower(substr($line, $pos + 1))));
@@ -179,7 +179,9 @@  discard block
 block discarded – undo
179 179
         }
180 180
 
181 181
         foreach($headers as $key => $values) {
182
-            if (isset($imap_headers[$key])) continue;
182
+            if (isset($imap_headers[$key])) {
183
+                continue;
184
+            }
183 185
             $value = null;
184 186
             switch($key){
185 187
                 case 'from':
@@ -297,9 +299,9 @@  discard block
 block discarded – undo
297 299
                     return EncodingAliases::get($parameter->value, $this->fallback_encoding);
298 300
                 }
299 301
             }
300
-        }elseif (property_exists($structure, 'charset')) {
302
+        } elseif (property_exists($structure, 'charset')) {
301 303
             return EncodingAliases::get($structure->charset, $this->fallback_encoding);
302
-        }elseif (is_string($structure) === true){
304
+        } elseif (is_string($structure) === true){
303 305
             return mb_detect_encoding($structure);
304 306
         }
305 307
 
@@ -330,9 +332,9 @@  discard block
 block discarded – undo
330 332
                         }
331 333
                     }
332 334
                 }
333
-            }elseif($decoder === 'iconv') {
335
+            } elseif($decoder === 'iconv') {
334 336
                 $value = iconv_mime_decode($value);
335
-            }else{
337
+            } else{
336 338
                 $value = mb_decode_mimeheader($value);
337 339
             }
338 340
 
@@ -352,7 +354,9 @@  discard block
 block discarded – undo
352 354
      * Try to extract the priority from a given raw header string
353 355
      */
354 356
     private function findPriority() {
355
-        if(($priority = $this->get("x-priority")) === null) return;
357
+        if(($priority = $this->get("x-priority")) === null) {
358
+            return;
359
+        }
356 360
         switch($priority){
357 361
             case IMAP::MESSAGE_PRIORITY_HIGHEST;
358 362
                 $priority = IMAP::MESSAGE_PRIORITY_HIGHEST;
Please login to merge, or discard this patch.
src/Part.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@
 block discarded – undo
121 121
     protected function parse(){
122 122
         if ($this->header === null) {
123 123
             $body = $this->findHeaders();
124
-        }else{
124
+        } else{
125 125
             $body = $this->raw;
126 126
         }
127 127
 
Please login to merge, or discard this patch.
src/Client.php 1 patch
Braces   +15 added lines, -13 removed lines patch added patch discarded remove patch
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
         $value = $this->default_account_config[$key];
181 181
         if(isset($config[$key])) {
182 182
             $value = $config[$key];
183
-        }elseif(isset($default_config[$key])) {
183
+        } elseif(isset($default_config[$key])) {
184 184
             $value = $default_config[$key];
185 185
         }
186 186
         $this->$key = $value;
@@ -214,39 +214,39 @@  discard block
 block discarded – undo
214 214
             if(isset($config['masks']['message'])) {
215 215
                 if(class_exists($config['masks']['message'])) {
216 216
                     $this->default_message_mask = $config['masks']['message'];
217
-                }else{
217
+                } else{
218 218
                     throw new MaskNotFoundException("Unknown mask provided: ".$config['masks']['message']);
219 219
                 }
220
-            }else{
220
+            } else{
221 221
                 if(class_exists($default_config['message'])) {
222 222
                     $this->default_message_mask = $default_config['message'];
223
-                }else{
223
+                } else{
224 224
                     throw new MaskNotFoundException("Unknown mask provided: ".$default_config['message']);
225 225
                 }
226 226
             }
227 227
             if(isset($config['masks']['attachment'])) {
228 228
                 if(class_exists($config['masks']['attachment'])) {
229 229
                     $this->default_message_mask = $config['masks']['attachment'];
230
-                }else{
230
+                } else{
231 231
                     throw new MaskNotFoundException("Unknown mask provided: ".$config['masks']['attachment']);
232 232
                 }
233
-            }else{
233
+            } else{
234 234
                 if(class_exists($default_config['attachment'])) {
235 235
                     $this->default_message_mask = $default_config['attachment'];
236
-                }else{
236
+                } else{
237 237
                     throw new MaskNotFoundException("Unknown mask provided: ".$default_config['attachment']);
238 238
                 }
239 239
             }
240
-        }else{
240
+        } else{
241 241
             if(class_exists($default_config['message'])) {
242 242
                 $this->default_message_mask = $default_config['message'];
243
-            }else{
243
+            } else{
244 244
                 throw new MaskNotFoundException("Unknown mask provided: ".$default_config['message']);
245 245
             }
246 246
 
247 247
             if(class_exists($default_config['attachment'])) {
248 248
                 $this->default_message_mask = $default_config['attachment'];
249
-            }else{
249
+            } else{
250 250
                 throw new MaskNotFoundException("Unknown mask provided: ".$default_config['attachment']);
251 251
             }
252 252
         }
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
             $timeout = $this->connection !== false ? $this->connection->getConnectionTimeout() : null;
311 311
             $this->connection = new ImapProtocol($this->validate_cert);
312 312
             $this->connection->setConnectionTimeout($timeout);
313
-        }else{
313
+        } else{
314 314
             if (extension_loaded('imap') === false) {
315 315
                 throw new ConnectionFailedException("connection setup failed", 0, new ProtocolNotSupportedException($protocol." is an unsupported protocol"));
316 316
             }
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
             }
403 403
 
404 404
             return $folders;
405
-        }else{
405
+        } else{
406 406
             throw new FolderFetchingException("failed to fetch any folders");
407 407
         }
408 408
     }
@@ -436,7 +436,9 @@  discard block
 block discarded – undo
436 436
     public function createFolder($folder, $expunge = true) {
437 437
         $this->checkConnection();
438 438
         $status = $this->connection->createFolder($folder);
439
-        if($expunge) $this->expunge();
439
+        if($expunge) {
440
+            $this->expunge();
441
+        }
440 442
 
441 443
         $folder = $this->getFolder($folder);
442 444
         if($status && $folder) {
Please login to merge, or discard this patch.
src/Query/Query.php 1 patch
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -73,7 +73,9 @@  discard block
 block discarded – undo
73 73
     public function __construct(Client $client, $charset = 'UTF-8') {
74 74
         $this->setClient($client);
75 75
 
76
-        if(ClientManager::get('options.fetch') === IMAP::FT_PEEK) $this->leaveUnread();
76
+        if(ClientManager::get('options.fetch') === IMAP::FT_PEEK) {
77
+            $this->leaveUnread();
78
+        }
77 79
 
78 80
         $this->date_format = ClientManager::get('date_format', 'd M y');
79 81
 
@@ -111,7 +113,9 @@  discard block
 block discarded – undo
111 113
      * @throws MessageSearchValidationException
112 114
      */
113 115
     protected function parse_date($date) {
114
-        if($date instanceof \Carbon\Carbon) return $date;
116
+        if($date instanceof \Carbon\Carbon) {
117
+            return $date;
118
+        }
115 119
 
116 120
         try {
117 121
             $date = Carbon::parse($date);
@@ -286,7 +290,7 @@  discard block
 block discarded – undo
286 290
             } else {
287 291
                 if($statement[1] === null){
288 292
                     $query .= $statement[0];
289
-                }else{
293
+                } else{
290 294
                     $query .= $statement[0].' "'.$statement[1].'"';
291 295
                 }
292 296
             }
@@ -316,7 +320,9 @@  discard block
 block discarded – undo
316 320
      * @return $this
317 321
      */
318 322
     public function limit($limit, $page = 1) {
319
-        if($page >= 1) $this->page = $page;
323
+        if($page >= 1) {
324
+            $this->page = $page;
325
+        }
320 326
         $this->limit = $limit;
321 327
 
322 328
         return $this;
Please login to merge, or discard this patch.
src/Structure.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
     public function findContentType(){
89 89
         if(stripos($this->header->get("content-type"), 'multipart') === 0) {
90 90
             $this->type = IMAP::MESSAGE_TYPE_MULTIPART;
91
-        }else{
91
+        } else{
92 92
             $this->type = IMAP::MESSAGE_TYPE_TEXT;
93 93
         }
94 94
     }
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
                     foreach($match[1] as $matched){
123 123
                         $boundaries[] = $matched;
124 124
                     }
125
-                }else{
125
+                } else{
126 126
                     if(!empty($match[1])) {
127 127
                         $boundaries[] = $match[1];
128 128
                     }
Please login to merge, or discard this patch.
src/Attachment.php 1 patch
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
             }
130 130
 
131 131
             return null;
132
-        }elseif (strtolower(substr($method, 0, 3)) === 'set') {
132
+        } elseif (strtolower(substr($method, 0, 3)) === 'set') {
133 133
             $name = Str::snake(substr($method, 3));
134 134
 
135 135
             $this->attributes[$name] = array_pop($arguments);
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 
222 222
         if (($name = $this->part->name) !== null) {
223 223
             $this->setName($name);
224
-        }elseif (($filename = $this->part->filename) !== null) {
224
+        } elseif (($filename = $this->part->filename) !== null) {
225 225
             $this->setName($filename);
226 226
         } else {
227 227
             $this->setName("undefined");
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
         if ($name !== null) {
259 259
             if($decoder === 'utf-8' && extension_loaded('imap')) {
260 260
                 $this->name = \imap_utf8($name);
261
-            }else{
261
+            } else{
262 262
                 $this->name = mb_decode_mimeheader($name);
263 263
             }
264 264
         }
Please login to merge, or discard this patch.