@@ -77,17 +77,17 @@ discard block |
||
77 | 77 | foreach($criteria as $arguments){ |
78 | 78 | if(count($arguments) == 1){ |
79 | 79 | $this->where($arguments[0]); |
80 | - }elseif(count($arguments) == 2){ |
|
80 | + } elseif(count($arguments) == 2){ |
|
81 | 81 | $this->where($arguments[0], $arguments[1]); |
82 | 82 | } |
83 | 83 | } |
84 | - }else{ |
|
84 | + } else{ |
|
85 | 85 | $criteria = $this->validate_criteria($criteria); |
86 | 86 | $value = $this->parse_value($value); |
87 | 87 | |
88 | 88 | if($value === null || $value === ''){ |
89 | 89 | $this->query->push([$criteria]); |
90 | - }else{ |
|
90 | + } else{ |
|
91 | 91 | $this->query->push([$criteria, $value]); |
92 | 92 | } |
93 | 93 | } |
@@ -102,7 +102,9 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function orWhere(\Closure $closure = null) { |
104 | 104 | $this->query->push(['OR']); |
105 | - if($closure !== null) $closure($this); |
|
105 | + if($closure !== null) { |
|
106 | + $closure($this); |
|
107 | + } |
|
106 | 108 | |
107 | 109 | return $this; |
108 | 110 | } |
@@ -114,7 +116,9 @@ discard block |
||
114 | 116 | */ |
115 | 117 | public function andWhere(\Closure $closure = null) { |
116 | 118 | $this->query->push(['AND']); |
117 | - if($closure !== null) $closure($this); |
|
119 | + if($closure !== null) { |
|
120 | + $closure($this); |
|
121 | + } |
|
118 | 122 | |
119 | 123 | return $this; |
120 | 124 | } |
@@ -64,7 +64,9 @@ discard block |
||
64 | 64 | public function __construct(Client $client, $charset = 'UTF-8') { |
65 | 65 | $this->setClient($client); |
66 | 66 | |
67 | - if(config('imap.options.fetch') === FT_PEEK) $this->leaveUnread(); |
|
67 | + if(config('imap.options.fetch') === FT_PEEK) { |
|
68 | + $this->leaveUnread(); |
|
69 | + } |
|
68 | 70 | |
69 | 71 | $this->charset = $charset; |
70 | 72 | $this->query = collect(); |
@@ -100,7 +102,9 @@ discard block |
||
100 | 102 | * @throws MessageSearchValidationException |
101 | 103 | */ |
102 | 104 | protected function parse_date($date) { |
103 | - if($date instanceof \Carbon\Carbon) return $date; |
|
105 | + if($date instanceof \Carbon\Carbon) { |
|
106 | + return $date; |
|
107 | + } |
|
104 | 108 | |
105 | 109 | try { |
106 | 110 | $date = Carbon::parse($date); |
@@ -151,7 +155,7 @@ discard block |
||
151 | 155 | */ |
152 | 156 | if($this->getCharset() === null){ |
153 | 157 | $available_messages = imap_search($this->getClient()->getConnection(), $this->getRawQuery(), SE_UID); |
154 | - }else{ |
|
158 | + } else{ |
|
155 | 159 | $available_messages = imap_search($this->getClient()->getConnection(), $this->getRawQuery(), SE_UID, $this->getCharset()); |
156 | 160 | } |
157 | 161 | |
@@ -203,7 +207,7 @@ discard block |
||
203 | 207 | } else { |
204 | 208 | if($statement[1] === null){ |
205 | 209 | $query .= $statement[0]; |
206 | - }else{ |
|
210 | + } else{ |
|
207 | 211 | $query .= $statement[0].' "'.$statement[1].'"'; |
208 | 212 | } |
209 | 213 | } |
@@ -232,7 +236,9 @@ discard block |
||
232 | 236 | * @return $this |
233 | 237 | */ |
234 | 238 | public function limit($limit, $page = 1) { |
235 | - if($page >= 1) $this->page = $page; |
|
239 | + if($page >= 1) { |
|
240 | + $this->page = $page; |
|
241 | + } |
|
236 | 242 | $this->limit = $limit; |
237 | 243 | |
238 | 244 | return $this; |