@@ -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 | |
@@ -90,7 +90,7 @@ |
||
| 90 | 90 | $content_type = (is_array($content_type)) ? implode(' ', $content_type) : $content_type; |
| 91 | 91 | if(stripos($content_type, 'multipart') === 0) { |
| 92 | 92 | $this->type = IMAP::MESSAGE_TYPE_MULTIPART; |
| 93 | - }else{ |
|
| 93 | + } else{ |
|
| 94 | 94 | $this->type = IMAP::MESSAGE_TYPE_TEXT; |
| 95 | 95 | } |
| 96 | 96 | } |
@@ -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 | } |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | $value = $this->default_account_config[$key]; |
| 208 | 208 | if(isset($config[$key])) { |
| 209 | 209 | $value = $config[$key]; |
| 210 | - }elseif(isset($default_config[$key])) { |
|
| 210 | + } elseif(isset($default_config[$key])) { |
|
| 211 | 211 | $value = $default_config[$key]; |
| 212 | 212 | } |
| 213 | 213 | $this->$key = $value; |
@@ -239,39 +239,39 @@ discard block |
||
| 239 | 239 | if(isset($config['masks']['message'])) { |
| 240 | 240 | if(class_exists($config['masks']['message'])) { |
| 241 | 241 | $this->default_message_mask = $config['masks']['message']; |
| 242 | - }else{ |
|
| 242 | + } else{ |
|
| 243 | 243 | throw new MaskNotFoundException("Unknown mask provided: ".$config['masks']['message']); |
| 244 | 244 | } |
| 245 | - }else{ |
|
| 245 | + } else{ |
|
| 246 | 246 | if(class_exists($default_config['message'])) { |
| 247 | 247 | $this->default_message_mask = $default_config['message']; |
| 248 | - }else{ |
|
| 248 | + } else{ |
|
| 249 | 249 | throw new MaskNotFoundException("Unknown mask provided: ".$default_config['message']); |
| 250 | 250 | } |
| 251 | 251 | } |
| 252 | 252 | if(isset($config['masks']['attachment'])) { |
| 253 | 253 | if(class_exists($config['masks']['attachment'])) { |
| 254 | 254 | $this->default_attachment_mask = $config['masks']['attachment']; |
| 255 | - }else{ |
|
| 255 | + } else{ |
|
| 256 | 256 | throw new MaskNotFoundException("Unknown mask provided: ".$config['masks']['attachment']); |
| 257 | 257 | } |
| 258 | - }else{ |
|
| 258 | + } else{ |
|
| 259 | 259 | if(class_exists($default_config['attachment'])) { |
| 260 | 260 | $this->default_attachment_mask = $default_config['attachment']; |
| 261 | - }else{ |
|
| 261 | + } else{ |
|
| 262 | 262 | throw new MaskNotFoundException("Unknown mask provided: ".$default_config['attachment']); |
| 263 | 263 | } |
| 264 | 264 | } |
| 265 | - }else{ |
|
| 265 | + } else{ |
|
| 266 | 266 | if(class_exists($default_config['message'])) { |
| 267 | 267 | $this->default_message_mask = $default_config['message']; |
| 268 | - }else{ |
|
| 268 | + } else{ |
|
| 269 | 269 | throw new MaskNotFoundException("Unknown mask provided: ".$default_config['message']); |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | if(class_exists($default_config['attachment'])) { |
| 273 | 273 | $this->default_attachment_mask = $default_config['attachment']; |
| 274 | - }else{ |
|
| 274 | + } else{ |
|
| 275 | 275 | throw new MaskNotFoundException("Unknown mask provided: ".$default_config['attachment']); |
| 276 | 276 | } |
| 277 | 277 | } |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | $this->connection = new ImapProtocol($this->validate_cert, $this->encryption); |
| 336 | 336 | $this->connection->setConnectionTimeout($this->timeout); |
| 337 | 337 | $this->connection->setProxy($this->proxy); |
| 338 | - }else{ |
|
| 338 | + } else{ |
|
| 339 | 339 | if (extension_loaded('imap') === false) { |
| 340 | 340 | throw new ConnectionFailedException("connection setup failed", 0, new ProtocolNotSupportedException($protocol." is an unsupported protocol")); |
| 341 | 341 | } |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | } |
| 476 | 476 | |
| 477 | 477 | return $folders; |
| 478 | - }else{ |
|
| 478 | + } else{ |
|
| 479 | 479 | throw new FolderFetchingException("failed to fetch any folders"); |
| 480 | 480 | } |
| 481 | 481 | } |
@@ -513,7 +513,9 @@ discard block |
||
| 513 | 513 | $this->checkConnection(); |
| 514 | 514 | $status = $this->connection->createFolder($folder); |
| 515 | 515 | |
| 516 | - if($expunge) $this->expunge(); |
|
| 516 | + if($expunge) { |
|
| 517 | + $this->expunge(); |
|
| 518 | + } |
|
| 517 | 519 | |
| 518 | 520 | $folder = $this->getFolder($folder); |
| 519 | 521 | if($status && $folder) { |