Passed
Push — master ( 17da55...52e12c )
by Malte
02:19
created
src/Folder.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 
123 123
         $this->setDelimiter($delimiter);
124 124
         $this->path      = $folder_name;
125
-        $this->full_name  = $this->decodeName($folder_name);
125
+        $this->full_name = $this->decodeName($folder_name);
126 126
         $this->name      = $this->getSimpleName($this->delimiter, $this->full_name);
127 127
 
128 128
         $this->parseAttributes($attributes);
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
      * @throws Exceptions\ConnectionFailedException
137 137
      * @throws Exceptions\RuntimeException
138 138
      */
139
-    public function query($charset = 'UTF-8'){
139
+    public function query($charset = 'UTF-8') {
140 140
         $this->getClient()->checkConnection();
141 141
         $this->getClient()->openFolder($this->path);
142 142
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
      * @throws Exceptions\ConnectionFailedException
149 149
      * @throws Exceptions\RuntimeException
150 150
      */
151
-    public function search($charset = 'UTF-8'){
151
+    public function search($charset = 'UTF-8') {
152 152
         return $this->query($charset);
153 153
     }
154 154
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
      * @throws Exceptions\ConnectionFailedException
158 158
      * @throws Exceptions\RuntimeException
159 159
      */
160
-    public function messages($charset = 'UTF-8'){
160
+    public function messages($charset = 'UTF-8') {
161 161
         return $this->query($charset);
162 162
     }
163 163
 
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
     public function move($new_name, $expunge = true) {
233 233
         $this->client->checkConnection();
234 234
         $status = $this->client->getConnection()->renameFolder($this->full_name, $new_name);
235
-        if($expunge) $this->client->expunge();
235
+        if ($expunge) $this->client->expunge();
236 236
 
237 237
         $folder = $this->client->getFolder($new_name);
238 238
         $event = $this->getEvent("folder", "moved");
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
      * @throws Exceptions\MessageNotFoundException
252 252
      * @throws Exceptions\RuntimeException
253 253
      */
254
-    public function overview($sequence = null){
254
+    public function overview($sequence = null) {
255 255
         $this->client->openFolder($this->path);
256 256
         $sequence = $sequence === null ? "1:*" : $sequence;
257 257
         $uid = ClientManager::get('options.sequence', IMAP::ST_MSGN) == IMAP::ST_UID;
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
          */
277 277
 
278 278
         if ($internal_date != null) {
279
-            if ($internal_date instanceof Carbon){
279
+            if ($internal_date instanceof Carbon) {
280 280
                 $internal_date = $internal_date->format('d-M-Y H:i:s O');
281 281
             }
282 282
         }
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
      */
311 311
     public function delete($expunge = true) {
312 312
         $status = $this->client->getConnection()->deleteFolder($this->path);
313
-        if($expunge) $this->client->expunge();
313
+        if ($expunge) $this->client->expunge();
314 314
 
315 315
         $event = $this->getEvent("folder", "deleted");
316 316
         $event::dispatch($this);
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
             try {
372 372
                 $line = $connection->nextLine();
373 373
                 if (($pos = strpos($line, "EXISTS")) !== false) {
374
-                    $msgn = (int) substr($line, 2, $pos -2);
374
+                    $msgn = (int) substr($line, 2, $pos - 2);
375 375
                     $connection->done();
376 376
 
377 377
                     $this->client->openFolder($this->path, true);
@@ -384,8 +384,8 @@  discard block
 block discarded – undo
384 384
 
385 385
                     $connection->idle();
386 386
                 }
387
-            }catch (Exceptions\RuntimeException $e) {
388
-                if(strpos($e->getMessage(), "connection closed") === false) {
387
+            } catch (Exceptions\RuntimeException $e) {
388
+                if (strpos($e->getMessage(), "connection closed") === false) {
389 389
                     throw $e;
390 390
                 }
391 391
                 if ($auto_reconnect === true) {
@@ -434,8 +434,8 @@  discard block
 block discarded – undo
434 434
      * Set the delimiter
435 435
      * @param $delimiter
436 436
      */
437
-    public function setDelimiter($delimiter){
438
-        if(in_array($delimiter, [null, '', ' ', false]) === true) {
437
+    public function setDelimiter($delimiter) {
438
+        if (in_array($delimiter, [null, '', ' ', false]) === true) {
439 439
             $delimiter = ClientManager::get('options.delimiter', '/');
440 440
         }
441 441
 
Please login to merge, or discard this patch.
src/Query/Query.php 1 patch
Spacing   +19 added lines, -19 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,11 +158,11 @@  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 {
165
-                    $query .= $statement[0] . ' "' . $statement[1] . '"';
164
+                }else {
165
+                    $query .= $statement[0].' "'.$statement[1].'"';
166 166
                 }
167 167
             }
168 168
             $query .= ' ';
@@ -247,18 +247,18 @@  discard block
 block discarded – undo
247 247
      * @throws GetMessagesFailedException
248 248
      * @throws ReflectionException
249 249
      */
250
-    protected function make($uid, $msglist, $header, $content, $flags){
250
+    protected function make($uid, $msglist, $header, $content, $flags) {
251 251
         try {
252 252
             return Message::make($uid, $msglist, $this->getClient(), $header, $content, $flags, $this->getFetchOptions(), $this->sequence);
253
-        }catch (MessageNotFoundException $e) {
253
+        } catch (MessageNotFoundException $e) {
254 254
             $this->setError($uid, $e);
255
-        }catch (RuntimeException $e) {
255
+        } catch (RuntimeException $e) {
256 256
             $this->setError($uid, $e);
257
-        }catch (MessageFlagException $e) {
257
+        } catch (MessageFlagException $e) {
258 258
             $this->setError($uid, $e);
259
-        }catch (InvalidMessageDateException $e) {
259
+        } catch (InvalidMessageDateException $e) {
260 260
             $this->setError($uid, $e);
261
-        }catch (MessageContentFetchingException $e) {
261
+        } catch (MessageContentFetchingException $e) {
262 262
             $this->setError($uid, $e);
263 263
         }
264 264
 
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
      *
276 276
      * @return string
277 277
      */
278
-    protected function getMessageKey($message_key, $msglist, $message){
278
+    protected function getMessageKey($message_key, $msglist, $message) {
279 279
         switch ($message_key) {
280 280
             case 'number':
281 281
                 $key = $message->getMessageNo();
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
                 $key = $message->getMessageId();
291 291
                 break;
292 292
         }
293
-        return (string)$key;
293
+        return (string) $key;
294 294
     }
295 295
 
296 296
     /**
@@ -782,7 +782,7 @@  discard block
 block discarded – undo
782 782
      *
783 783
      * @return boolean
784 784
      */
785
-    public function hasErrors($uid = null){
785
+    public function hasErrors($uid = null) {
786 786
         if ($uid !== null) {
787 787
             return $this->hasError($uid);
788 788
         }
@@ -795,7 +795,7 @@  discard block
 block discarded – undo
795 795
      *
796 796
      * @return boolean
797 797
      */
798
-    public function hasError($uid){
798
+    public function hasError($uid) {
799 799
         return isset($this->errors[$uid]);
800 800
     }
801 801
 
@@ -804,7 +804,7 @@  discard block
 block discarded – undo
804 804
      *
805 805
      * @return array
806 806
      */
807
-    public function errors(){
807
+    public function errors() {
808 808
         return $this->getErrors();
809 809
     }
810 810
 
@@ -813,7 +813,7 @@  discard block
 block discarded – undo
813 813
      *
814 814
      * @return array
815 815
      */
816
-    public function getErrors(){
816
+    public function getErrors() {
817 817
         return $this->errors;
818 818
     }
819 819
 
@@ -823,7 +823,7 @@  discard block
 block discarded – undo
823 823
      *
824 824
      * @return Exception|null
825 825
      */
826
-    public function error($uid){
826
+    public function error($uid) {
827 827
         return $this->getError($uid);
828 828
     }
829 829
 
@@ -833,7 +833,7 @@  discard block
 block discarded – undo
833 833
      *
834 834
      * @return Exception|null
835 835
      */
836
-    public function getError($uid){
836
+    public function getError($uid) {
837 837
         if ($this->hasError($uid)) {
838 838
             return $this->errors[$uid];
839 839
         }
Please login to merge, or discard this patch.