@@ -95,7 +95,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -91,7 +91,9 @@ discard block |
||
| 91 | 91 | $this->setClient($client); |
| 92 | 92 | |
| 93 | 93 | $this->sequence = ClientManager::get('options.sequence', IMAP::ST_MSGN); |
| 94 | - if (ClientManager::get('options.fetch') === IMAP::FT_PEEK) $this->leaveUnread(); |
|
| 94 | + if (ClientManager::get('options.fetch') === IMAP::FT_PEEK) { |
|
| 95 | + $this->leaveUnread(); |
|
| 96 | + } |
|
| 95 | 97 | |
| 96 | 98 | if (ClientManager::get('options.fetch_order') === 'desc') { |
| 97 | 99 | $this->fetch_order = 'desc'; |
@@ -137,7 +139,9 @@ discard block |
||
| 137 | 139 | * @throws MessageSearchValidationException |
| 138 | 140 | */ |
| 139 | 141 | protected function parse_date($date) { |
| 140 | - if ($date instanceof Carbon) return $date; |
|
| 142 | + if ($date instanceof Carbon) { |
|
| 143 | + return $date; |
|
| 144 | + } |
|
| 141 | 145 | |
| 142 | 146 | try { |
| 143 | 147 | $date = Carbon::parse($date); |
@@ -250,15 +254,15 @@ discard block |
||
| 250 | 254 | protected function make($uid, $msglist, $header, $content, $flags){ |
| 251 | 255 | try { |
| 252 | 256 | return Message::make($uid, $msglist, $this->getClient(), $header, $content, $flags, $this->getFetchOptions(), $this->sequence); |
| 253 | - }catch (MessageNotFoundException $e) { |
|
| 257 | + } catch (MessageNotFoundException $e) { |
|
| 254 | 258 | $this->setError($uid, $e); |
| 255 | - }catch (RuntimeException $e) { |
|
| 259 | + } catch (RuntimeException $e) { |
|
| 256 | 260 | $this->setError($uid, $e); |
| 257 | - }catch (MessageFlagException $e) { |
|
| 261 | + } catch (MessageFlagException $e) { |
|
| 258 | 262 | $this->setError($uid, $e); |
| 259 | - }catch (InvalidMessageDateException $e) { |
|
| 263 | + } catch (InvalidMessageDateException $e) { |
|
| 260 | 264 | $this->setError($uid, $e); |
| 261 | - }catch (MessageContentFetchingException $e) { |
|
| 265 | + } catch (MessageContentFetchingException $e) { |
|
| 262 | 266 | $this->setError($uid, $e); |
| 263 | 267 | } |
| 264 | 268 | |
@@ -511,7 +515,9 @@ discard block |
||
| 511 | 515 | * @return $this |
| 512 | 516 | */ |
| 513 | 517 | public function limit($limit, $page = 1) { |
| 514 | - if ($page >= 1) $this->page = $page; |
|
| 518 | + if ($page >= 1) { |
|
| 519 | + $this->page = $page; |
|
| 520 | + } |
|
| 515 | 521 | $this->limit = $limit; |
| 516 | 522 | |
| 517 | 523 | return $this; |