Passed
Pull Request — master (#20)
by
unknown
04:47
created
src/ClientManager.php 1 patch
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -72,13 +72,13 @@  discard block
 block discarded – undo
72 72
             if($value === null) {
73 73
                 if(isset(self::$config[$part])) {
74 74
                     $value = self::$config[$part];
75
-                }else{
75
+                } else{
76 76
                     break;
77 77
                 }
78
-            }else{
78
+            } else{
79 79
                 if(isset($value[$part])) {
80 80
                     $value = $value[$part];
81
-                }else{
81
+                } else{
82 82
                     break;
83 83
                 }
84 84
             }
@@ -227,11 +227,15 @@  discard block
 block discarded – undo
227 227
         $arrays = func_get_args();
228 228
         $base = array_shift($arrays);
229 229
 
230
-        if(!is_array($base)) $base = empty($base) ? array() : array($base);
230
+        if(!is_array($base)) {
231
+            $base = empty($base) ? array() : array($base);
232
+        }
231 233
 
232 234
         foreach($arrays as $append) {
233 235
 
234
-            if(!is_array($append)) $append = array($append);
236
+            if(!is_array($append)) {
237
+                $append = array($append);
238
+            }
235 239
 
236 240
             foreach($append as $key => $value) {
237 241
 
@@ -243,7 +247,9 @@  discard block
 block discarded – undo
243 247
                 if(is_array($value) or is_array($base[$key])) {
244 248
                     $base[$key] = $this->array_merge_recursive_distinct($base[$key], $append[$key]);
245 249
                 } else if(is_numeric($key)) {
246
-                    if(!in_array($value, $base)) $base[] = $value;
250
+                    if(!in_array($value, $base)) {
251
+                        $base[] = $value;
252
+                    }
247 253
                 } else {
248 254
                     $base[$key] = $value;
249 255
                 }
Please login to merge, or discard this patch.
examples/message_table.blade.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,11 +35,14 @@
 block discarded – undo
35 35
                 <td><?php echo $message->getAttachments()->count() > 0 ? 'yes' : 'no'; ?></td>
36 36
             </tr>
37 37
         <?php endforeach; ?>
38
-    <?php else: ?>
38
+    <?php else {
39
+    : ?>
39 40
         <tr>
40 41
             <td colspan="4">No messages found</td>
41 42
         </tr>
42
-    <?php endif; ?>
43
+    <?php endif;
44
+}
45
+?>
43 46
     </tbody>
44 47
 </table>
45 48
 
Please login to merge, or discard this patch.
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.