@@ -31,7 +31,8 @@ discard block |
||
| 31 | 31 | <td><?php echo $oFolder->search()->unseen()->leaveUnread()->setFetchBody(false)->setFetchAttachment(false)->get()->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> |
@@ -39,4 +40,6 @@ discard block |
||
| 39 | 40 | </tbody> |
| 40 | 41 | </table> |
| 41 | 42 | |
| 42 | -<?php echo $paginator->links(); ?> |
|
| 43 | 43 | \ No newline at end of file |
| 44 | +<?php echo $paginator->links(); |
|
| 45 | +} |
|
| 46 | +?> |
|
| 44 | 47 | \ No newline at end of file |
@@ -36,11 +36,14 @@ |
||
| 36 | 36 | <td><?php echo $oMessage->getAttachments()->count() > 0 ? 'yes' : 'no'; ?></td> |
| 37 | 37 | </tr> |
| 38 | 38 | <?php endforeach; ?> |
| 39 | - <?php else: ?> |
|
| 39 | + <?php else { |
|
| 40 | + : ?> |
|
| 40 | 41 | <tr> |
| 41 | 42 | <td colspan="4">No messages found</td> |
| 42 | 43 | </tr> |
| 43 | - <?php endif; ?> |
|
| 44 | + <?php endif; |
|
| 45 | +} |
|
| 46 | +?> |
|
| 44 | 47 | </tbody> |
| 45 | 48 | </table> |
| 46 | 49 | |
@@ -237,7 +237,9 @@ discard block |
||
| 237 | 237 | public function move($new_name, $expunge = true) { |
| 238 | 238 | $this->client->checkConnection(); |
| 239 | 239 | $status = $this->client->getConnection()->renameFolder($this->full_name, $new_name); |
| 240 | - if($expunge) $this->client->expunge(); |
|
| 240 | + if($expunge) { |
|
| 241 | + $this->client->expunge(); |
|
| 242 | + } |
|
| 241 | 243 | |
| 242 | 244 | $folder = $this->client->getFolder($new_name); |
| 243 | 245 | $event = $this->getEvent("folder", "moved"); |
@@ -300,7 +302,9 @@ discard block |
||
| 300 | 302 | */ |
| 301 | 303 | public function delete($expunge = true) { |
| 302 | 304 | $status = $this->client->getConnection()->deleteFolder($this->path); |
| 303 | - if($expunge) $this->client->expunge(); |
|
| 305 | + if($expunge) { |
|
| 306 | + $this->client->expunge(); |
|
| 307 | + } |
|
| 304 | 308 | |
| 305 | 309 | $event = $this->getEvent("folder", "deleted"); |
| 306 | 310 | $event::dispatch($this); |
@@ -368,10 +372,10 @@ discard block |
||
| 368 | 372 | |
| 369 | 373 | $connection->idle(); |
| 370 | 374 | } |
| 371 | - }catch (Exceptions\RuntimeException $e) { |
|
| 375 | + } catch (Exceptions\RuntimeException $e) { |
|
| 372 | 376 | if(strpos($e->getMessage(), "connection closed") === false) { |
| 373 | 377 | throw $e; |
| 374 | - }else{ |
|
| 378 | + } else{ |
|
| 375 | 379 | $this->client->connect(); |
| 376 | 380 | $this->client->openFolder($this->path); |
| 377 | 381 | $connection = $this->client->getConnection(); |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | if(strtolower(substr($method, 0, 3)) === 'get') { |
| 227 | 227 | $name = Str::snake(substr($method, 3)); |
| 228 | 228 | return $this->get($name); |
| 229 | - }elseif (strtolower(substr($method, 0, 3)) === 'set') { |
|
| 229 | + } elseif (strtolower(substr($method, 0, 3)) === 'set') { |
|
| 230 | 230 | $name = Str::snake(substr($method, 3)); |
| 231 | 231 | |
| 232 | 232 | if(in_array($name, array_keys($this->attributes))) { |
@@ -612,9 +612,9 @@ discard block |
||
| 612 | 612 | return EncodingAliases::get($parameter->value); |
| 613 | 613 | } |
| 614 | 614 | } |
| 615 | - }elseif (property_exists($structure, 'charset')){ |
|
| 615 | + } elseif (property_exists($structure, 'charset')){ |
|
| 616 | 616 | return EncodingAliases::get($structure->charset); |
| 617 | - }elseif (is_string($structure) === true){ |
|
| 617 | + } elseif (is_string($structure) === true){ |
|
| 618 | 618 | return mb_detect_encoding($structure); |
| 619 | 619 | } |
| 620 | 620 | |
@@ -705,7 +705,9 @@ discard block |
||
| 705 | 705 | */ |
| 706 | 706 | public function delete($expunge = true) { |
| 707 | 707 | $status = $this->setFlag("Deleted"); |
| 708 | - if($expunge) $this->client->expunge(); |
|
| 708 | + if($expunge) { |
|
| 709 | + $this->client->expunge(); |
|
| 710 | + } |
|
| 709 | 711 | |
| 710 | 712 | $event = $this->getEvent("message", "deleted"); |
| 711 | 713 | $event::dispatch($this); |
@@ -724,7 +726,9 @@ discard block |
||
| 724 | 726 | */ |
| 725 | 727 | public function restore($expunge = true) { |
| 726 | 728 | $status = $this->unsetFlag("Deleted"); |
| 727 | - if($expunge) $this->client->expunge(); |
|
| 729 | + if($expunge) { |
|
| 730 | + $this->client->expunge(); |
|
| 731 | + } |
|
| 728 | 732 | |
| 729 | 733 | $event = $this->getEvent("message", "restored"); |
| 730 | 734 | $event::dispatch($this); |
@@ -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])) { |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | $name = $this->decodeFolderName($item->name); |
| 291 | 291 | $result[$name] = ['delimiter' => $item->delimiter, 'flags' => []]; |
| 292 | 292 | } |
| 293 | - }else{ |
|
| 293 | + } else{ |
|
| 294 | 294 | throw new RuntimeException(\imap_last_error()); |
| 295 | 295 | } |
| 296 | 296 | |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | |
| 314 | 314 | if ($mode == "+"){ |
| 315 | 315 | $status = \imap_setflag_full($this->stream, $from, $flag, IMAP::SE_UID); |
| 316 | - }else{ |
|
| 316 | + } else{ |
|
| 317 | 317 | $status = \imap_clearflag_full($this->stream, $from, $flag, IMAP::SE_UID); |
| 318 | 318 | } |
| 319 | 319 | |
@@ -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 | |
@@ -256,9 +256,13 @@ discard block |
||
| 256 | 256 | $tokens = [substr($tokens, 0, 2)]; |
| 257 | 257 | } |
| 258 | 258 | if (is_array($lines)){ |
| 259 | - if ($this->debug) echo "<< ".json_encode($lines)."\n"; |
|
| 260 | - }else{ |
|
| 261 | - if ($this->debug) echo "<< ".$lines."\n"; |
|
| 259 | + if ($this->debug) { |
|
| 260 | + echo "<< ".json_encode($lines)."\n"; |
|
| 261 | + } |
|
| 262 | + } else{ |
|
| 263 | + if ($this->debug) { |
|
| 264 | + echo "<< ".$lines."\n"; |
|
| 265 | + } |
|
| 262 | 266 | } |
| 263 | 267 | // last line has response code |
| 264 | 268 | if ($tokens[0] == 'OK') { |
@@ -298,7 +302,9 @@ discard block |
||
| 298 | 302 | $line .= ' ' . $token; |
| 299 | 303 | } |
| 300 | 304 | } |
| 301 | - if ($this->debug) echo ">> ".$line."\n"; |
|
| 305 | + if ($this->debug) { |
|
| 306 | + echo ">> ".$line."\n"; |
|
| 307 | + } |
|
| 302 | 308 | |
| 303 | 309 | if (fwrite($this->stream, $line . "\r\n") === false) { |
| 304 | 310 | throw new RuntimeException('failed to write - connection closed?'); |
@@ -448,7 +454,9 @@ discard block |
||
| 448 | 454 | public function getCapabilities() { |
| 449 | 455 | $response = $this->requestAndResponse('CAPABILITY'); |
| 450 | 456 | |
| 451 | - if (!$response) return []; |
|
| 457 | + if (!$response) { |
|
| 458 | + return []; |
|
| 459 | + } |
|
| 452 | 460 | |
| 453 | 461 | $capabilities = []; |
| 454 | 462 | foreach ($response as $line) { |
@@ -603,9 +611,10 @@ discard block |
||
| 603 | 611 | // if we want only one message we can ignore everything else and just return |
| 604 | 612 | if ($to === null && !is_array($from) && ($uid ? $tokens[2][$uidKey] == $from : $tokens[0] == $from)) { |
| 605 | 613 | // we still need to read all lines |
| 606 | - while (!$this->readLine($tokens, $tag)) |
|
| 607 | - |
|
| 614 | + while (!$this->readLine($tokens, $tag)) { |
|
| 615 | + |
|
| 608 | 616 | return $data; |
| 617 | + } |
|
| 609 | 618 | } |
| 610 | 619 | $result[$tokens[0]] = $data; |
| 611 | 620 | } |