@@ -46,7 +46,9 @@ discard block |
||
| 46 | 46 | */ |
| 47 | 47 | public function getCustomHTMLBody($callback = false) { |
| 48 | 48 | $body = $this->getHtmlBody(); |
| 49 | - if($body === null) return null; |
|
| 49 | + if($body === null) { |
|
| 50 | + return null; |
|
| 51 | + } |
|
| 50 | 52 | |
| 51 | 53 | if ($callback !== false) { |
| 52 | 54 | $aAttachment = $this->parent->getAttachments(); |
@@ -54,7 +56,7 @@ discard block |
||
| 54 | 56 | /** @var Attachment $oAttachment */ |
| 55 | 57 | if(is_callable($callback)) { |
| 56 | 58 | $body = $callback($body, $oAttachment); |
| 57 | - }elseif(is_string($callback)) { |
|
| 59 | + } elseif(is_string($callback)) { |
|
| 58 | 60 | call_user_func($callback, [$body, $oAttachment]); |
| 59 | 61 | } |
| 60 | 62 | }); |
@@ -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 | |
@@ -121,7 +121,7 @@ |
||
| 121 | 121 | protected function parse(){ |
| 122 | 122 | if ($this->header === null) { |
| 123 | 123 | $body = $this->findHeaders(); |
| 124 | - }else{ |
|
| 124 | + } else{ |
|
| 125 | 125 | $body = $this->raw; |
| 126 | 126 | } |
| 127 | 127 | |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | return null; |
| 131 | - }elseif (strtolower(substr($method, 0, 3)) === 'set') { |
|
| 131 | + } elseif (strtolower(substr($method, 0, 3)) === 'set') { |
|
| 132 | 132 | $name = Str::snake(substr($method, 3)); |
| 133 | 133 | |
| 134 | 134 | $this->attributes[$name] = array_pop($arguments); |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | $this->setName($filename); |
| 223 | 223 | } elseif (($name = $this->part->name) !== null) { |
| 224 | 224 | $this->setName($name); |
| 225 | - }else { |
|
| 225 | + } else { |
|
| 226 | 226 | $this->setName("undefined"); |
| 227 | 227 | } |
| 228 | 228 | |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | if ($name !== null) { |
| 258 | 258 | if($decoder === 'utf-8' && extension_loaded('imap')) { |
| 259 | 259 | $this->name = \imap_utf8($name); |
| 260 | - }else{ |
|
| 260 | + } else{ |
|
| 261 | 261 | $this->name = mb_decode_mimeheader($name); |
| 262 | 262 | } |
| 263 | 263 | } |
@@ -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 | |
@@ -285,7 +285,9 @@ discard block |
||
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | foreach ($headers as $key => $values) { |
| 288 | - if (isset($imap_headers[$key])) continue; |
|
| 288 | + if (isset($imap_headers[$key])) { |
|
| 289 | + continue; |
|
| 290 | + } |
|
| 289 | 291 | $value = null; |
| 290 | 292 | switch ($key) { |
| 291 | 293 | case 'from': |
@@ -506,7 +508,9 @@ discard block |
||
| 506 | 508 | * Try to extract the priority from a given raw header string |
| 507 | 509 | */ |
| 508 | 510 | private function findPriority() { |
| 509 | - if (($priority = $this->get("x_priority")) === null) return; |
|
| 511 | + if (($priority = $this->get("x_priority")) === null) { |
|
| 512 | + return; |
|
| 513 | + } |
|
| 510 | 514 | switch ((int)"$priority") { |
| 511 | 515 | case IMAP::MESSAGE_PRIORITY_HIGHEST; |
| 512 | 516 | $priority = IMAP::MESSAGE_PRIORITY_HIGHEST; |