@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | */ |
256 | 256 | try { |
257 | 257 | $this->date = Carbon::parse($date); |
258 | - } catch(\Exception $e) { |
|
258 | + } catch (\Exception $e) { |
|
259 | 259 | switch (true) { |
260 | 260 | case preg_match('/([A-Z]{2,3}\,\ [0-9]{1,2}\ [A-Z]{2,3}\ [0-9]{4}\ [0-9]{1,2}\:[0-9]{1,2}\:[0-9]{1,2}\ \+[0-9]{4}\ \([A-Z]{2,3}\+[0-9]{1,2}\:[0-9]{1,2})\)+$/i', $date) > 0: |
261 | 261 | $array = explode('(', $date); |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | } |
299 | 299 | if (property_exists($header, 'Msgno')) { |
300 | 300 | $this->message_no = ($this->fetch_options == FT_UID) ? trim($header->Msgno) : imap_msgno($this->client->getConnection(), trim($header->Msgno)); |
301 | - } else{ |
|
301 | + } else { |
|
302 | 302 | $this->message_no = imap_msgno($this->client->getConnection(), $this->getUid()); |
303 | 303 | } |
304 | 304 | } |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | public function setFetchOption($option) { |
455 | 455 | if (is_long($option) == true) { |
456 | 456 | $this->fetch_options = $option; |
457 | - } elseif(is_null($option) == true) { |
|
457 | + } elseif (is_null($option) == true) { |
|
458 | 458 | $config = config('imap.options.fetch', FT_UID); |
459 | 459 | $this->fetch_options = is_long($config) ? $config : 1; |
460 | 460 | } |
@@ -153,8 +153,8 @@ discard block |
||
153 | 153 | * |
154 | 154 | * @return Message|null |
155 | 155 | */ |
156 | - public function getMessage($uid, $msglist = null){ |
|
157 | - if(imap_msgno($this->getClient()->getConnection(), $uid) > 0){ |
|
156 | + public function getMessage($uid, $msglist = null) { |
|
157 | + if (imap_msgno($this->getClient()->getConnection(), $uid) > 0) { |
|
158 | 158 | return new Message($uid, $msglist, $this->getClient()); |
159 | 159 | } |
160 | 160 | |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | |
261 | 261 | $this->getClient()->checkConnection(); |
262 | 262 | |
263 | - if($this->validateWhereStatements($where) === false){ |
|
263 | + if ($this->validateWhereStatements($where) === false) { |
|
264 | 264 | throw new MessageSearchValidationException('Invalid imap search criteria provided'); |
265 | 265 | } |
266 | 266 | |
@@ -269,10 +269,10 @@ discard block |
||
269 | 269 | $messages = MessageCollection::make([]); |
270 | 270 | |
271 | 271 | $query = ''; |
272 | - foreach($where as $statement){ |
|
273 | - if(count($statement) == 1){ |
|
272 | + foreach ($where as $statement) { |
|
273 | + if (count($statement) == 1) { |
|
274 | 274 | $query .= $statement[0]; |
275 | - } else{ |
|
275 | + } else { |
|
276 | 276 | $query .= $statement[0].' "'.$statement[1].'"'; |
277 | 277 | } |
278 | 278 | } |
@@ -308,14 +308,14 @@ discard block |
||
308 | 308 | * https://tools.ietf.org/html/rfc1064 |
309 | 309 | * https://tools.ietf.org/html/rfc822 |
310 | 310 | */ |
311 | - protected function validateWhereStatements($statements){ |
|
312 | - foreach($statements as $statement){ |
|
311 | + protected function validateWhereStatements($statements) { |
|
312 | + foreach ($statements as $statement) { |
|
313 | 313 | $criteria = $statement[0]; |
314 | - if(in_array($criteria, [ |
|
314 | + if (in_array($criteria, [ |
|
315 | 315 | 'OR', 'AND', |
316 | 316 | 'ALL', 'ANSWERED', 'BCC', 'BEFORE', 'BODY', 'CC', 'DELETED', 'FLAGGED', 'FROM', 'KEYWORD', |
317 | 317 | 'NEW', 'OLD', 'ON', 'RECENT', 'SEEN', 'SINCE', 'SUBJECT', 'TEXT', 'TO', |
318 | - 'UNANSWERED', 'UNDELETED', 'UNFLAGGED', 'UNKEYWORD', 'UNSEEN']) == false){ |
|
318 | + 'UNANSWERED', 'UNDELETED', 'UNFLAGGED', 'UNKEYWORD', 'UNSEEN']) == false) { |
|
319 | 319 | return false; |
320 | 320 | } |
321 | 321 | } |
@@ -356,11 +356,11 @@ discard block |
||
356 | 356 | * @param $attributes |
357 | 357 | */ |
358 | 358 | protected function parseAttributes($attributes) { |
359 | - $this->no_inferiors = ($attributes & LATT_NOINFERIORS) ? true : false; |
|
360 | - $this->no_select = ($attributes & LATT_NOSELECT) ? true : false; |
|
361 | - $this->marked = ($attributes & LATT_MARKED) ? true : false; |
|
362 | - $this->referal = ($attributes & LATT_REFERRAL) ? true : false; |
|
363 | - $this->has_children = ($attributes & LATT_HASCHILDREN) ? true : false; |
|
359 | + $this->no_inferiors = ($attributes & LATT_NOINFERIORS) ? true : false; |
|
360 | + $this->no_select = ($attributes & LATT_NOSELECT) ? true : false; |
|
361 | + $this->marked = ($attributes & LATT_MARKED) ? true : false; |
|
362 | + $this->referal = ($attributes & LATT_REFERRAL) ? true : false; |
|
363 | + $this->has_children = ($attributes & LATT_HASCHILDREN) ? true : false; |
|
364 | 364 | } |
365 | 365 | |
366 | 366 | /** |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | * |
369 | 369 | * @return bool |
370 | 370 | */ |
371 | - public function delete(){ |
|
371 | + public function delete() { |
|
372 | 372 | $status = imap_deletemailbox($this->client->connection, $this->path); |
373 | 373 | $this->client->expunge(); |
374 | 374 | |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | * |
383 | 383 | * @return bool |
384 | 384 | */ |
385 | - public function move($target_mailbox){ |
|
385 | + public function move($target_mailbox) { |
|
386 | 386 | $status = imap_renamemailbox($this->client->connection, $this->path, $target_mailbox); |
387 | 387 | $this->client->expunge(); |
388 | 388 | |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | * |
403 | 403 | * @return object |
404 | 404 | */ |
405 | - public function getStatus($options){ |
|
405 | + public function getStatus($options) { |
|
406 | 406 | return imap_status($this->client->connection, $this->path, $options); |
407 | 407 | } |
408 | 408 | |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | * |
416 | 416 | * @return bool |
417 | 417 | */ |
418 | - public function appendMessage($message, $options = null, $internal_date = null){ |
|
418 | + public function appendMessage($message, $options = null, $internal_date = null) { |
|
419 | 419 | return imap_append($this->client->connection, $this->path, $message, $options, $internal_date); |
420 | 420 | } |
421 | 421 | |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | * |
425 | 425 | * @return Client |
426 | 426 | */ |
427 | - public function getClient(){ |
|
427 | + public function getClient() { |
|
428 | 428 | return $this->client; |
429 | 429 | } |
430 | 430 | } |
431 | 431 | \ No newline at end of file |