@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | throw new AuthFailedException($message); |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - if(!$this->stream) { |
|
| 92 | + if (!$this->stream) { |
|
| 93 | 93 | $errors = \imap_errors(); |
| 94 | 94 | $message = implode("; ", (is_array($errors) ? $errors : array())); |
| 95 | 95 | throw new AuthFailedException($message); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | if (!$this->cert_validation) { |
| 121 | 121 | $address .= '/novalidate-cert'; |
| 122 | 122 | } |
| 123 | - if (in_array($this->encryption,['tls', 'notls', 'ssl'])) { |
|
| 123 | + if (in_array($this->encryption, ['tls', 'notls', 'ssl'])) { |
|
| 124 | 124 | $address .= '/'.$this->encryption; |
| 125 | 125 | } elseif ($this->encryption === "starttls") { |
| 126 | 126 | $address .= '/tls'; |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | * |
| 150 | 150 | * @return bool |
| 151 | 151 | */ |
| 152 | - public function connected(){ |
|
| 152 | + public function connected() { |
|
| 153 | 153 | return boolval($this->stream); |
| 154 | 154 | } |
| 155 | 155 | |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | * |
| 222 | 222 | * @return array |
| 223 | 223 | */ |
| 224 | - public function headers($uids, $rfc = "RFC822", $uid = false){ |
|
| 224 | + public function headers($uids, $rfc = "RFC822", $uid = false) { |
|
| 225 | 225 | $result = []; |
| 226 | 226 | $uids = is_array($uids) ? $uids : [$uids]; |
| 227 | 227 | foreach ($uids as $id) { |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | * |
| 238 | 238 | * @return array |
| 239 | 239 | */ |
| 240 | - public function flags($uids, $uid = false){ |
|
| 240 | + public function flags($uids, $uid = false) { |
|
| 241 | 241 | $result = []; |
| 242 | 242 | $uids = is_array($uids) ? $uids : [$uids]; |
| 243 | 243 | foreach ($uids as $id) { |
@@ -245,8 +245,8 @@ discard block |
||
| 245 | 245 | $flags = []; |
| 246 | 246 | if (is_array($raw_flags) && isset($raw_flags[0])) { |
| 247 | 247 | $raw_flags = (array) $raw_flags[0]; |
| 248 | - foreach($raw_flags as $flag => $value) { |
|
| 249 | - if ($value === 1 && in_array($flag, ["size", "uid", "msgno", "update"]) === false){ |
|
| 248 | + foreach ($raw_flags as $flag => $value) { |
|
| 249 | + if ($value === 1 && in_array($flag, ["size", "uid", "msgno", "update"]) === false) { |
|
| 250 | 250 | $flags[] = "\\".ucfirst($flag); |
| 251 | 251 | } |
| 252 | 252 | } |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | if ($id === null) { |
| 268 | 268 | $overview = $this->overview("1:*"); |
| 269 | 269 | $uids = []; |
| 270 | - foreach($overview as $set){ |
|
| 270 | + foreach ($overview as $set) { |
|
| 271 | 271 | $uids[$set->msgno] = $set->uid; |
| 272 | 272 | } |
| 273 | 273 | return $uids; |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | * @return array |
| 294 | 294 | */ |
| 295 | 295 | public function overview($sequence, $uid = false) { |
| 296 | - return \imap_fetch_overview($this->stream, $sequence,$uid ? IMAP::FT_UID : IMAP::NIL); |
|
| 296 | + return \imap_fetch_overview($this->stream, $sequence, $uid ? IMAP::FT_UID : IMAP::NIL); |
|
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | /** |
@@ -308,12 +308,12 @@ discard block |
||
| 308 | 308 | $result = []; |
| 309 | 309 | |
| 310 | 310 | $items = \imap_getmailboxes($this->stream, $this->getAddress(), $reference.$folder); |
| 311 | - if(is_array($items)){ |
|
| 311 | + if (is_array($items)) { |
|
| 312 | 312 | foreach ($items as $item) { |
| 313 | 313 | $name = $this->decodeFolderName($item->name); |
| 314 | 314 | $result[$name] = ['delimiter' => $item->delimiter, 'flags' => []]; |
| 315 | 315 | } |
| 316 | - }else{ |
|
| 316 | + }else { |
|
| 317 | 317 | throw new RuntimeException(\imap_last_error()); |
| 318 | 318 | } |
| 319 | 319 | |
@@ -335,9 +335,9 @@ discard block |
||
| 335 | 335 | public function store(array $flags, $from, $to = null, $mode = null, $silent = true, $uid = false) { |
| 336 | 336 | $flag = trim(is_array($flags) ? implode(" ", $flags) : $flags); |
| 337 | 337 | |
| 338 | - if ($mode == "+"){ |
|
| 338 | + if ($mode == "+") { |
|
| 339 | 339 | $status = \imap_setflag_full($this->stream, $from, $flag, $uid ? IMAP::FT_UID : IMAP::NIL); |
| 340 | - }else{ |
|
| 340 | + }else { |
|
| 341 | 341 | $status = \imap_clearflag_full($this->stream, $from, $flag, $uid ? IMAP::FT_UID : IMAP::NIL); |
| 342 | 342 | } |
| 343 | 343 | |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | */ |
| 360 | 360 | public function appendMessage($folder, $message, $flags = null, $date = null) { |
| 361 | 361 | if ($date != null) { |
| 362 | - if ($date instanceof \Carbon\Carbon){ |
|
| 362 | + if ($date instanceof \Carbon\Carbon) { |
|
| 363 | 363 | $date = $date->format('d-M-Y H:i:s O'); |
| 364 | 364 | } |
| 365 | 365 | return \imap_append($this->stream, $folder, $message, $flags, $date); |
@@ -496,14 +496,14 @@ discard block |
||
| 496 | 496 | /** |
| 497 | 497 | * Enable the debug mode |
| 498 | 498 | */ |
| 499 | - public function enableDebug(){ |
|
| 499 | + public function enableDebug() { |
|
| 500 | 500 | $this->debug = true; |
| 501 | 501 | } |
| 502 | 502 | |
| 503 | 503 | /** |
| 504 | 504 | * Disable the debug mode |
| 505 | 505 | */ |
| 506 | - public function disableDebug(){ |
|
| 506 | + public function disableDebug() { |
|
| 507 | 507 | $this->debug = false; |
| 508 | 508 | } |
| 509 | 509 | |