@@ -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'; |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | * |
| 149 | 149 | * @return bool |
| 150 | 150 | */ |
| 151 | - public function connected(){ |
|
| 151 | + public function connected() { |
|
| 152 | 152 | return !$this->stream; |
| 153 | 153 | } |
| 154 | 154 | |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | * |
| 221 | 221 | * @return array |
| 222 | 222 | */ |
| 223 | - public function headers($uids, $rfc = "RFC822", $uid = false){ |
|
| 223 | + public function headers($uids, $rfc = "RFC822", $uid = false) { |
|
| 224 | 224 | $result = []; |
| 225 | 225 | $uids = is_array($uids) ? $uids : [$uids]; |
| 226 | 226 | foreach ($uids as $id) { |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | * |
| 237 | 237 | * @return array |
| 238 | 238 | */ |
| 239 | - public function flags($uids, $uid = false){ |
|
| 239 | + public function flags($uids, $uid = false) { |
|
| 240 | 240 | $result = []; |
| 241 | 241 | $uids = is_array($uids) ? $uids : [$uids]; |
| 242 | 242 | foreach ($uids as $id) { |
@@ -244,8 +244,8 @@ discard block |
||
| 244 | 244 | $flags = []; |
| 245 | 245 | if (is_array($raw_flags) && isset($raw_flags[0])) { |
| 246 | 246 | $raw_flags = (array) $raw_flags[0]; |
| 247 | - foreach($raw_flags as $flag => $value) { |
|
| 248 | - if ($value === 1 && in_array($flag, ["size", "uid", "msgno", "update"]) === false){ |
|
| 247 | + foreach ($raw_flags as $flag => $value) { |
|
| 248 | + if ($value === 1 && in_array($flag, ["size", "uid", "msgno", "update"]) === false) { |
|
| 249 | 249 | $flags[] = "\\".ucfirst($flag); |
| 250 | 250 | } |
| 251 | 251 | } |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | if ($id === null) { |
| 267 | 267 | $overview = $this->overview("1:*"); |
| 268 | 268 | $uids = []; |
| 269 | - foreach($overview as $set){ |
|
| 269 | + foreach ($overview as $set) { |
|
| 270 | 270 | $uids[$set->msgno] = $set->uid; |
| 271 | 271 | } |
| 272 | 272 | return $uids; |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | * @return array |
| 293 | 293 | */ |
| 294 | 294 | public function overview($sequence, $uid = false) { |
| 295 | - return \imap_fetch_overview($this->stream, $sequence,$uid ? IMAP::FT_UID : IMAP::NIL); |
|
| 295 | + return \imap_fetch_overview($this->stream, $sequence, $uid ? IMAP::FT_UID : IMAP::NIL); |
|
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | /** |
@@ -307,12 +307,12 @@ discard block |
||
| 307 | 307 | $result = []; |
| 308 | 308 | |
| 309 | 309 | $items = \imap_getmailboxes($this->stream, $this->getAddress(), $reference.$folder); |
| 310 | - if(is_array($items)){ |
|
| 310 | + if (is_array($items)) { |
|
| 311 | 311 | foreach ($items as $item) { |
| 312 | 312 | $name = $this->decodeFolderName($item->name); |
| 313 | 313 | $result[$name] = ['delimiter' => $item->delimiter, 'flags' => []]; |
| 314 | 314 | } |
| 315 | - }else{ |
|
| 315 | + }else { |
|
| 316 | 316 | throw new RuntimeException(\imap_last_error()); |
| 317 | 317 | } |
| 318 | 318 | |
@@ -334,9 +334,9 @@ discard block |
||
| 334 | 334 | public function store(array $flags, $from, $to = null, $mode = null, $silent = true, $uid = false) { |
| 335 | 335 | $flag = trim(is_array($flags) ? implode(" ", $flags) : $flags); |
| 336 | 336 | |
| 337 | - if ($mode == "+"){ |
|
| 337 | + if ($mode == "+") { |
|
| 338 | 338 | $status = \imap_setflag_full($this->stream, $from, $flag, $uid ? IMAP::FT_UID : IMAP::NIL); |
| 339 | - }else{ |
|
| 339 | + }else { |
|
| 340 | 340 | $status = \imap_clearflag_full($this->stream, $from, $flag, $uid ? IMAP::FT_UID : IMAP::NIL); |
| 341 | 341 | } |
| 342 | 342 | |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | */ |
| 359 | 359 | public function appendMessage($folder, $message, $flags = null, $date = null) { |
| 360 | 360 | if ($date != null) { |
| 361 | - if ($date instanceof \Carbon\Carbon){ |
|
| 361 | + if ($date instanceof \Carbon\Carbon) { |
|
| 362 | 362 | $date = $date->format('d-M-Y H:i:s O'); |
| 363 | 363 | } |
| 364 | 364 | return \imap_append($this->stream, $folder, $message, $flags, $date); |
@@ -495,14 +495,14 @@ discard block |
||
| 495 | 495 | /** |
| 496 | 496 | * Enable the debug mode |
| 497 | 497 | */ |
| 498 | - public function enableDebug(){ |
|
| 498 | + public function enableDebug() { |
|
| 499 | 499 | $this->debug = true; |
| 500 | 500 | } |
| 501 | 501 | |
| 502 | 502 | /** |
| 503 | 503 | * Disable the debug mode |
| 504 | 504 | */ |
| 505 | - public function disableDebug(){ |
|
| 505 | + public function disableDebug() { |
|
| 506 | 506 | $this->debug = false; |
| 507 | 507 | } |
| 508 | 508 | |