@@ -67,7 +67,7 @@ |
||
67 | 67 | return $this->attributes[$name]; |
68 | 68 | } |
69 | 69 | |
70 | - }elseif (strtolower(substr($method, 0, 3)) === 'set') { |
|
70 | + } elseif (strtolower(substr($method, 0, 3)) === 'set') { |
|
71 | 71 | $name = Str::snake(substr($method, 3)); |
72 | 72 | |
73 | 73 | if(isset($this->attributes[$name])) { |
@@ -55,7 +55,7 @@ |
||
55 | 55 | // so add them back in manually if we can |
56 | 56 | if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) { |
57 | 57 | $cryptoMethod = STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; |
58 | - }elseif (defined('STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT')) { |
|
58 | + } elseif (defined('STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT')) { |
|
59 | 59 | $cryptoMethod = STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT; |
60 | 60 | } |
61 | 61 |
@@ -35,11 +35,14 @@ |
||
35 | 35 | <td><?php echo $message->getAttachments()->count() > 0 ? 'yes' : 'no'; ?></td> |
36 | 36 | </tr> |
37 | 37 | <?php endforeach; ?> |
38 | - <?php else: ?> |
|
38 | + <?php else { |
|
39 | + : ?> |
|
39 | 40 | <tr> |
40 | 41 | <td colspan="4">No messages found</td> |
41 | 42 | </tr> |
42 | - <?php endif; ?> |
|
43 | + <?php endif; |
|
44 | +} |
|
45 | +?> |
|
43 | 46 | </tbody> |
44 | 47 | </table> |
45 | 48 |
@@ -31,11 +31,14 @@ |
||
31 | 31 | <td><?php echo $folder->search()->unseen()->setFetchBody(false)->count(); ?></td> |
32 | 32 | </tr> |
33 | 33 | <?php endforeach; ?> |
34 | - <?php else: ?> |
|
34 | + <?php else { |
|
35 | + : ?> |
|
35 | 36 | <tr> |
36 | 37 | <td colspan="4">No folders found</td> |
37 | 38 | </tr> |
38 | - <?php endif; ?> |
|
39 | + <?php endif; |
|
40 | +} |
|
41 | +?> |
|
39 | 42 | </tbody> |
40 | 43 | </table> |
41 | 44 |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | $name = $this->decodeFolderName($item->name); |
324 | 324 | $result[$name] = ['delimiter' => $item->delimiter, 'flags' => []]; |
325 | 325 | } |
326 | - }else{ |
|
326 | + } else{ |
|
327 | 327 | throw new RuntimeException(\imap_last_error()); |
328 | 328 | } |
329 | 329 | |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | |
348 | 348 | if ($mode == "+"){ |
349 | 349 | $status = \imap_setflag_full($this->stream, $from, $flag, $uid ? IMAP::ST_UID : IMAP::NIL); |
350 | - }else{ |
|
350 | + } else{ |
|
351 | 351 | $status = \imap_clearflag_full($this->stream, $from, $flag, $uid ? IMAP::ST_UID : IMAP::NIL); |
352 | 352 | } |
353 | 353 |
@@ -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): Carbon { |
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); |
@@ -644,7 +648,9 @@ discard block |
||
644 | 648 | * @return $this |
645 | 649 | */ |
646 | 650 | public function limit(int $limit, int $page = 1): Query { |
647 | - if ($page >= 1) $this->page = $page; |
|
651 | + if ($page >= 1) { |
|
652 | + $this->page = $page; |
|
653 | + } |
|
648 | 654 | $this->limit = $limit; |
649 | 655 | |
650 | 656 | return $this; |
@@ -240,7 +240,9 @@ discard block |
||
240 | 240 | public function move(string $new_name, bool $expunge = true): bool { |
241 | 241 | $this->client->checkConnection(); |
242 | 242 | $status = $this->client->getConnection()->renameFolder($this->full_name, $new_name); |
243 | - if($expunge) $this->client->expunge(); |
|
243 | + if($expunge) { |
|
244 | + $this->client->expunge(); |
|
245 | + } |
|
244 | 246 | |
245 | 247 | $folder = $this->client->getFolder($new_name); |
246 | 248 | $event = $this->getEvent("folder", "moved"); |
@@ -316,7 +318,9 @@ discard block |
||
316 | 318 | */ |
317 | 319 | public function delete(bool $expunge = true): bool { |
318 | 320 | $status = $this->client->getConnection()->deleteFolder($this->path); |
319 | - if($expunge) $this->client->expunge(); |
|
321 | + if($expunge) { |
|
322 | + $this->client->expunge(); |
|
323 | + } |
|
320 | 324 | |
321 | 325 | $event = $this->getEvent("folder", "deleted"); |
322 | 326 | $event::dispatch($this); |
@@ -394,7 +398,7 @@ discard block |
||
394 | 398 | |
395 | 399 | $connection->idle(); |
396 | 400 | } |
397 | - }catch (Exceptions\RuntimeException $e) { |
|
401 | + } catch (Exceptions\RuntimeException $e) { |
|
398 | 402 | if(strpos($e->getMessage(), "connection closed") === false) { |
399 | 403 | throw $e; |
400 | 404 | } |
@@ -238,7 +238,9 @@ discard block |
||
238 | 238 | } else { |
239 | 239 | $tokens = $line; |
240 | 240 | } |
241 | - if ($this->debug) echo "<< ".$line."\n"; |
|
241 | + if ($this->debug) { |
|
242 | + echo "<< ".$line."\n"; |
|
243 | + } |
|
242 | 244 | |
243 | 245 | // if tag is wanted tag we might be at the end of a multiline response |
244 | 246 | return $tag == $wantedTag; |
@@ -304,7 +306,9 @@ discard block |
||
304 | 306 | $line .= ' ' . $token; |
305 | 307 | } |
306 | 308 | } |
307 | - if ($this->debug) echo ">> ".$line."\n"; |
|
309 | + if ($this->debug) { |
|
310 | + echo ">> ".$line."\n"; |
|
311 | + } |
|
308 | 312 | |
309 | 313 | if (fwrite($this->stream, $line . "\r\n") === false) { |
310 | 314 | throw new RuntimeException('failed to write - connection closed?'); |
@@ -456,7 +460,9 @@ discard block |
||
456 | 460 | public function getCapabilities(): array { |
457 | 461 | $response = $this->requestAndResponse('CAPABILITY'); |
458 | 462 | |
459 | - if (!$response) return []; |
|
463 | + if (!$response) { |
|
464 | + return []; |
|
465 | + } |
|
460 | 466 | |
461 | 467 | $capabilities = []; |
462 | 468 | foreach ($response as $line) { |
@@ -616,13 +622,14 @@ discard block |
||
616 | 622 | // if we want only one message we can ignore everything else and just return |
617 | 623 | if ($to === null && !is_array($from) && ($uid ? $tokens[2][$uidKey] == $from : $tokens[0] == $from)) { |
618 | 624 | // we still need to read all lines |
619 | - while (!$this->readLine($tokens, $tag)) |
|
620 | - |
|
625 | + while (!$this->readLine($tokens, $tag)) { |
|
626 | + |
|
621 | 627 | return $data; |
628 | + } |
|
622 | 629 | } |
623 | 630 | if ($uid) { |
624 | 631 | $result[$tokens[2][$uidKey]] = $data; |
625 | - }else{ |
|
632 | + } else{ |
|
626 | 633 | $result[$tokens[0]] = $data; |
627 | 634 | } |
628 | 635 | } |
@@ -284,7 +284,9 @@ discard block |
||
284 | 284 | } |
285 | 285 | |
286 | 286 | foreach ($headers as $key => $values) { |
287 | - if (isset($imap_headers[$key])) continue; |
|
287 | + if (isset($imap_headers[$key])) { |
|
288 | + continue; |
|
289 | + } |
|
288 | 290 | $value = null; |
289 | 291 | switch ($key) { |
290 | 292 | case 'from': |
@@ -500,7 +502,9 @@ discard block |
||
500 | 502 | * Try to extract the priority from a given raw header string |
501 | 503 | */ |
502 | 504 | private function findPriority(): void { |
503 | - if (($priority = $this->get("x_priority")) === null) return; |
|
505 | + if (($priority = $this->get("x_priority")) === null) { |
|
506 | + return; |
|
507 | + } |
|
504 | 508 | switch ((int)"$priority") { |
505 | 509 | case IMAP::MESSAGE_PRIORITY_HIGHEST; |
506 | 510 | $priority = IMAP::MESSAGE_PRIORITY_HIGHEST; |