Passed
Push — master ( c4fc9a...ad6b77 )
by Malte
02:37
created
src/Query/WhereQuery.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
         }
86 86
 
87 87
         if (strpos(strtolower($name), "where") === false) {
88
-            $method = 'where' . ucfirst($name);
89
-        } else {
88
+            $method = 'where'.ucfirst($name);
89
+        }else {
90 90
             $method = lcfirst($name);
91 91
         }
92 92
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
             return call_user_func_array([$that, $method], $arguments);
95 95
         }
96 96
 
97
-        throw new MethodNotFoundException("Method " . self::class . '::' . $method . '() is not supported');
97
+        throw new MethodNotFoundException("Method ".self::class.'::'.$method.'() is not supported');
98 98
     }
99 99
 
100 100
     /**
@@ -131,13 +131,13 @@  discard block
 block discarded – undo
131 131
                 }
132 132
                 return $this->where($key, $value);
133 133
             }
134
-        } else {
134
+        }else {
135 135
             $criteria = $this->validate_criteria($criteria);
136 136
             $value = $this->parse_value($value);
137 137
 
138 138
             if ($value === null || $value === '') {
139 139
                 $this->query->push([$criteria]);
140
-            } else {
140
+            }else {
141 141
                 $this->query->push([$criteria, $value]);
142 142
             }
143 143
         }
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
      * @return $this|mixed
492 492
      */
493 493
     public function unless($value, $callback, $default = null) {
494
-        if (! $value) {
494
+        if (!$value) {
495 495
             return $callback($this, $value) ?: $this;
496 496
         } elseif ($default) {
497 497
             return $default($this, $value) ?: $this;
Please login to merge, or discard this patch.
src/Connection/Protocols/LegacyProtocol.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -90,16 +90,16 @@  discard block
 block discarded – undo
90 90
             throw new AuthFailedException($message);
91 91
         }
92 92
 
93
-        if(!$this->stream) {
93
+        if (!$this->stream) {
94 94
             $errors = \imap_errors();
95 95
             $message = implode("; ", (is_array($errors) ? $errors : array()));
96 96
             throw new AuthFailedException($message);
97 97
         }
98 98
 
99 99
         $errors = \imap_errors();
100
-        if(is_array($errors)) {
100
+        if (is_array($errors)) {
101 101
             $status = $this->examineFolder();
102
-            if($status['exists'] !== 0) {
102
+            if ($status['exists'] !== 0) {
103 103
                 $message = implode("; ", (is_array($errors) ? $errors : array()));
104 104
                 throw new RuntimeException($message);
105 105
             }
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         if (!$this->cert_validation) {
131 131
             $address .= '/novalidate-cert';
132 132
         }
133
-        if (in_array($this->encryption,['tls', 'notls', 'ssl'])) {
133
+        if (in_array($this->encryption, ['tls', 'notls', 'ssl'])) {
134 134
             $address .= '/'.$this->encryption;
135 135
         } elseif ($this->encryption === "starttls") {
136 136
             $address .= '/tls';
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
      *
161 161
      * @return bool
162 162
      */
163
-    public function connected(){
163
+    public function connected() {
164 164
         return boolval($this->stream);
165 165
     }
166 166
 
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
      *
233 233
      * @return array
234 234
      */
235
-    public function headers($uids, $rfc = "RFC822", $uid = false){
235
+    public function headers($uids, $rfc = "RFC822", $uid = false) {
236 236
         $result = [];
237 237
         $uids = is_array($uids) ? $uids : [$uids];
238 238
         foreach ($uids as $id) {
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
      *
249 249
      * @return array
250 250
      */
251
-    public function flags($uids, $uid = false){
251
+    public function flags($uids, $uid = false) {
252 252
         $result = [];
253 253
         $uids = is_array($uids) ? $uids : [$uids];
254 254
         foreach ($uids as $id) {
@@ -256,8 +256,8 @@  discard block
 block discarded – undo
256 256
             $flags = [];
257 257
             if (is_array($raw_flags) && isset($raw_flags[0])) {
258 258
                 $raw_flags = (array) $raw_flags[0];
259
-                foreach($raw_flags as $flag => $value) {
260
-                    if ($value === 1 && in_array($flag, ["size", "uid", "msgno", "update"]) === false){
259
+                foreach ($raw_flags as $flag => $value) {
260
+                    if ($value === 1 && in_array($flag, ["size", "uid", "msgno", "update"]) === false) {
261 261
                         $flags[] = "\\".ucfirst($flag);
262 262
                     }
263 263
                 }
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
         if ($id === null) {
279 279
             $overview = $this->overview("1:*");
280 280
             $uids = [];
281
-            foreach($overview as $set){
281
+            foreach ($overview as $set) {
282 282
                 $uids[$set->msgno] = $set->uid;
283 283
             }
284 284
             return $uids;
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
      * @return array
305 305
      */
306 306
     public function overview($sequence, $uid = false) {
307
-        return \imap_fetch_overview($this->stream, $sequence,$uid ? IMAP::FT_UID : IMAP::NIL);
307
+        return \imap_fetch_overview($this->stream, $sequence, $uid ? IMAP::FT_UID : IMAP::NIL);
308 308
     }
309 309
 
310 310
     /**
@@ -319,12 +319,12 @@  discard block
 block discarded – undo
319 319
         $result = [];
320 320
 
321 321
         $items = \imap_getmailboxes($this->stream, $this->getAddress(), $reference.$folder);
322
-        if(is_array($items)){
322
+        if (is_array($items)) {
323 323
             foreach ($items as $item) {
324 324
                 $name = $this->decodeFolderName($item->name);
325 325
                 $result[$name] = ['delimiter' => $item->delimiter, 'flags' => []];
326 326
             }
327
-        }else{
327
+        }else {
328 328
             throw new RuntimeException(\imap_last_error());
329 329
         }
330 330
 
@@ -346,9 +346,9 @@  discard block
 block discarded – undo
346 346
     public function store(array $flags, $from, $to = null, $mode = null, $silent = true, $uid = false) {
347 347
         $flag = trim(is_array($flags) ? implode(" ", $flags) : $flags);
348 348
 
349
-        if ($mode == "+"){
349
+        if ($mode == "+") {
350 350
             $status = \imap_setflag_full($this->stream, $from, $flag, $uid ? IMAP::FT_UID : IMAP::NIL);
351
-        }else{
351
+        }else {
352 352
             $status = \imap_clearflag_full($this->stream, $from, $flag, $uid ? IMAP::FT_UID : IMAP::NIL);
353 353
         }
354 354
 
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
      */
371 371
     public function appendMessage($folder, $message, $flags = null, $date = null) {
372 372
         if ($date != null) {
373
-            if ($date instanceof \Carbon\Carbon){
373
+            if ($date instanceof \Carbon\Carbon) {
374 374
                 $date = $date->format('d-M-Y H:i:s O');
375 375
             }
376 376
             return \imap_append($this->stream, $folder, $message, $flags, $date);
@@ -507,14 +507,14 @@  discard block
 block discarded – undo
507 507
     /**
508 508
      * Enable the debug mode
509 509
      */
510
-    public function enableDebug(){
510
+    public function enableDebug() {
511 511
         $this->debug = true;
512 512
     }
513 513
 
514 514
     /**
515 515
      * Disable the debug mode
516 516
      */
517
-    public function disableDebug(){
517
+    public function disableDebug() {
518 518
         $this->debug = false;
519 519
     }
520 520
 
Please login to merge, or discard this patch.