Passed
Push — master ( 4dc410...354c27 )
by Malte
03:19
created
src/Query/Query.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
         if (ClientManager::get('options.fetch_order') === 'desc') {
97 97
             $this->fetch_order = 'desc';
98
-        } else {
98
+        }else {
99 99
             $this->fetch_order = 'asc';
100 100
         }
101 101
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
                 break;
127 127
         }
128 128
 
129
-        return (string)$value;
129
+        return (string) $value;
130 130
     }
131 131
 
132 132
     /**
@@ -158,14 +158,14 @@  discard block
 block discarded – undo
158 158
         $this->query->each(function($statement) use (&$query) {
159 159
             if (count($statement) == 1) {
160 160
                 $query .= $statement[0];
161
-            } else {
161
+            }else {
162 162
                 if ($statement[1] === null) {
163 163
                     $query .= $statement[0];
164
-                } else {
164
+                }else {
165 165
                     if (is_numeric($statement[1])) {
166
-                        $query .= $statement[0] . ' ' . $statement[1];
167
-                    } else {
168
-                        $query .= $statement[0] . ' "' . $statement[1] . '"';
166
+                        $query .= $statement[0].' '.$statement[1];
167
+                    }else {
168
+                        $query .= $statement[0].' "'.$statement[1].'"';
169 169
                     }
170 170
                 }
171 171
             }
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
                 $key = $message->getMessageId();
300 300
                 break;
301 301
         }
302
-        return (string)$key;
302
+        return (string) $key;
303 303
     }
304 304
 
305 305
     /**
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
             $extensions = isset($raw_messages["extensions"][$uid]) ? $raw_messages["extensions"][$uid] : [];
348 348
 
349 349
             $message = $this->make($uid, $msglist, $header, $content, $flag);
350
-            foreach($extensions as $key => $extension) {
350
+            foreach ($extensions as $key => $extension) {
351 351
                 $message->getHeader()->set($key, $extension);
352 352
             }
353 353
             if ($message !== null) {
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
         $uids = $connection->getUid();
500 500
         $available_messages = new Collection();
501 501
         if (is_array($uids)) {
502
-            foreach ($uids as $id){
502
+            foreach ($uids as $id) {
503 503
                 if ($closure($id)) {
504 504
                     $available_messages->push($id);
505 505
                 }
Please login to merge, or discard this patch.
src/Header.php 2 patches
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
         }
93 93
 
94
-        throw new MethodNotFoundException("Method " . self::class . '::' . $method . '() is not supported');
94
+        throw new MethodNotFoundException("Method ".self::class.'::'.$method.'() is not supported');
95 95
     }
96 96
 
97 97
     /**
@@ -130,20 +130,20 @@  discard block
 block discarded – undo
130 130
         if (isset($this->attributes[$name]) && $strict === false) {
131 131
             if ($this->attributize) {
132 132
                 $this->attributes[$name]->add($value, true);
133
-            } else {
133
+            }else {
134 134
                 if (isset($this->attributes[$name])) {
135 135
                     if (is_array($this->attributes[$name]) == false) {
136 136
                         $this->attributes[$name] = [$this->attributes[$name], $value];
137
-                    } else {
137
+                    }else {
138 138
                         $this->attributes[$name][] = $value;
139 139
                     }
140
-                } else {
140
+                }else {
141 141
                     $this->attributes[$name] = $value;
142 142
                 }
143 143
             }
144 144
         } elseif ($this->attributize == false) {
145 145
             $this->attributes[$name] = $value;
146
-        } else {
146
+        }else {
147 147
             $this->attributes[$name] = new Attribute($name, $value);
148 148
         }
149 149
 
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
         $headers = [];
237 237
         $imap_headers = [];
238 238
         if (extension_loaded('imap') && $this->config["rfc822"]) {
239
-            $raw_imap_headers = (array)\imap_rfc822_parse_headers($this->raw);
239
+            $raw_imap_headers = (array) \imap_rfc822_parse_headers($this->raw);
240 240
             foreach ($raw_imap_headers as $key => $values) {
241 241
                 $key = str_replace("-", "_", $key);
242 242
                 $imap_headers[$key] = $values;
@@ -264,11 +264,11 @@  discard block
 block discarded – undo
264 264
                     }
265 265
                     if (is_array($headers[$prev_header])) {
266 266
                         $headers[$prev_header][] = $line;
267
-                    } else {
267
+                    }else {
268 268
                         $headers[$prev_header] .= $line;
269 269
                     }
270 270
                 }
271
-            } else {
271
+            }else {
272 272
                 if (($pos = strpos($line, ":")) > 0) {
273 273
                     $key = trim(rtrim(strtolower(substr($line, 0, $pos))));
274 274
                     $key = str_replace("-", "_", $key);
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
                     $value = trim(rtrim(substr($line, $pos + 1)));
277 277
                     if (isset($headers[$key])) {
278 278
                         $headers[$key][] = $value;
279
-                    } else {
279
+                    }else {
280 280
                         $headers[$key] = [$value];
281 281
                     }
282 282
                     $prev_header = $key;
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
                 case 'reply_to':
296 296
                 case 'sender':
297 297
                     $value = $this->decodeAddresses($values);
298
-                    $headers[$key . "address"] = implode(", ", $values);
298
+                    $headers[$key."address"] = implode(", ", $values);
299 299
                     break;
300 300
                 case 'subject':
301 301
                     $value = implode(" ", $values);
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
                             $value = implode(" ", $values);
315 315
                         } elseif ($available_values > 2) {
316 316
                             $value = array_values($values);
317
-                        } else {
317
+                        }else {
318 318
                             $value = "";
319 319
                         }
320 320
                     }
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
             $headers[$key] = $value;
324 324
         }
325 325
 
326
-        return (object)array_merge($headers, $imap_headers);
326
+        return (object) array_merge($headers, $imap_headers);
327 327
     }
328 328
 
329 329
     /**
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
             return \imap_mime_header_decode($text);
340 340
         }
341 341
         $charset = $this->getEncoding($text);
342
-        return [(object)[
342
+        return [(object) [
343 343
             "charset" => $charset,
344 344
             "text"    => $this->convertEncoding($text, $charset)
345 345
         ]];
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
         try {
394 394
             if (function_exists('iconv') && $from != 'UTF-7' && $to != 'UTF-7') {
395 395
                 return iconv($from, $to, $str);
396
-            } else {
396
+            }else {
397 397
                 if (!$from) {
398 398
                     return mb_convert_encoding($str, $to);
399 399
                 }
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
             if (strstr($from, '-')) {
404 404
                 $from = str_replace('-', '', $from);
405 405
                 return $this->convertEncoding($str, $from, $to);
406
-            } else {
406
+            }else {
407 407
                 return $str;
408 408
             }
409 409
         }
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
      */
