@@ -16,7 +16,7 @@ |
||
| 16 | 16 | * New custom method which can be called through a mask |
| 17 | 17 | * @return string |
| 18 | 18 | */ |
| 19 | - public function token(){ |
|
| 19 | + public function token() { |
|
| 20 | 20 | return implode('-', [$this->message_id, $this->uid, $this->message_no]); |
| 21 | 21 | } |
| 22 | 22 | |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | * New custom method which can be called through a mask |
| 17 | 17 | * @return string |
| 18 | 18 | */ |
| 19 | - public function token(){ |
|
| 19 | + public function token() { |
|
| 20 | 20 | return implode('-', [$this->id, $this->getMessage()->getUid(), $this->name]); |
| 21 | 21 | } |
| 22 | 22 | |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | * @return int|null |
| 70 | 70 | */ |
| 71 | 71 | public function total($total = null) { |
| 72 | - if($total === null) { |
|
| 72 | + if ($total === null) { |
|
| 73 | 73 | return $this->total; |
| 74 | 74 | } |
| 75 | 75 | |
@@ -26,8 +26,8 @@ |
||
| 26 | 26 | </tr> |
| 27 | 27 | </thead> |
| 28 | 28 | <tbody> |
| 29 | - <?php if($paginator->count() > 0): ?> |
|
| 30 | - <?php foreach($paginator as $message): ?> |
|
| 29 | + <?php if ($paginator->count() > 0): ?> |
|
| 30 | + <?php foreach ($paginator as $message): ?> |
|
| 31 | 31 | <tr> |
| 32 | 32 | <td><?php echo $message->getUid(); ?></td> |
| 33 | 33 | <td><?php echo $message->getSubject(); ?></td> |
@@ -24,8 +24,8 @@ |
||
| 24 | 24 | </tr> |
| 25 | 25 | </thead> |
| 26 | 26 | <tbody> |
| 27 | - <?php if($paginator->count() > 0): ?> |
|
| 28 | - <?php foreach($paginator as $folder): ?> |
|
| 27 | + <?php if ($paginator->count() > 0): ?> |
|
| 28 | + <?php foreach ($paginator as $folder): ?> |
|
| 29 | 29 | <tr> |
| 30 | 30 | <td><?php echo $folder->name; ?></td> |
| 31 | 31 | <td><?php echo $folder->search()->unseen()->setFetchBody(false)->count(); ?></td> |
@@ -44,11 +44,11 @@ discard block |
||
| 44 | 44 | * @param object $object |
| 45 | 45 | */ |
| 46 | 46 | public function __construct($object) { |
| 47 | - if (property_exists($object, "personal")){ $this->personal = $object->personal; } |
|
| 48 | - if (property_exists($object, "mailbox")){ $this->mailbox = $object->mailbox; } |
|
| 49 | - if (property_exists($object, "host")){ $this->host = $object->host; } |
|
| 50 | - if (property_exists($object, "mail")){ $this->mail = $object->mail; } |
|
| 51 | - if (property_exists($object, "full")){ $this->full = $object->full; } |
|
| 47 | + if (property_exists($object, "personal")) { $this->personal = $object->personal; } |
|
| 48 | + if (property_exists($object, "mailbox")) { $this->mailbox = $object->mailbox; } |
|
| 49 | + if (property_exists($object, "host")) { $this->host = $object->host; } |
|
| 50 | + if (property_exists($object, "mail")) { $this->mail = $object->mail; } |
|
| 51 | + if (property_exists($object, "full")) { $this->full = $object->full; } |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | * |
| 67 | 67 | * @return array |
| 68 | 68 | */ |
| 69 | - public function __serialize(){ |
|
| 69 | + public function __serialize() { |
|
| 70 | 70 | return [ |
| 71 | 71 | "personal" => $this->personal, |
| 72 | 72 | "mailbox" => $this->mailbox, |
@@ -30,13 +30,13 @@ discard block |
||
| 30 | 30 | * |
| 31 | 31 | * @return null |
| 32 | 32 | */ |
| 33 | - public function getHtmlBody(){ |
|
| 33 | + public function getHtmlBody() { |
|
| 34 | 34 | $bodies = $this->parent->getBodies(); |
| 35 | 35 | if (!isset($bodies['html'])) { |
| 36 | 36 | return null; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - if(is_object($bodies['html']) && property_exists($bodies['html'], 'content')) { |
|
| 39 | + if (is_object($bodies['html']) && property_exists($bodies['html'], 'content')) { |
|
| 40 | 40 | return $bodies['html']->content; |
| 41 | 41 | } |
| 42 | 42 | return $bodies['html']; |
@@ -50,15 +50,15 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function getCustomHTMLBody($callback = false) { |
| 52 | 52 | $body = $this->getHtmlBody(); |
| 53 | - if($body === null) return null; |
|
| 53 | + if ($body === null) return null; |
|
| 54 | 54 | |
| 55 | 55 | if ($callback !== false) { |
| 56 | 56 | $aAttachment = $this->parent->getAttachments(); |
| 57 | 57 | $aAttachment->each(function($oAttachment) use(&$body, $callback) { |
| 58 | 58 | /** @var Attachment $oAttachment */ |
| 59 | - if(is_callable($callback)) { |
|
| 59 | + if (is_callable($callback)) { |
|
| 60 | 60 | $body = $callback($body, $oAttachment); |
| 61 | - }elseif(is_string($callback)) { |
|
| 61 | + }elseif (is_string($callback)) { |
|
| 62 | 62 | call_user_func($callback, [$body, $oAttachment]); |
| 63 | 63 | } |
| 64 | 64 | }); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | * @return string|null |
| 75 | 75 | */ |
| 76 | 76 | public function getHTMLBodyWithEmbeddedBase64Images() { |
| 77 | - return $this->getCustomHTMLBody(function($body, $oAttachment){ |
|
| 77 | + return $this->getCustomHTMLBody(function($body, $oAttachment) { |
|
| 78 | 78 | /** @var Attachment $oAttachment */ |
| 79 | 79 | if ($oAttachment->id) { |
| 80 | 80 | $body = str_replace('cid:'.$oAttachment->id, 'data:'.$oAttachment->getContentType().';base64, '.base64_encode($oAttachment->getContent()), $body); |
@@ -233,7 +233,7 @@ |
||
| 233 | 233 | return "UID"; |
| 234 | 234 | } |
| 235 | 235 | if (strlen($uid) > 0 && !is_numeric($uid)) { |
| 236 | - return (string)$uid; |
|
| 236 | + return (string) $uid; |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | return ""; |
@@ -76,17 +76,17 @@ discard block |
||
| 76 | 76 | public static function get(string $key, $default = null) { |
| 77 | 77 | $parts = explode('.', $key); |
| 78 | 78 | $value = null; |
| 79 | - foreach($parts as $part) { |
|
| 80 | - if($value === null) { |
|
| 81 | - if(isset(self::$config[$part])) { |
|
| 79 | + foreach ($parts as $part) { |
|
| 80 | + if ($value === null) { |
|
| 81 | + if (isset(self::$config[$part])) { |
|
| 82 | 82 | $value = self::$config[$part]; |
| 83 | - }else{ |
|
| 83 | + }else { |
|
| 84 | 84 | break; |
| 85 | 85 | } |
| 86 | - }else{ |
|
| 87 | - if(isset($value[$part])) { |
|
| 86 | + }else { |
|
| 87 | + if (isset($value[$part])) { |
|
| 88 | 88 | $value = $value[$part]; |
| 89 | - }else{ |
|
| 89 | + }else { |
|
| 90 | 90 | break; |
| 91 | 91 | } |
| 92 | 92 | } |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | */ |
| 176 | 176 | public function setConfig($config): ClientManager { |
| 177 | 177 | |
| 178 | - if(is_array($config) === false) { |
|
| 178 | + if (is_array($config) === false) { |
|
| 179 | 179 | $config = require $config; |
| 180 | 180 | } |
| 181 | 181 | |
@@ -185,17 +185,17 @@ discard block |
||
| 185 | 185 | $vendor_config = require $path; |
| 186 | 186 | $config = $this->array_merge_recursive_distinct($vendor_config, $config); |
| 187 | 187 | |
| 188 | - if(is_array($config)){ |
|
| 189 | - if(isset($config['default'])){ |
|
| 190 | - if(isset($config['accounts']) && $config['default'] != false){ |
|
| 188 | + if (is_array($config)) { |
|
| 189 | + if (isset($config['default'])) { |
|
| 190 | + if (isset($config['accounts']) && $config['default'] != false) { |
|
| 191 | 191 | |
| 192 | 192 | $default_config = $vendor_config['accounts']['default']; |
| 193 | - if(isset($config['accounts'][$config['default']])){ |
|
| 193 | + if (isset($config['accounts'][$config['default']])) { |
|
| 194 | 194 | $default_config = array_merge($default_config, $config['accounts'][$config['default']]); |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | - if(is_array($config['accounts'])){ |
|
| 198 | - foreach($config['accounts'] as $account_key => $account){ |
|
| 197 | + if (is_array($config['accounts'])) { |
|
| 198 | + foreach ($config['accounts'] as $account_key => $account) { |
|
| 199 | 199 | $config['accounts'][$account_key] = array_merge($default_config, $account); |
| 200 | 200 | } |
| 201 | 201 | } |
@@ -234,20 +234,20 @@ discard block |
||
| 234 | 234 | return array_keys($arr) !== range(0, count($arr) - 1); |
| 235 | 235 | }; |
| 236 | 236 | |
| 237 | - if(!is_array($base)) $base = empty($base) ? array() : array($base); |
|
| 237 | + if (!is_array($base)) $base = empty($base) ? array() : array($base); |
|
| 238 | 238 | |
| 239 | - foreach($arrays as $append) { |
|
| 239 | + foreach ($arrays as $append) { |
|
| 240 | 240 | |
| 241 | - if(!is_array($append)) $append = array($append); |
|
| 241 | + if (!is_array($append)) $append = array($append); |
|
| 242 | 242 | |
| 243 | - foreach($append as $key => $value) { |
|
| 243 | + foreach ($append as $key => $value) { |
|
| 244 | 244 | |
| 245 | - if(!array_key_exists($key, $base) and !is_numeric($key)) { |
|
| 245 | + if (!array_key_exists($key, $base) and !is_numeric($key)) { |
|
| 246 | 246 | $base[$key] = $value; |
| 247 | 247 | continue; |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | - if( |
|
| 250 | + if ( |
|
| 251 | 251 | ( |
| 252 | 252 | is_array($value) |
| 253 | 253 | && $isAssoc($value) |
@@ -261,9 +261,9 @@ discard block |
||
| 261 | 261 | // else merging $baseConfig['dispositions'] = ['attachment', 'inline'] with $customConfig['dispositions'] = ['attachment'] |
| 262 | 262 | // results in $resultConfig['dispositions'] = ['attachment', 'inline'] |
| 263 | 263 | $base[$key] = $this->array_merge_recursive_distinct($base[$key], $value); |
| 264 | - } else if(is_numeric($key)) { |
|
| 265 | - if(!in_array($value, $base)) $base[] = $value; |
|
| 266 | - } else { |
|
| 264 | + }else if (is_numeric($key)) { |
|
| 265 | + if (!in_array($value, $base)) $base[] = $value; |
|
| 266 | + }else { |
|
| 267 | 267 | $base[$key] = $value; |
| 268 | 268 | } |
| 269 | 269 | |