@@ -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 | |
@@ -72,13 +72,13 @@ discard block |
||
| 72 | 72 | if($value === null) { |
| 73 | 73 | if(isset(self::$config[$part])) { |
| 74 | 74 | $value = self::$config[$part]; |
| 75 | - }else{ |
|
| 75 | + } else{ |
|
| 76 | 76 | break; |
| 77 | 77 | } |
| 78 | - }else{ |
|
| 78 | + } else{ |
|
| 79 | 79 | if(isset($value[$part])) { |
| 80 | 80 | $value = $value[$part]; |
| 81 | - }else{ |
|
| 81 | + } else{ |
|
| 82 | 82 | break; |
| 83 | 83 | } |
| 84 | 84 | } |
@@ -227,11 +227,15 @@ discard block |
||
| 227 | 227 | $arrays = func_get_args(); |
| 228 | 228 | $base = array_shift($arrays); |
| 229 | 229 | |
| 230 | - if(!is_array($base)) $base = empty($base) ? array() : array($base); |
|
| 230 | + if(!is_array($base)) { |
|
| 231 | + $base = empty($base) ? array() : array($base); |
|
| 232 | + } |
|
| 231 | 233 | |
| 232 | 234 | foreach($arrays as $append) { |
| 233 | 235 | |
| 234 | - if(!is_array($append)) $append = array($append); |
|
| 236 | + if(!is_array($append)) { |
|
| 237 | + $append = array($append); |
|
| 238 | + } |
|
| 235 | 239 | |
| 236 | 240 | foreach($append as $key => $value) { |
| 237 | 241 | |
@@ -243,7 +247,9 @@ discard block |
||
| 243 | 247 | if(is_array($value) or is_array($base[$key])) { |
| 244 | 248 | $base[$key] = $this->array_merge_recursive_distinct($base[$key], $append[$key]); |
| 245 | 249 | } else if(is_numeric($key)) { |
| 246 | - if(!in_array($value, $base)) $base[] = $value; |
|
| 250 | + if(!in_array($value, $base)) { |
|
| 251 | + $base[] = $value; |
|
| 252 | + } |
|
| 247 | 253 | } else { |
| 248 | 254 | $base[$key] = $value; |
| 249 | 255 | } |
@@ -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 | |
@@ -232,7 +232,9 @@ discard block |
||
| 232 | 232 | public function move($new_name, $expunge = true) { |
| 233 | 233 | $this->client->checkConnection(); |
| 234 | 234 | $status = $this->client->getConnection()->renameFolder($this->full_name, $new_name); |
| 235 | - if($expunge) $this->client->expunge(); |
|
| 235 | + if($expunge) { |
|
| 236 | + $this->client->expunge(); |
|
| 237 | + } |
|
| 236 | 238 | |
| 237 | 239 | $folder = $this->client->getFolder($new_name); |
| 238 | 240 | $event = $this->getEvent("folder", "moved"); |
@@ -306,7 +308,9 @@ discard block |
||
| 306 | 308 | */ |
| 307 | 309 | public function delete($expunge = true) { |
| 308 | 310 | $status = $this->client->getConnection()->deleteFolder($this->path); |
| 309 | - if($expunge) $this->client->expunge(); |
|
| 311 | + if($expunge) { |
|
| 312 | + $this->client->expunge(); |
|
| 313 | + } |
|
| 310 | 314 | |
| 311 | 315 | $event = $this->getEvent("folder", "deleted"); |
| 312 | 316 | $event::dispatch($this); |
@@ -374,7 +378,7 @@ discard block |
||
| 374 | 378 | |
| 375 | 379 | $connection->idle(); |
| 376 | 380 | } |
| 377 | - }catch (Exceptions\RuntimeException $e) { |
|
| 381 | + } catch (Exceptions\RuntimeException $e) { |
|
| 378 | 382 | if(strpos($e->getMessage(), "connection closed") === false) { |
| 379 | 383 | throw $e; |
| 380 | 384 | } |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | $name = $this->decodeFolderName($item->name); |
| 311 | 311 | $result[$name] = ['delimiter' => $item->delimiter, 'flags' => []]; |
| 312 | 312 | } |
| 313 | - }else{ |
|
| 313 | + } else{ |
|
| 314 | 314 | throw new RuntimeException(\imap_last_error()); |
| 315 | 315 | } |
| 316 | 316 | |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | |
| 335 | 335 | if ($mode == "+"){ |
| 336 | 336 | $status = \imap_setflag_full($this->stream, $from, $flag, $uid ? IMAP::FT_UID : IMAP::NIL); |
| 337 | - }else{ |
|
| 337 | + } else{ |
|
| 338 | 338 | $status = \imap_clearflag_full($this->stream, $from, $flag, $uid ? IMAP::FT_UID : IMAP::NIL); |
| 339 | 339 | } |
| 340 | 340 | |