508 508
     private function findPriority() {
509 509
         if (($priority = $this->get("x_priority")) === null) return;
510
-        switch ((int)"$priority") {
510
+        switch ((int) "$priority") {
511 511
             case IMAP::MESSAGE_PRIORITY_HIGHEST;
512 512
                 $priority = IMAP::MESSAGE_PRIORITY_HIGHEST;
513 513
                 break;
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
                     if (isset($parsed_address['address'])) {
547 547
                         $mail_address = explode('@', $parsed_address['address']);
548 548
                         if (count($mail_address) == 2) {
549
-                            $addresses[] = (object)[
549
+                            $addresses[] = (object) [
550 550
                                 "personal" => isset($parsed_address['display']) ? $parsed_address['display'] : '',
551 551
                                 "mailbox"  => $mail_address[0],
552 552
                                 "host"     => $mail_address[1],
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
                     $name = trim(rtrim($matches["name"]));
575 575
                     $email = trim(rtrim($matches["email"]));
576 576
                     list($mailbox, $host) = array_pad(explode("@", $email), 2, null);
577
-                    $addresses[] = (object)[
577
+                    $addresses[] = (object) [
578 578
                         "personal" => $name,
579 579
                         "mailbox"  => $mailbox,
580 580
                         "host"     => $host,
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
         }
613 613
 
614 614
         foreach ($list as $item) {
615
-            $address = (object)$item;
615
+            $address = (object) $item;
616 616
 
617 617
             if (!property_exists($address, 'mailbox')) {
618 618
                 $address->mailbox = false;
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
             }
623 623
             if (!property_exists($address, 'personal')) {
624 624
                 $address->personal = false;
625
-            } else {
625
+            }else {
626 626
                 $personalParts = $this->mime_header_decode($address->personal);
627 627
 
628 628
                 if (is_array($personalParts)) {
@@ -637,8 +637,8 @@  discard block
 block discarded – undo
637 637
                 }
638 638
             }
639 639
 
640
-            $address->mail = ($address->mailbox && $address->host) ? $address->mailbox . '@' . $address->host : false;
641
-            $address->full = ($address->personal) ? $address->personal . ' <' . $address->mail . '>' : $address->mail;
640
+            $address->mail = ($address->mailbox && $address->host) ? $address->mailbox.'@'.$address->host : false;
641
+            $address->full = ($address->personal) ? $address->personal.' <'.$address->mail.'>' : $address->mail;
642 642
 
643 643
             $addresses[] = new Address($address);
644 644
         }
@@ -653,8 +653,8 @@  discard block
 block discarded – undo
653 653
         foreach ($this->attributes as $key => $value) {
654 654
             if (is_array($value)) {
655 655
                 $value = implode(", ", $value);
656
-            } else {
657
-                $value = (string)$value;
656
+            }else {
657
+                $value = (string) $value;
658 658
             }
659 659
             // Only parse strings and don't parse any attributes like the user-agent
660 660
             if (in_array($key, ["user_agent"]) === false) {
@@ -735,8 +735,8 @@  discard block
 block discarded – undo
735 735
                     $parsed_date = Carbon::parse($date);
736 736
                 } catch (\Exception $_e) {
737 737
                     if (!isset($this->config["fallback_date"])) {
738
-                        throw new InvalidMessageDateException("Invalid message date. ID:" . $this->get("message_id") . " Date:" . $header->date . "/" . $date, 1100, $e);
739
-                    } else {
738
+                        throw new InvalidMessageDateException("Invalid message date. ID:".$this->get("message_id")." Date:".$header->date."/".$date, 1100, $e);
739
+                    }else {
740 740
                         $parsed_date = Carbon::parse($this->config["fallback_date"]);
741 741
                     }
742 742
                 }
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -285,7 +285,9 @@  discard block
 block discarded – undo
285 285
         }
286 286
 
287 287
         foreach ($headers as $key => $values) {
288
-            if (isset($imap_headers[$key])) continue;
288
+            if (isset($imap_headers[$key])) {
289
+                continue;
290
+            }
289 291
             $value = null;
290 292
             switch ($key) {
291 293
                 case 'from':
@@ -506,7 +508,9 @@  discard block
 block discarded – undo
506 508
      * Try to extract the priority from a given raw header string
507 509
      */
508 510
     private function findPriority() {
509
-        if (($priority = $this->get("x_priority")) === null) return;
511
+        if (($priority = $this->get("x_priority")) === null) {
512
+            return;
513
+        }
510 514
         switch ((int)"$priority") {
511 515
             case IMAP::MESSAGE_PRIORITY_HIGHEST;
512 516
                 $priority = IMAP::MESSAGE_PRIORITY_HIGHEST;
Please login to merge, or discard this patch.