@@ -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 | |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | * @throws RuntimeException |
| 314 | 314 | * @throws \Webklex\PHPIMAP\Exceptions\EventNotFoundException |
| 315 | 315 | */ |
| 316 | - public function getMessageByUid($uid){ |
|
| 316 | + public function getMessageByUid($uid) { |
|
| 317 | 317 | return $this->getMessage($uid, null, IMAP::ST_UID); |
| 318 | 318 | } |
| 319 | 319 | |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | * @return LengthAwarePaginator |
| 327 | 327 | * @throws GetMessagesFailedException |
| 328 | 328 | */ |
| 329 | - public function paginate($per_page = 5, $page = null, $page_name = 'imap_page'){ |
|
| 329 | + public function paginate($per_page = 5, $page = null, $page_name = 'imap_page') { |
|
| 330 | 330 | if ( |
| 331 | 331 | $page === null |
| 332 | 332 | && isset($_GET[$page_name]) |
@@ -352,10 +352,10 @@ discard block |
||
| 352 | 352 | $this->query->each(function($statement) use(&$query) { |
| 353 | 353 | if (count($statement) == 1) { |
| 354 | 354 | $query .= $statement[0]; |
| 355 | - } else { |
|
| 356 | - if($statement[1] === null){ |
|
| 355 | + }else { |
|
| 356 | + if ($statement[1] === null) { |
|
| 357 | 357 | $query .= $statement[0]; |
| 358 | - }else{ |
|
| 358 | + }else { |
|
| 359 | 359 | $query .= $statement[0].' "'.$statement[1].'"'; |
| 360 | 360 | } |
| 361 | 361 | } |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | * @return $this |
| 386 | 386 | */ |
| 387 | 387 | public function limit($limit, $page = 1) { |
| 388 | - if($page >= 1) $this->page = $page; |
|
| 388 | + if ($page >= 1) $this->page = $page; |
|
| 389 | 389 | $this->limit = $limit; |
| 390 | 390 | |
| 391 | 391 | return $this; |