@@ -80,11 +80,11 @@ discard block |
||
80 | 80 | $this->setClient($client); |
81 | 81 | |
82 | 82 | $this->sequence = ClientManager::get('options.sequence', IMAP::ST_MSGN); |
83 | - if(ClientManager::get('options.fetch') === IMAP::FT_PEEK) $this->leaveUnread(); |
|
83 | + if (ClientManager::get('options.fetch') === IMAP::FT_PEEK) $this->leaveUnread(); |
|
84 | 84 | |
85 | 85 | if (ClientManager::get('options.fetch_order') === 'desc') { |
86 | 86 | $this->fetch_order = 'desc'; |
87 | - } else { |
|
87 | + }else { |
|
88 | 88 | $this->fetch_order = 'asc'; |
89 | 89 | } |
90 | 90 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | /** |
99 | 99 | * Instance boot method for additional functionality |
100 | 100 | */ |
101 | - protected function boot(){} |
|
101 | + protected function boot() {} |
|
102 | 102 | |
103 | 103 | /** |
104 | 104 | * Parse a given value |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | * |
107 | 107 | * @return string |
108 | 108 | */ |
109 | - protected function parse_value($value){ |
|
110 | - switch(true){ |
|
109 | + protected function parse_value($value) { |
|
110 | + switch (true) { |
|
111 | 111 | case $value instanceof \Carbon\Carbon: |
112 | 112 | $value = $value->format($this->date_format); |
113 | 113 | break; |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | * @throws MessageSearchValidationException |
125 | 125 | */ |
126 | 126 | protected function parse_date($date) { |
127 | - if($date instanceof \Carbon\Carbon) return $date; |
|
127 | + if ($date instanceof \Carbon\Carbon) return $date; |
|
128 | 128 | |
129 | 129 | try { |
130 | 130 | $date = Carbon::parse($date); |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | * @return Collection |
176 | 176 | * @throws GetMessagesFailedException |
177 | 177 | */ |
178 | - protected function search(){ |
|
178 | + protected function search() { |
|
179 | 179 | $this->generate_query(); |
180 | 180 | |
181 | 181 | try { |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | $raw_flag = isset($raw_flags[$uid]) ? $raw_flags[$uid] : []; |
241 | 241 | |
242 | 242 | $message = Message::make($uid, $msglist, $this->getClient(), $raw_header, $raw_content, $raw_flag, $this->getFetchOptions(), $this->sequence); |
243 | - switch ($message_key){ |
|
243 | + switch ($message_key) { |
|
244 | 244 | case 'number': |
245 | 245 | $message_key = $message->getMessageNo(); |
246 | 246 | break; |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | |
263 | 263 | return $messages; |
264 | 264 | } catch (\Exception $e) { |
265 | - throw new GetMessagesFailedException($e->getMessage(),0, $e); |
|
265 | + throw new GetMessagesFailedException($e->getMessage(), 0, $e); |
|
266 | 266 | } |
267 | 267 | } |
268 | 268 | |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | * @throws MessageHeaderFetchingException |
281 | 281 | * @throws \Webklex\PHPIMAP\Exceptions\EventNotFoundException |
282 | 282 | */ |
283 | - public function getMessage($uid, $msglist = null, $sequence = null){ |
|
283 | + public function getMessage($uid, $msglist = null, $sequence = null) { |
|
284 | 284 | return new Message($uid, $msglist, $this->getClient(), $this->getFetchOptions(), $this->getFetchBody(), $this->getFetchFlags(), $sequence ? $sequence : $this->sequence); |
285 | 285 | } |
286 | 286 | |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | * @throws RuntimeException |
298 | 298 | * @throws \Webklex\PHPIMAP\Exceptions\EventNotFoundException |
299 | 299 | */ |
300 | - public function getMessageByMsgn($msgn, $msglist = null){ |
|
300 | + public function getMessageByMsgn($msgn, $msglist = null) { |
|
301 | 301 | return $this->getMessage($msgn, $msglist, IMAP::ST_MSGN); |
302 | 302 | } |
303 | 303 | * Paginate the current query |
@@ -307,8 +307,8 @@ discard block |
||
307 | 307 | * |
308 | 308 | * @return LengthAwarePaginator |
309 | 309 | * @throws GetMessagesFailedException |
310 | - */ |
|
311 | - public function paginate($per_page = 5, $page = null, $page_name = 'imap_page'){ |
|
310 | + * / |
|
311 | + public function paginate($per_page = 5, $page = null, $page_name = 'imap_page') { |
|
312 | 312 | if ( |
313 | 313 | $page === null |
314 | 314 | && isset($_GET[$page_name]) |
@@ -334,10 +334,10 @@ discard block |
||
334 | 334 | $this->query->each(function($statement) use(&$query) { |
335 | 335 | if (count($statement) == 1) { |
336 | 336 | $query .= $statement[0]; |
337 | - } else { |
|
338 | - if($statement[1] === null){ |
|
337 | + }else { |
|
338 | + if ($statement[1] === null) { |
|
339 | 339 | $query .= $statement[0]; |
340 | - }else{ |
|
340 | + }else { |
|
341 | 341 | $query .= $statement[0].' "'.$statement[1].'"'; |
342 | 342 | } |
343 | 343 | } |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | * @return $this |
368 | 368 | */ |
369 | 369 | public function limit($limit, $page = 1) { |
370 | - if($page >= 1) $this->page = $page; |
|
370 | + if ($page >= 1) $this->page = $page; |
|
371 | 371 | $this->limit = $limit; |
372 | 372 | |
373 | 373 | return $this; |