@@ -201,11 +201,11 @@ discard block |
||
201 | 201 | * @param array $config |
202 | 202 | * @param array $default_config |
203 | 203 | */ |
204 | - private function setAccountConfig($key, $config, $default_config){ |
|
204 | + private function setAccountConfig($key, $config, $default_config) { |
|
205 | 205 | $value = $this->default_account_config[$key]; |
206 | - if(isset($config[$key])) { |
|
206 | + if (isset($config[$key])) { |
|
207 | 207 | $value = $config[$key]; |
208 | - }elseif(isset($default_config[$key])) { |
|
208 | + }elseif (isset($default_config[$key])) { |
|
209 | 209 | $value = $default_config[$key]; |
210 | 210 | } |
211 | 211 | $this->$key = $value; |
@@ -217,9 +217,9 @@ discard block |
||
217 | 217 | */ |
218 | 218 | protected function setEventsFromConfig($config) { |
219 | 219 | $this->events = ClientManager::get("events"); |
220 | - if(isset($config['events'])){ |
|
221 | - if(isset($config['events'])) { |
|
222 | - foreach($config['events'] as $section => $events) { |
|
220 | + if (isset($config['events'])) { |
|
221 | + if (isset($config['events'])) { |
|
222 | + foreach ($config['events'] as $section => $events) { |
|
223 | 223 | $this->events[$section] = array_merge($this->events[$section], $events); |
224 | 224 | } |
225 | 225 | } |
@@ -233,45 +233,45 @@ discard block |
||
233 | 233 | * @throws MaskNotFoundException |
234 | 234 | */ |
235 | 235 | protected function setMaskFromConfig($config) { |
236 | - $default_config = ClientManager::get("masks"); |
|
236 | + $default_config = ClientManager::get("masks"); |
|
237 | 237 | |
238 | - if(isset($config['masks'])){ |
|
239 | - if(isset($config['masks']['message'])) { |
|
240 | - if(class_exists($config['masks']['message'])) { |
|
238 | + if (isset($config['masks'])) { |
|
239 | + if (isset($config['masks']['message'])) { |
|
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{ |
|
246 | - if(class_exists($default_config['message'])) { |
|
245 | + }else { |
|
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 | - if(isset($config['masks']['attachment'])) { |
|
253 | - if(class_exists($config['masks']['attachment'])) { |
|
252 | + if (isset($config['masks']['attachment'])) { |
|
253 | + if (class_exists($config['masks']['attachment'])) { |
|
254 | 254 | $this->default_message_mask = $config['masks']['attachment']; |
255 | - }else{ |
|
255 | + }else { |
|
256 | 256 | throw new MaskNotFoundException("Unknown mask provided: ".$config['masks']['attachment']); |
257 | 257 | } |
258 | - }else{ |
|
259 | - if(class_exists($default_config['attachment'])) { |
|
258 | + }else { |
|
259 | + if (class_exists($default_config['attachment'])) { |
|
260 | 260 | $this->default_message_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{ |
|
266 | - if(class_exists($default_config['message'])) { |
|
265 | + }else { |
|
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 | - if(class_exists($default_config['attachment'])) { |
|
272 | + if (class_exists($default_config['attachment'])) { |
|
273 | 273 | $this->default_message_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 | } |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | $pattern = $parent_folder.($hierarchical ? '%' : '*'); |
459 | 459 | $items = $this->connection->folders('', $pattern); |
460 | 460 | |
461 | - if(is_array($items)){ |
|
461 | + if (is_array($items)) { |
|
462 | 462 | foreach ($items as $folder_name => $item) { |
463 | 463 | $folder = new Folder($this, $folder_name, $item["delimiter"], $item["flags"]); |
464 | 464 | |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | } |
474 | 474 | |
475 | 475 | return $folders; |
476 | - }else{ |
|
476 | + }else { |
|
477 | 477 | throw new FolderFetchingException("failed to fetch any folders"); |
478 | 478 | } |
479 | 479 | } |
@@ -511,10 +511,10 @@ discard block |
||
511 | 511 | $this->checkConnection(); |
512 | 512 | $status = $this->connection->createFolder($folder); |
513 | 513 | |
514 | - if($expunge) $this->expunge(); |
|
514 | + if ($expunge) $this->expunge(); |
|
515 | 515 | |
516 | 516 | $folder = $this->getFolder($folder); |
517 | - if($status && $folder) { |
|
517 | + if ($status && $folder) { |
|
518 | 518 | $event = $this->getEvent("folder", "new"); |
519 | 519 | $event::dispatch($folder); |
520 | 520 | } |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | * |
541 | 541 | * @return Folder |
542 | 542 | */ |
543 | - public function getFolderPath(){ |
|
543 | + public function getFolderPath() { |
|
544 | 544 | return $this->active_folder; |
545 | 545 | } |
546 | 546 | |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | * |
597 | 597 | * @return int |
598 | 598 | */ |
599 | - public function getTimeout($type){ |
|
599 | + public function getTimeout($type) { |
|
600 | 600 | return $this->connection->getConnectionTimeout(); |
601 | 601 | } |
602 | 602 | |
@@ -605,7 +605,7 @@ discard block |
||
605 | 605 | * |
606 | 606 | * @return string |
607 | 607 | */ |
608 | - public function getDefaultMessageMask(){ |
|
608 | + public function getDefaultMessageMask() { |
|
609 | 609 | return $this->default_message_mask; |
610 | 610 | } |
611 | 611 | |
@@ -615,7 +615,7 @@ discard block |
||
615 | 615 | * |
616 | 616 | * @return array |
617 | 617 | */ |
618 | - public function getDefaultEvents($section){ |
|
618 | + public function getDefaultEvents($section) { |
|
619 | 619 | return $this->events[$section]; |
620 | 620 | } |
621 | 621 | |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | * @throws MaskNotFoundException |
628 | 628 | */ |
629 | 629 | public function setDefaultMessageMask($mask) { |
630 | - if(class_exists($mask)) { |
|
630 | + if (class_exists($mask)) { |
|
631 | 631 | $this->default_message_mask = $mask; |
632 | 632 | |
633 | 633 | return $this; |
@@ -641,7 +641,7 @@ discard block |
||
641 | 641 | * |
642 | 642 | * @return string |
643 | 643 | */ |
644 | - public function getDefaultAttachmentMask(){ |
|
644 | + public function getDefaultAttachmentMask() { |
|
645 | 645 | return $this->default_attachment_mask; |
646 | 646 | } |
647 | 647 | |
@@ -653,7 +653,7 @@ discard block |
||
653 | 653 | * @throws MaskNotFoundException |
654 | 654 | */ |
655 | 655 | public function setDefaultAttachmentMask($mask) { |
656 | - if(class_exists($mask)) { |
|
656 | + if (class_exists($mask)) { |
|
657 | 657 | $this->default_attachment_mask = $mask; |
658 | 658 | |
659 | 659 | return $this; |
@@ -82,10 +82,10 @@ discard block |
||
82 | 82 | * @throws MethodNotFoundException |
83 | 83 | */ |
84 | 84 | public function __call($method, $arguments) { |
85 | - if(strtolower(substr($method, 0, 3)) === 'get') { |
|
85 | + if (strtolower(substr($method, 0, 3)) === 'get') { |
|
86 | 86 | $name = preg_replace('/(.)(?=[A-Z])/u', '$1_', substr(strtolower($method), 3)); |
87 | 87 | |
88 | - if(in_array($name, array_keys($this->attributes))) { |
|
88 | + if (in_array($name, array_keys($this->attributes))) { |
|
89 | 89 | return $this->attributes[$name]; |
90 | 90 | } |
91 | 91 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | * @return Attribute|mixed |
112 | 112 | */ |
113 | 113 | public function get($name) { |
114 | - if(isset($this->attributes[$name])) { |
|
114 | + if (isset($this->attributes[$name])) { |
|
115 | 115 | return $this->attributes[$name]; |
116 | 116 | } |
117 | 117 | |
@@ -127,23 +127,23 @@ discard block |
||
127 | 127 | * @return Attribute |
128 | 128 | */ |
129 | 129 | public function set($name, $value, $strict = false) { |
130 | - if(isset($this->attributes[$name]) && $strict === false) { |
|
130 | + if (isset($this->attributes[$name]) && $strict === false) { |
|
131 | 131 | if ($this->attributize) { |
132 | 132 | $this->attributes[$name]->add($value, true); |
133 | - }else{ |
|
134 | - if(isset($this->attributes[$name])) { |
|
133 | + }else { |
|
134 | + if (isset($this->attributes[$name])) { |
|
135 | 135 | if (is_array($this->attributes[$name]) == false) { |
136 | 136 | $this->attributes[$name] = [$this->attributes[$name], $value]; |
137 | - }else{ |
|
137 | + }else { |
|
138 | 138 | $this->attributes[$name][] = $value; |
139 | 139 | } |
140 | - }else{ |
|
140 | + }else { |
|
141 | 141 | $this->attributes[$name] = $value; |
142 | 142 | } |
143 | 143 | } |
144 | - }elseif($this->attributize == false){ |
|
144 | + }elseif ($this->attributize == false) { |
|
145 | 145 | $this->attributes[$name] = $value; |
146 | - }else{ |
|
146 | + }else { |
|
147 | 147 | $this->attributes[$name] = new Attribute($name, $value); |
148 | 148 | } |
149 | 149 | |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | public function find($pattern) { |
160 | 160 | if (preg_match_all($pattern, $this->raw, $matches)) { |
161 | 161 | if (isset($matches[1])) { |
162 | - if(count($matches[1]) > 0) { |
|
162 | + if (count($matches[1]) > 0) { |
|
163 | 163 | return $matches[1][0]; |
164 | 164 | } |
165 | 165 | } |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | * |
173 | 173 | * @throws InvalidMessageDateException |
174 | 174 | */ |
175 | - protected function parse(){ |
|
175 | + protected function parse() { |
|
176 | 176 | $header = $this->rfc822_parse_headers($this->raw); |
177 | 177 | |
178 | 178 | $this->extractAddresses($header); |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | $this->parseDate($header); |
191 | 191 | foreach ($header as $key => $value) { |
192 | 192 | $key = trim(rtrim(strtolower($key))); |
193 | - if(!isset($this->attributes[$key])){ |
|
193 | + if (!isset($this->attributes[$key])) { |
|
194 | 194 | $this->set($key, $value); |
195 | 195 | } |
196 | 196 | } |
@@ -206,12 +206,12 @@ discard block |
||
206 | 206 | * |
207 | 207 | * @return object |
208 | 208 | */ |
209 | - public function rfc822_parse_headers($raw_headers){ |
|
209 | + public function rfc822_parse_headers($raw_headers) { |
|
210 | 210 | $headers = []; |
211 | 211 | $imap_headers = []; |
212 | 212 | if (extension_loaded('imap')) { |
213 | 213 | $raw_imap_headers = (array) \imap_rfc822_parse_headers($this->raw); |
214 | - foreach($raw_imap_headers as $key => $values) { |
|
214 | + foreach ($raw_imap_headers as $key => $values) { |
|
215 | 215 | $key = str_replace("-", "_", $key); |
216 | 216 | $imap_headers[$key] = $values; |
217 | 217 | } |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | |
220 | 220 | $lines = explode("\r\n", $raw_headers); |
221 | 221 | $prev_header = null; |
222 | - foreach($lines as $line) { |
|
222 | + foreach ($lines as $line) { |
|
223 | 223 | if (substr($line, 0, 1) === "\n") { |
224 | 224 | $line = substr($line, 1); |
225 | 225 | } |
@@ -239,19 +239,19 @@ discard block |
||
239 | 239 | } |
240 | 240 | if (is_array($headers[$prev_header])) { |
241 | 241 | $headers[$prev_header][] = $line; |
242 | - }else{ |
|
242 | + }else { |
|
243 | 243 | $headers[$prev_header] .= $line; |
244 | 244 | } |
245 | 245 | } |
246 | - }else{ |
|
246 | + }else { |
|
247 | 247 | if (($pos = strpos($line, ":")) > 0) { |
248 | 248 | $key = trim(rtrim(strtolower(substr($line, 0, $pos)))); |
249 | 249 | $key = str_replace("-", "_", $key); |
250 | 250 | |
251 | 251 | $value = trim(rtrim(substr($line, $pos + 1))); |
252 | 252 | if (isset($headers[$key])) { |
253 | - $headers[$key][] = $value; |
|
254 | - }else{ |
|
253 | + $headers[$key][] = $value; |
|
254 | + }else { |
|
255 | 255 | $headers[$key] = [$value]; |
256 | 256 | } |
257 | 257 | $prev_header = $key; |
@@ -259,10 +259,10 @@ discard block |
||
259 | 259 | } |
260 | 260 | } |
261 | 261 | |
262 | - foreach($headers as $key => $values) { |
|
262 | + foreach ($headers as $key => $values) { |
|
263 | 263 | if (isset($imap_headers[$key])) continue; |
264 | 264 | $value = null; |
265 | - switch($key){ |
|
265 | + switch ($key) { |
|
266 | 266 | case 'from': |
267 | 267 | case 'to': |
268 | 268 | case 'cc': |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | break; |
278 | 278 | default: |
279 | 279 | if (is_array($values)) { |
280 | - foreach($values as $k => $v) { |
|
280 | + foreach ($values as $k => $v) { |
|
281 | 281 | if ($v == "") { |
282 | 282 | unset($values[$k]); |
283 | 283 | } |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | $value = implode(" ", $values); |
290 | 290 | } elseif ($available_values > 2) { |
291 | 291 | $value = array_values($values); |
292 | - } else { |
|
292 | + }else { |
|
293 | 293 | $value = ""; |
294 | 294 | } |
295 | 295 | } |
@@ -309,12 +309,12 @@ discard block |
||
309 | 309 | * @return array The decoded elements are returned in an array of objects, where each |
310 | 310 | * object has two properties, charset and text. |
311 | 311 | */ |
312 | - public function mime_header_decode($text){ |
|
312 | + public function mime_header_decode($text) { |
|
313 | 313 | if (extension_loaded('imap')) { |
314 | 314 | return \imap_mime_header_decode($text); |
315 | 315 | } |
316 | 316 | $charset = $this->getEncoding($text); |
317 | - return [(object)[ |
|
317 | + return [(object) [ |
|
318 | 318 | "charset" => $charset, |
319 | 319 | "text" => $this->convertEncoding($text, $charset) |
320 | 320 | ]]; |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | try { |
369 | 369 | if (function_exists('iconv') && $from != 'UTF-7' && $to != 'UTF-7') { |
370 | 370 | return iconv($from, $to, $str); |
371 | - } else { |
|
371 | + }else { |
|
372 | 372 | if (!$from) { |
373 | 373 | return mb_convert_encoding($str, $to); |
374 | 374 | } |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | if (strstr($from, '-')) { |
379 | 379 | $from = str_replace('-', '', $from); |
380 | 380 | return $this->convertEncoding($str, $from, $to); |
381 | - } else { |
|
381 | + }else { |
|
382 | 382 | return $str; |
383 | 383 | } |
384 | 384 | } |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | } |
400 | 400 | }elseif (property_exists($structure, 'charset')) { |
401 | 401 | return EncodingAliases::get($structure->charset, $this->fallback_encoding); |
402 | - }elseif (is_string($structure) === true){ |
|
402 | + }elseif (is_string($structure) === true) { |
|
403 | 403 | return mb_detect_encoding($structure); |
404 | 404 | } |
405 | 405 | |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | if ($value !== null) { |
433 | 433 | $is_utf8_base = $this->is_uft8($value); |
434 | 434 | |
435 | - if($decoder === 'utf-8' && extension_loaded('imap')) { |
|
435 | + if ($decoder === 'utf-8' && extension_loaded('imap')) { |
|
436 | 436 | $value = \imap_utf8($value); |
437 | 437 | $is_utf8_base = $this->is_uft8($value); |
438 | 438 | if ($is_utf8_base) { |
@@ -441,14 +441,14 @@ discard block |
||
441 | 441 | if ($this->notDecoded($original_value, $value)) { |
442 | 442 | $decoded_value = $this->mime_header_decode($value); |
443 | 443 | if (count($decoded_value) > 0) { |
444 | - if(property_exists($decoded_value[0], "text")) { |
|
444 | + if (property_exists($decoded_value[0], "text")) { |
|
445 | 445 | $value = $decoded_value[0]->text; |
446 | 446 | } |
447 | 447 | } |
448 | 448 | } |
449 | - }elseif($decoder === 'iconv' && $is_utf8_base) { |
|
449 | + }elseif ($decoder === 'iconv' && $is_utf8_base) { |
|
450 | 450 | $value = iconv_mime_decode($value); |
451 | - }elseif($is_utf8_base){ |
|
451 | + }elseif ($is_utf8_base) { |
|
452 | 452 | $value = mb_decode_mimeheader($value); |
453 | 453 | } |
454 | 454 | |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | * @return array |
472 | 472 | */ |
473 | 473 | private function decodeArray($values) { |
474 | - foreach($values as $key => $value) { |
|
474 | + foreach ($values as $key => $value) { |
|
475 | 475 | $values[$key] = $this->decode($value); |
476 | 476 | } |
477 | 477 | return $values; |
@@ -481,8 +481,8 @@ discard block |
||
481 | 481 | * Try to extract the priority from a given raw header string |
482 | 482 | */ |
483 | 483 | private function findPriority() { |
484 | - if(($priority = $this->get("x_priority")) === null) return; |
|
485 | - switch((int)"$priority"){ |
|
484 | + if (($priority = $this->get("x_priority")) === null) return; |
|
485 | + switch ((int) "$priority") { |
|
486 | 486 | case IMAP::MESSAGE_PRIORITY_HIGHEST; |
487 | 487 | $priority = IMAP::MESSAGE_PRIORITY_HIGHEST; |
488 | 488 | break; |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | */ |
515 | 515 | private function decodeAddresses($values) { |
516 | 516 | $addresses = []; |
517 | - foreach($values as $address) { |
|
517 | + foreach ($values as $address) { |
|
518 | 518 | $address = trim(rtrim($address)); |
519 | 519 | if (strpos($address, ",") == strlen($address) - 1) { |
520 | 520 | $address = substr($address, 0, -1); |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | '/^(?:(?P<name>.+)\s)?(?(name)<|<?)(?P<email>[^\s]+?)(?(name)>|>?)$/', |
524 | 524 | $address, |
525 | 525 | $matches |
526 | - )){ |
|
526 | + )) { |
|
527 | 527 | $name = trim(rtrim($matches["name"])); |
528 | 528 | $email = trim(rtrim($matches["email"])); |
529 | 529 | list($mailbox, $host) = array_pad(explode("@", $email), 2, null); |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | * @param object $header |
543 | 543 | */ |
544 | 544 | private function extractAddresses($header) { |
545 | - foreach(['from', 'to', 'cc', 'bcc', 'reply_to', 'sender'] as $key){ |
|
545 | + foreach (['from', 'to', 'cc', 'bcc', 'reply_to', 'sender'] as $key) { |
|
546 | 546 | if (property_exists($header, $key)) { |
547 | 547 | $this->set($key, $this->parseAddresses($header->$key)); |
548 | 548 | } |
@@ -573,10 +573,10 @@ discard block |
||
573 | 573 | } |
574 | 574 | if (!property_exists($address, 'personal')) { |
575 | 575 | $address->personal = false; |
576 | - } else { |
|
576 | + }else { |
|
577 | 577 | $personalParts = $this->mime_header_decode($address->personal); |
578 | 578 | |
579 | - if(is_array($personalParts)) { |
|
579 | + if (is_array($personalParts)) { |
|
580 | 580 | $address->personal = ''; |
581 | 581 | foreach ($personalParts as $p) { |
582 | 582 | $address->personal .= $this->convertEncoding($p->text, $this->getEncoding($p)); |
@@ -600,23 +600,23 @@ discard block |
||
600 | 600 | /** |
601 | 601 | * Search and extract potential header extensions |
602 | 602 | */ |
603 | - private function extractHeaderExtensions(){ |
|
603 | + private function extractHeaderExtensions() { |
|
604 | 604 | foreach ($this->attributes as $key => $value) { |
605 | 605 | if (is_array($value)) { |
606 | 606 | $value = implode(", ", $value); |
607 | - }else{ |
|
608 | - $value = (string)$value; |
|
607 | + }else { |
|
608 | + $value = (string) $value; |
|
609 | 609 | } |
610 | 610 | // Only parse strings and don't parse any attributes like the user-agent |
611 | 611 | if (in_array($key, ["user_agent"]) === false) { |
612 | - if (($pos = strpos($value, ";")) !== false){ |
|
612 | + if (($pos = strpos($value, ";")) !== false) { |
|
613 | 613 | $original = substr($value, 0, $pos); |
614 | 614 | $this->set($key, trim(rtrim($original)), true); |
615 | 615 | |
616 | 616 | // Get all potential extensions |
617 | 617 | $extensions = explode(";", substr($value, $pos + 1)); |
618 | - foreach($extensions as $extension) { |
|
619 | - if (($pos = strpos($extension, "=")) !== false){ |
|
618 | + foreach ($extensions as $extension) { |
|
619 | + if (($pos = strpos($extension, "=")) !== false) { |
|
620 | 620 | $key = substr($extension, 0, $pos); |
621 | 621 | $key = trim(rtrim(strtolower($key))); |
622 | 622 | |
@@ -659,7 +659,7 @@ discard block |
||
659 | 659 | $parsed_date = null; |
660 | 660 | $date = $header->date; |
661 | 661 | |
662 | - if(preg_match('/\+0580/', $date)) { |
|
662 | + if (preg_match('/\+0580/', $date)) { |
|
663 | 663 | $date = str_replace('+0580', '+0530', $date); |
664 | 664 | } |
665 | 665 | |
@@ -682,7 +682,7 @@ discard block |
||
682 | 682 | $date = trim(array_pop($array)); |
683 | 683 | break; |
684 | 684 | } |
685 | - try{ |
|
685 | + try { |
|
686 | 686 | $parsed_date = Carbon::parse($date); |
687 | 687 | } catch (\Exception $_e) { |
688 | 688 | throw new InvalidMessageDateException("Invalid message date. ID:".$this->get("message_id"), 1100, $e); |