Passed
Push — master ( d2cbbe...e02ad2 )
by Malte
03:37
created
src/IMAP/Query/Query.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     public function __construct(Client $client, $charset = 'UTF-8') {
66 66
         $this->setClient($client);
67 67
 
68
-        if(config('imap.options.fetch') === IMAP::FT_PEEK) $this->leaveUnread();
68
+        if (config('imap.options.fetch') === IMAP::FT_PEEK) $this->leaveUnread();
69 69
 
70 70
         $this->charset = $charset;
71 71
         $this->query = collect();
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     /**
76 76
      * Instance boot method for additional functionality
77 77
      */
78
-    protected function boot(){}
78
+    protected function boot() {}
79 79
 
80 80
     /**
81 81
      * Parse a given value
@@ -83,8 +83,8 @@  discard block
 block discarded – undo
83 83
      *
84 84
      * @return string
85 85
      */
86
-    protected function parse_value($value){
87
-        switch(true){
86
+    protected function parse_value($value) {
87
+        switch (true) {
88 88
             case $value instanceof \Carbon\Carbon:
89 89
                 $value = $value->format('d M y');
90 90
                 break;
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      * @throws MessageSearchValidationException
102 102
      */
103 103
     protected function parse_date($date) {
104
-        if($date instanceof \Carbon\Carbon) return $date;
104
+        if ($date instanceof \Carbon\Carbon) return $date;
105 105
 
106 106
         try {
107 107
             $date = Carbon::parse($date);
@@ -150,9 +150,9 @@  discard block
 block discarded – undo
150 150
              * Don't set the charset if it isn't used - prevent strange outlook mail server errors
151 151
              * @see https://github.com/Webklex/laravel-imap/issues/100
152 152
              */
153
-            if($this->getCharset() === null){
153
+            if ($this->getCharset() === null) {
154 154
                 $available_messages = imap_search($this->getClient()->getConnection(), $this->getRawQuery(), IMAP::SE_UID);
155
-            }else{
155
+            } else {
156 156
                 $available_messages = imap_search($this->getClient()->getConnection(), $this->getRawQuery(), IMAP::SE_UID, $this->getCharset());
157 157
             }
158 158
 
@@ -161,15 +161,15 @@  discard block
 block discarded – undo
161 161
                 $available_messages = collect($available_messages);
162 162
                 $options = config('imap.options');
163 163
 
164
-                if(strtolower($options['fetch_order']) === 'desc'){
164
+                if (strtolower($options['fetch_order']) === 'desc') {
165 165
                     $available_messages = $available_messages->reverse();
166 166
                 }
167 167
 
168
-                $query =& $this;
168
+                $query = & $this;
169 169
 
170 170
                 $available_messages->forPage($this->page, $this->limit)->each(function($msgno, $msglist) use(&$messages, $options, $query) {
171 171
                     $oMessage = new Message($msgno, $msglist, $query->getClient(), $query->getFetchOptions(), $query->getFetchBody(), $query->getFetchAttachment(), $query->getFetchFlags());
172
-                    switch ($options['message_key']){
172
+                    switch ($options['message_key']) {
173 173
                         case 'number':
174 174
                             $message_key = $oMessage->getMessageNo();
175 175
                             break;
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
      * @return \Illuminate\Pagination\LengthAwarePaginator
201 201
      * @throws GetMessagesFailedException
202 202
      */
203
-    public function paginate($per_page = 5, $page = null, $page_name = 'imap_page'){
203
+    public function paginate($per_page = 5, $page = null, $page_name = 'imap_page') {
204 204
         $this->page = $page > $this->page ? $page : $this->page;
205 205
         $this->limit = $per_page;
206 206
 
@@ -218,9 +218,9 @@  discard block
 block discarded – undo
218 218
             if (count($statement) == 1) {
219 219
                 $query .= $statement[0];
220 220
             } else {
221
-                if($statement[1] === null){
221
+                if ($statement[1] === null) {
222 222
                     $query .= $statement[0];
223
-                }else{
223
+                } else {
224 224
                     $query .= $statement[0].' "'.$statement[1].'"';
225 225
                 }
226 226
             }
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
      * @return $this
251 251
      */
252 252
     public function limit($limit, $page = 1) {
253
-        if($page >= 1) $this->page = $page;
253
+        if ($page >= 1) $this->page = $page;
254 254
         $this->limit = $limit;
255 255
 
256 256
         return $this;
Please login to merge, or discard this patch.