@@ -93,8 +93,7 @@ discard block |
||
93 | 93 | { |
94 | 94 | self::_errorLog(sprintf("printing uri %s, job %s: ",$uri,$this->last_job) |
95 | 95 | .$this->serveroutput->status,3); |
96 | - } |
|
97 | - else |
|
96 | + } else |
|
98 | 97 | { |
99 | 98 | $this->jobs = array_merge($this->jobs,array("")); |
100 | 99 | $this->jobs_uri = array_merge($this->jobs_uri,array("")); |
@@ -130,8 +129,7 @@ discard block |
||
130 | 129 | if (array_key_exists(0,$this->available_printers)) |
131 | 130 | { |
132 | 131 | self::setPrinterURI($this->available_printers[0]); |
133 | - } |
|
134 | - else |
|
132 | + } else |
|
135 | 133 | { |
136 | 134 | trigger_error(_("purgeJobs: Printer URI is not set: die"),E_USER_WARNING); |
137 | 135 | self::_putDebug( _("purgeJobs: Printer URI is not set: die\n")); |
@@ -193,8 +191,7 @@ discard block |
||
193 | 191 | { |
194 | 192 | self::_errorLog(sprintf(_("purging jobs of %s: "),$this->printer_uri) |
195 | 193 | .$this->serveroutput->status,3); |
196 | - } |
|
197 | - else |
|
194 | + } else |
|
198 | 195 | { |
199 | 196 | self::_errorLog(sprintf(_("purging jobs of %s: "),$this->printer_uri) |
200 | 197 | .$this->serveroutput->status,1); |
@@ -228,8 +225,7 @@ discard block |
||
228 | 225 | if (array_key_exists(0,$this->available_printers)) |
229 | 226 | { |
230 | 227 | self::setPrinterURI($this->available_printers[0]); |
231 | - } |
|
232 | - else |
|
228 | + } else |
|
233 | 229 | { |
234 | 230 | trigger_error(_("createJob: Printer URI is not set: die"),E_USER_WARNING); |
235 | 231 | self::_putDebug( _("createJob: Printer URI is not set: die\n")); |
@@ -278,8 +274,7 @@ discard block |
||
278 | 274 | if (is_readable($this->data)) |
279 | 275 | { |
280 | 276 | self::setJobName(basename($this->data),true); |
281 | - } |
|
282 | - else |
|
277 | + } else |
|
283 | 278 | { |
284 | 279 | self::setJobName(); |
285 | 280 | } |
@@ -341,8 +336,7 @@ discard block |
||
341 | 336 | $this->_getJobId(); |
342 | 337 | $this->_getJobUri(); |
343 | 338 | $this->_parseJobAttributes(); |
344 | - } |
|
345 | - else |
|
339 | + } else |
|
346 | 340 | { |
347 | 341 | $this->jobs = array_merge($this->jobs,array('')); |
348 | 342 | $this->jobs_uri = array_merge($this->jobs_uri,array('')); |
@@ -357,8 +351,7 @@ discard block |
||
357 | 351 | { |
358 | 352 | self::_errorLog(sprintf(_("Create job: job %s"),$this->last_job) |
359 | 353 | .$this->serveroutput->status,3); |
360 | - } |
|
361 | - else |
|
354 | + } else |
|
362 | 355 | { |
363 | 356 | |
364 | 357 | $this->jobs = array_merge($this->jobs,array("")); |
@@ -407,8 +400,7 @@ discard block |
||
407 | 400 | { |
408 | 401 | $post_values = array_merge($post_values,array("Filetype"=>"TEXT")); |
409 | 402 | } |
410 | - } |
|
411 | - else |
|
403 | + } else |
|
412 | 404 | { |
413 | 405 | self::_putDebug( _("sending DATA as document\n")); |
414 | 406 | |
@@ -430,8 +422,7 @@ discard block |
||
430 | 422 | //$this->_getPrinterUri(); |
431 | 423 | $this->_getJobUri(); |
432 | 424 | $this->_parseJobAttributes(); |
433 | - } |
|
434 | - else |
|
425 | + } else |
|
435 | 426 | { |
436 | 427 | $this->jobs = array_merge($this->jobs,array($job)); |
437 | 428 | $this->jobs_uri = array_merge($this->jobs_uri,array($job)); |
@@ -445,8 +436,7 @@ discard block |
||
445 | 436 | if ($this->serveroutput->status == "successfull-ok") |
446 | 437 | { |
447 | 438 | self::_errorLog(sprintf("sending document, job %s: %s",$job,$this->serveroutput->status),3); |
448 | - } |
|
449 | - else |
|
439 | + } else |
|
450 | 440 | { |
451 | 441 | $this->jobs = array_merge($this->jobs,array("")); |
452 | 442 | $this->jobs_uri = array_merge($this->jobs_uri,array("")); |
@@ -488,8 +478,7 @@ discard block |
||
488 | 478 | //$this->_getPrinterUri(); |
489 | 479 | $this->_getJobUri(); |
490 | 480 | $this->_parseJobAttributes(); |
491 | - } |
|
492 | - else |
|
481 | + } else |
|
493 | 482 | { |
494 | 483 | $this->jobs = array_merge($this->jobs,array($job)); |
495 | 484 | $this->jobs_uri = array_merge($this->jobs_uri,array($job)); |
@@ -505,8 +494,7 @@ discard block |
||
505 | 494 | if ($this->serveroutput->status == "successfull-ok") |
506 | 495 | { |
507 | 496 | self::_errorLog(sprintf("sending uri %s, job %s: %s",$uri,$job,$this->serveroutput->status),3); |
508 | - } |
|
509 | - else |
|
497 | + } else |
|
510 | 498 | { |
511 | 499 | $this->jobs = array_merge($this->jobs,array("")); |
512 | 500 | $this->jobs_uri = array_merge($this->jobs_uri,array("")); |
@@ -543,8 +531,7 @@ discard block |
||
543 | 531 | if (array_key_exists(0,$this->available_printers)) |
544 | 532 | { |
545 | 533 | self::setPrinterURI($this->available_printers[0]); |
546 | - } |
|
547 | - else |
|
534 | + } else |
|
548 | 535 | { |
549 | 536 | trigger_error(_("pausePrinter: Printer URI is not set: die"),E_USER_WARNING); |
550 | 537 | self::_putDebug( _("pausePrinter: Printer URI is not set: die\n")); |
@@ -606,8 +593,7 @@ discard block |
||
606 | 593 | { |
607 | 594 | self::_errorLog(sprintf(_("Pause printer %s: "),$this->printer_uri) |
608 | 595 | .$this->serveroutput->status,3); |
609 | - } |
|
610 | - else |
|
596 | + } else |
|
611 | 597 | { |
612 | 598 | self::_errorLog(sprintf(_("pause printer %s: "),$this->printer_uri) |
613 | 599 | .$this->serveroutput->status,1); |
@@ -645,8 +631,7 @@ discard block |
||
645 | 631 | if (array_key_exists(0,$this->available_printers)) |
646 | 632 | { |
647 | 633 | self::setPrinterURI($this->available_printers[0]); |
648 | - } |
|
649 | - else |
|
634 | + } else |
|
650 | 635 | { |
651 | 636 | trigger_error(_("resumePrinter: Printer URI is not set: die"),E_USER_WARNING); |
652 | 637 | self::_putDebug( _("resumePrinter: Printer URI is not set: die\n")); |
@@ -703,8 +688,7 @@ discard block |
||
703 | 688 | { |
704 | 689 | self::_errorLog(sprintf(_("resume printer %s: "),$this->printer_uri) |
705 | 690 | .$this->serveroutput->status,3); |
706 | - } |
|
707 | - else |
|
691 | + } else |
|
708 | 692 | { |
709 | 693 | self::_errorLog(sprintf(_("resume printer %s: "),$this->printer_uri) |
710 | 694 | .$this->serveroutput->status,1); |
@@ -758,8 +742,7 @@ discard block |
||
758 | 742 | if (in_array($until,$until_strings)) |
759 | 743 | { |
760 | 744 | true; |
761 | - } |
|
762 | - else |
|
745 | + } else |
|
763 | 746 | { |
764 | 747 | $until = 'indefinite'; |
765 | 748 | } |
@@ -805,8 +788,7 @@ discard block |
||
805 | 788 | { |
806 | 789 | self::_errorLog(sprintf(_("hold job %s until %s: "),$job_uri,$until) |
807 | 790 | .$this->serveroutput->status,3); |
808 | - } |
|
809 | - else |
|
791 | + } else |
|
810 | 792 | { |
811 | 793 | self::_errorLog(sprintf(_("hold job %s until %s: "),$job_uri,$until) |
812 | 794 | .$this->serveroutput->status,1); |
@@ -889,8 +871,7 @@ discard block |
||
889 | 871 | { |
890 | 872 | self::_errorLog(sprintf(_("release job %s: "),$job_uri) |
891 | 873 | .$this->serveroutput->status,3); |
892 | - } |
|
893 | - else |
|
874 | + } else |
|
894 | 875 | { |
895 | 876 | self::_errorLog(sprintf(_("release job %s: "),$job_uri) |
896 | 877 | .$this->serveroutput->status,1); |
@@ -980,8 +961,7 @@ discard block |
||
980 | 961 | { |
981 | 962 | self::_errorLog(sprintf(_("release job %s: "),$job_uri) |
982 | 963 | .$this->serveroutput->status,3); |
983 | - } |
|
984 | - else |
|
964 | + } else |
|
985 | 965 | { |
986 | 966 | self::_errorLog(sprintf(_("release job %s: "),$job_uri) |
987 | 967 | .$this->serveroutput->status,1); |
@@ -1099,8 +1079,7 @@ discard block |
||
1099 | 1079 | { |
1100 | 1080 | self::_errorLog(sprintf(_("set job attributes for job %s: "),$job_uri) |
1101 | 1081 | .$this->serveroutput->status,3); |
1102 | - } |
|
1103 | - else |
|
1082 | + } else |
|
1104 | 1083 | { |
1105 | 1084 | self::_errorLog(sprintf(_("set job attributes for job %s: "),$job_uri) |
1106 | 1085 | .$this->serveroutput->status,1); |
@@ -1245,8 +1224,7 @@ discard block |
||
1245 | 1224 | { |
1246 | 1225 | self::_errorLog(sprintf(_("set printer attributes for printer %s: "),$this->printer_uri) |
1247 | 1226 | .$this->serveroutput->status,3); |
1248 | - } |
|
1249 | - else |
|
1227 | + } else |
|
1250 | 1228 | { |
1251 | 1229 | self::_errorLog(sprintf(_("set printer attributes for printer %s: "),$this->printer_uri) |
1252 | 1230 | .$this->serveroutput->status,1); |
@@ -1301,8 +1279,7 @@ discard block |
||
1301 | 1279 | if (array_key_exists(0,$this->available_printers)) |
1302 | 1280 | { |
1303 | 1281 | self::setPrinterURI($this->available_printers[0]); |
1304 | - } |
|
1305 | - else |
|
1282 | + } else |
|
1306 | 1283 | { |
1307 | 1284 | trigger_error(_("_stringUri: Printer URI is not set: die"),E_USER_WARNING); |
1308 | 1285 | self::_putDebug( _("_stringUri: Printer URI is not set: die\n")); |
@@ -1347,8 +1324,7 @@ discard block |
||
1347 | 1324 | if (is_readable($this->data)) |
1348 | 1325 | { |
1349 | 1326 | self::setJobName(basename($this->data),true); |
1350 | - } |
|
1351 | - else |
|
1327 | + } else |
|
1352 | 1328 | { |
1353 | 1329 | self::setJobName(); |
1354 | 1330 | } |
@@ -1423,8 +1399,7 @@ discard block |
||
1423 | 1399 | if ($is_last == false) |
1424 | 1400 | { |
1425 | 1401 | $is_last = chr(0x00); |
1426 | - } |
|
1427 | - else |
|
1402 | + } else |
|
1428 | 1403 | { |
1429 | 1404 | $is_last = chr(0x01); |
1430 | 1405 | } |
@@ -1448,8 +1423,7 @@ discard block |
||
1448 | 1423 | if (array_key_exists(0,$this->available_printers)) |
1449 | 1424 | { |
1450 | 1425 | self::setPrinterURI($this->available_printers[0]); |
1451 | - } |
|
1452 | - else |
|
1426 | + } else |
|
1453 | 1427 | { |
1454 | 1428 | trigger_error(_("_stringJob: Printer URI is not set: die"),E_USER_WARNING); |
1455 | 1429 | self::_putDebug( _("_stringJob: Printer URI is not set: die\n")); |
@@ -1549,8 +1523,7 @@ discard block |
||
1549 | 1523 | if ($is_last == false) |
1550 | 1524 | { |
1551 | 1525 | $is_last = chr(0x00); |
1552 | - } |
|
1553 | - else |
|
1526 | + } else |
|
1554 | 1527 | { |
1555 | 1528 | $is_last = chr(0x01); |
1556 | 1529 | } |
@@ -1574,8 +1547,7 @@ discard block |
||
1574 | 1547 | if (array_key_exists(0,$this->available_printers)) |
1575 | 1548 | { |
1576 | 1549 | self::setPrinterURI($this->available_printers[0]); |
1577 | - } |
|
1578 | - else |
|
1550 | + } else |
|
1579 | 1551 | { |
1580 | 1552 | trigger_error(_("_stringJob: Printer URI is not set: die"),E_USER_WARNING); |
1581 | 1553 | self::_putDebug( _("_stringJob: Printer URI is not set: die\n")); |
@@ -198,8 +198,7 @@ discard block |
||
198 | 198 | $CurrentBlock = $Block; |
199 | 199 | |
200 | 200 | continue; |
201 | - } |
|
202 | - else |
|
201 | + } else |
|
203 | 202 | { |
204 | 203 | if ($this->isBlockCompletable($CurrentBlock['type'])) |
205 | 204 | { |
@@ -258,8 +257,7 @@ discard block |
||
258 | 257 | if (isset($CurrentBlock) and ! isset($CurrentBlock['type']) and ! isset($CurrentBlock['interrupted'])) |
259 | 258 | { |
260 | 259 | $CurrentBlock['element']['text'] .= "\n".$text; |
261 | - } |
|
262 | - else |
|
260 | + } else |
|
263 | 261 | { |
264 | 262 | $Blocks []= $CurrentBlock; |
265 | 263 | |
@@ -764,8 +762,7 @@ discard block |
||
764 | 762 | |
765 | 763 | $Block['void'] = true; |
766 | 764 | } |
767 | - } |
|
768 | - else |
|
765 | + } else |
|
769 | 766 | { |
770 | 767 | if (isset($matches[2]) or in_array($matches[1], $this->voidElements)) |
771 | 768 | { |
@@ -789,18 +786,21 @@ discard block |
||
789 | 786 | return; |
790 | 787 | } |
791 | 788 | |
792 | - if (preg_match('/^<'.$Block['name'].'(?:[ ]*'.$this->regexHtmlAttribute.')*[ ]*>/i', $Line['text'])) # open |
|
789 | + if (preg_match('/^<'.$Block['name'].'(?:[ ]*'.$this->regexHtmlAttribute.')*[ ]*>/i', $Line['text'])) { |
|
790 | + # open |
|
793 | 791 | { |
794 | 792 | $Block['depth'] ++; |
795 | 793 | } |
794 | + } |
|
796 | 795 | |
797 | - if (preg_match('/(.*?)<\/'.$Block['name'].'>[ ]*$/i', $Line['text'], $matches)) # close |
|
796 | + if (preg_match('/(.*?)<\/'.$Block['name'].'>[ ]*$/i', $Line['text'], $matches)) { |
|
797 | + # close |
|
798 | 798 | { |
799 | 799 | if ($Block['depth'] > 0) |
800 | 800 | { |
801 | 801 | $Block['depth'] --; |
802 | - } |
|
803 | - else |
|
802 | + } |
|
803 | + } else |
|
804 | 804 | { |
805 | 805 | $Block['closed'] = true; |
806 | 806 | } |
@@ -1190,12 +1190,10 @@ discard block |
||
1190 | 1190 | if ($Excerpt['text'][1] === $marker and preg_match($this->StrongRegex[$marker], $Excerpt['text'], $matches)) |
1191 | 1191 | { |
1192 | 1192 | $emphasis = 'strong'; |
1193 | - } |
|
1194 | - elseif (preg_match($this->EmRegex[$marker], $Excerpt['text'], $matches)) |
|
1193 | + } elseif (preg_match($this->EmRegex[$marker], $Excerpt['text'], $matches)) |
|
1195 | 1194 | { |
1196 | 1195 | $emphasis = 'em'; |
1197 | - } |
|
1198 | - else |
|
1196 | + } else |
|
1199 | 1197 | { |
1200 | 1198 | return; |
1201 | 1199 | } |
@@ -1279,8 +1277,7 @@ discard block |
||
1279 | 1277 | $extent += strlen($matches[0]); |
1280 | 1278 | |
1281 | 1279 | $remainder = substr($remainder, $extent); |
1282 | - } |
|
1283 | - else |
|
1280 | + } else |
|
1284 | 1281 | { |
1285 | 1282 | return; |
1286 | 1283 | } |
@@ -1295,8 +1292,7 @@ discard block |
||
1295 | 1292 | } |
1296 | 1293 | |
1297 | 1294 | $extent += strlen($matches[0]); |
1298 | - } |
|
1299 | - else |
|
1295 | + } else |
|
1300 | 1296 | { |
1301 | 1297 | if (preg_match('/^\s*\[(.*?)\]/', $remainder, $matches)) |
1302 | 1298 | { |
@@ -1304,8 +1300,7 @@ discard block |
||
1304 | 1300 | $definition = strtolower($definition); |
1305 | 1301 | |
1306 | 1302 | $extent += strlen($matches[0]); |
1307 | - } |
|
1308 | - else |
|
1303 | + } else |
|
1309 | 1304 | { |
1310 | 1305 | $definition = strtolower($Element['text']); |
1311 | 1306 | } |
@@ -1453,8 +1448,7 @@ discard block |
||
1453 | 1448 | if ($this->breaksEnabled) |
1454 | 1449 | { |
1455 | 1450 | $text = preg_replace('/[ ]*\n/', "<br />\n", $text); |
1456 | - } |
|
1457 | - else |
|
1451 | + } else |
|
1458 | 1452 | { |
1459 | 1453 | $text = preg_replace('/(?:[ ][ ]+|[ ]*\\\\)\n/', "<br />\n", $text); |
1460 | 1454 | $text = str_replace(" \n", "\n", $text); |
@@ -1516,19 +1510,16 @@ discard block |
||
1516 | 1510 | if (isset($Element['handler'])) |
1517 | 1511 | { |
1518 | 1512 | $markup .= $this->{$Element['handler']}($text, $Element['nonNestables']); |
1519 | - } |
|
1520 | - elseif (!$permitRawHtml) |
|
1513 | + } elseif (!$permitRawHtml) |
|
1521 | 1514 | { |
1522 | 1515 | $markup .= self::escape($text, true); |
1523 | - } |
|
1524 | - else |
|
1516 | + } else |
|
1525 | 1517 | { |
1526 | 1518 | $markup .= $text; |
1527 | 1519 | } |
1528 | 1520 | |
1529 | 1521 | $markup .= '</'.$Element['name'].'>'; |
1530 | - } |
|
1531 | - else |
|
1522 | + } else |
|
1532 | 1523 | { |
1533 | 1524 | $markup .= ' />'; |
1534 | 1525 | } |
@@ -1646,8 +1637,7 @@ discard block |
||
1646 | 1637 | if ($len > strlen($string)) |
1647 | 1638 | { |
1648 | 1639 | return false; |
1649 | - } |
|
1650 | - else |
|
1640 | + } else |
|
1651 | 1641 | { |
1652 | 1642 | return strtolower(substr($string, 0, $len)) === strtolower($needle); |
1653 | 1643 | } |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | $value = $this->default_account_config[$key]; |
208 | 208 | if(isset($config[$key])) { |
209 | 209 | $value = $config[$key]; |
210 | - }elseif(isset($default_config[$key])) { |
|
210 | + } elseif(isset($default_config[$key])) { |
|
211 | 211 | $value = $default_config[$key]; |
212 | 212 | } |
213 | 213 | $this->$key = $value; |
@@ -239,39 +239,39 @@ discard block |
||
239 | 239 | if(isset($config['masks']['message'])) { |
240 | 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{ |
|
245 | + } else{ |
|
246 | 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 | 252 | if(isset($config['masks']['attachment'])) { |
253 | 253 | if(class_exists($config['masks']['attachment'])) { |
254 | 254 | $this->default_attachment_mask = $config['masks']['attachment']; |
255 | - }else{ |
|
255 | + } else{ |
|
256 | 256 | throw new MaskNotFoundException("Unknown mask provided: ".$config['masks']['attachment']); |
257 | 257 | } |
258 | - }else{ |
|
258 | + } else{ |
|
259 | 259 | if(class_exists($default_config['attachment'])) { |
260 | 260 | $this->default_attachment_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{ |
|
265 | + } else{ |
|
266 | 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 | 272 | if(class_exists($default_config['attachment'])) { |
273 | 273 | $this->default_attachment_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 - no imap function", 0, new ProtocolNotSupportedException($protocol." is an unsupported protocol")); |
341 | 341 | } |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | } |
477 | 477 | |
478 | 478 | return $folders; |
479 | - }else{ |
|
479 | + } else{ |
|
480 | 480 | throw new FolderFetchingException("failed to fetch any folders"); |
481 | 481 | } |
482 | 482 | } |
@@ -514,7 +514,9 @@ discard block |
||
514 | 514 | $this->checkConnection(); |
515 | 515 | $status = $this->connection->createFolder($folder); |
516 | 516 | |
517 | - if($expunge) $this->expunge(); |
|
517 | + if($expunge) { |
|
518 | + $this->expunge(); |
|
519 | + } |
|
518 | 520 | |
519 | 521 | $folder = $this->getFolder($folder); |
520 | 522 | if($status && $folder) { |
@@ -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"); |
@@ -310,7 +312,9 @@ discard block |
||
310 | 312 | */ |
311 | 313 | public function delete($expunge = true) { |
312 | 314 | $status = $this->client->getConnection()->deleteFolder($this->path); |
313 | - if($expunge) $this->client->expunge(); |
|
315 | + if($expunge) { |
|
316 | + $this->client->expunge(); |
|
317 | + } |
|
314 | 318 | |
315 | 319 | $event = $this->getEvent("folder", "deleted"); |
316 | 320 | $event::dispatch($this); |
@@ -384,7 +388,7 @@ discard block |
||
384 | 388 | |
385 | 389 | $connection->idle(); |
386 | 390 | } |
387 | - }catch (Exceptions\RuntimeException $e) { |
|
391 | + } catch (Exceptions\RuntimeException $e) { |
|
388 | 392 | if(strpos($e->getMessage(), "connection closed") === false) { |
389 | 393 | throw $e; |
390 | 394 | } |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | $name = $this->decodeFolderName($item->name); |
324 | 324 | $result[$name] = ['delimiter' => $item->delimiter, 'flags' => []]; |
325 | 325 | } |
326 | - }else{ |
|
326 | + } else{ |
|
327 | 327 | throw new RuntimeException(\imap_last_error()); |
328 | 328 | } |
329 | 329 | |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | |
348 | 348 | if ($mode == "+"){ |
349 | 349 | $status = \imap_setflag_full($this->stream, $from, $flag, $uid ? IMAP::FT_UID : IMAP::NIL); |
350 | - }else{ |
|
350 | + } else{ |
|
351 | 351 | $status = \imap_clearflag_full($this->stream, $from, $flag, $uid ? IMAP::FT_UID : IMAP::NIL); |
352 | 352 | } |
353 | 353 |
@@ -72,7 +72,7 @@ |
||
72 | 72 | // so add them back in manually if we can |
73 | 73 | if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) { |
74 | 74 | $cryptoMethod = STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; |
75 | - }elseif (defined('STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT')) { |
|
75 | + } elseif (defined('STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT')) { |
|
76 | 76 | $cryptoMethod = STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT; |
77 | 77 | } |
78 | 78 |
@@ -237,7 +237,9 @@ discard block |
||
237 | 237 | } else { |
238 | 238 | $tokens = $line; |
239 | 239 | } |
240 | - if ($this->debug) echo "<< ".$line."\n"; |
|
240 | + if ($this->debug) { |
|
241 | + echo "<< ".$line."\n"; |
|
242 | + } |
|
241 | 243 | |
242 | 244 | // if tag is wanted tag we might be at the end of a multiline response |
243 | 245 | return $tag == $wantedTag; |
@@ -303,7 +305,9 @@ discard block |
||
303 | 305 | $line .= ' ' . $token; |
304 | 306 | } |
305 | 307 | } |
306 | - if ($this->debug) echo ">> ".$line."\n"; |
|
308 | + if ($this->debug) { |
|
309 | + echo ">> ".$line."\n"; |
|
310 | + } |
|
307 | 311 | |
308 | 312 | if (fwrite($this->stream, $line . "\r\n") === false) { |
309 | 313 | throw new RuntimeException('failed to write - connection closed?'); |
@@ -453,7 +457,9 @@ discard block |
||
453 | 457 | public function getCapabilities() { |
454 | 458 | $response = $this->requestAndResponse('CAPABILITY'); |
455 | 459 | |
456 | - if (!$response) return []; |
|
460 | + if (!$response) { |
|
461 | + return []; |
|
462 | + } |
|
457 | 463 | |
458 | 464 | $capabilities = []; |
459 | 465 | foreach ($response as $line) { |
@@ -610,13 +616,14 @@ discard block |
||
610 | 616 | // if we want only one message we can ignore everything else and just return |
611 | 617 | if ($to === null && !is_array($from) && ($uid ? $tokens[2][$uidKey] == $from : $tokens[0] == $from)) { |
612 | 618 | // we still need to read all lines |
613 | - while (!$this->readLine($tokens, $tag)) |
|
614 | - |
|
619 | + while (!$this->readLine($tokens, $tag)) { |
|
620 | + |
|
615 | 621 | return $data; |
622 | + } |
|
616 | 623 | } |
617 | 624 | if ($uid) { |
618 | 625 | $result[$tokens[2][$uidKey]] = $data; |
619 | - }else{ |
|
626 | + } else{ |
|
620 | 627 | $result[$tokens[0]] = $data; |
621 | 628 | } |
622 | 629 | } |
@@ -86,7 +86,9 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public function toDate(){ |
88 | 88 | $date = $this->first(); |
89 | - if ($date instanceof Carbon) return $date; |
|
89 | + if ($date instanceof Carbon) { |
|
90 | + return $date; |
|
91 | + } |
|
90 | 92 | |
91 | 93 | return Carbon::parse($date); |
92 | 94 | } |
@@ -146,7 +148,7 @@ discard block |
||
146 | 148 | public function add($value, $strict = false) { |
147 | 149 | if (is_array($value)) { |
148 | 150 | return $this->merge($value, $strict); |
149 | - }elseif ($value !== null) { |
|
151 | + } elseif ($value !== null) { |
|
150 | 152 | $this->attach($value, $strict); |
151 | 153 | } |
152 | 154 | |
@@ -195,7 +197,7 @@ discard block |
||
195 | 197 | if ($this->contains($value) === false) { |
196 | 198 | $this->values[] = $value; |
197 | 199 | } |
198 | - }else{ |
|
200 | + } else{ |
|
199 | 201 | $this->values[] = $value; |
200 | 202 | } |
201 | 203 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | } |
129 | 129 | |
130 | 130 | return null; |
131 | - }elseif (strtolower(substr($method, 0, 3)) === 'set') { |
|
131 | + } elseif (strtolower(substr($method, 0, 3)) === 'set') { |
|
132 | 132 | $name = Str::snake(substr($method, 3)); |
133 | 133 | |
134 | 134 | $this->attributes[$name] = array_pop($arguments); |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | $this->setName($filename); |
223 | 223 | } elseif (($name = $this->part->name) !== null) { |
224 | 224 | $this->setName($name); |
225 | - }else { |
|
225 | + } else { |
|
226 | 226 | $this->setName("undefined"); |
227 | 227 | } |
228 | 228 | |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | if ($name !== null) { |
258 | 258 | if($decoder === 'utf-8' && extension_loaded('imap')) { |
259 | 259 | $this->name = \imap_utf8($name); |
260 | - }else{ |
|
260 | + } else{ |
|
261 | 261 | $this->name = mb_decode_mimeheader($name); |
262 | 262 | } |
263 | 263 | } |