Passed
Branch master (fa6b77)
by Mike
02:30
created
class.freebusy.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,8 +44,7 @@
 block discarded – undo
44 44
 
45 45
 		try {
46 46
 			return mapi_msgstore_openentry($store, $localFreeBusyEntryids[self::DELEGATE_PROPERTIES]);
47
-		}
48
-		catch (MAPIException $e) {
47
+		} catch (MAPIException $e) {
49 48
 			// Either user store have malformed entryid in PR_FREEBUSY_ENTRYIDS or
50 49
 			// No message found of given entryid in 'Freebusy Data' folder.
51 50
 			if ($e->getCode() == MAPI_E_NOT_FOUND || $e->getCode() == MAPI_E_INVALID_ENTRYID) {
Please login to merge, or discard this patch.
class.taskrequest.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -291,8 +291,7 @@  discard block
 block discarded – undo
291 291
 			$props = mapi_getprops($this->message, $senderProps);
292 292
 			$props[PR_MESSAGE_CLASS] = 'IPM.Task';
293 293
 			mapi_setprops($task, $props);
294
-		}
295
-		else {
294
+		} else {
296 295
 			// If there are multiple, just use the first
297 296
 			$entryid = $rows[0][PR_ENTRYID];
298 297
 
@@ -613,8 +612,7 @@  discard block
 block discarded – undo
613 612
 
614 613
 		if (isset($messageprops)) {
615 614
 			++$messageprops[$this->props['updatecount']];
616
-		}
617
-		else {
615
+		} else {
618 616
 			$messageprops[$this->props['updatecount']] = 1;
619 617
 		}
620 618
 
@@ -797,8 +795,7 @@  discard block
 block discarded – undo
797 795
 		$props = mapi_getprops($this->message, [$this->props['taskupdates'], $this->props['tasksoc'], $this->props['recurring'], $this->props['complete']]);
798 796
 		if (!$props[$this->props['complete']] && $props[$this->props['taskupdates']] && !(isset($props[$this->props['recurring']]) && $props[$this->props['recurring']])) {
799 797
 			$this->sendResponse(tdmtTaskUpd, _("Task Updated:") . " ");
800
-		}
801
-		elseif ($props[$this->props['complete']]) {
798
+		} elseif ($props[$this->props['complete']]) {
802 799
 			$this->sendResponse(tdmtTaskUpd, _("Task Completed:") . " ");
803 800
 		}
804 801
 
@@ -821,8 +818,7 @@  discard block
 block discarded – undo
821 818
 
822 819
 		if (!$ownerentryid) {
823 820
 			$store = $this->store;
824
-		}
825
-		else {
821
+		} else {
826 822
 			$ab = mapi_openaddressbook($this->session);
827 823
 			if (!$ab) {
828 824
 				return false;
@@ -964,8 +960,7 @@  discard block
 block discarded – undo
964 960
 				mapi_setprops($sub, [PR_ICON_INDEX => ICON_TASK_ASSIGNER]);
965 961
 				if ($messageprops[$this->props['complete']]) {
966 962
 					$props[PR_MESSAGE_CLASS] = "IPM.TaskRequest.Complete";
967
-				}
968
-				else {
963
+				} else {
969 964
 					$props[PR_MESSAGE_CLASS] = "IPM.TaskRequest.Update";
970 965
 				}
971 966
 
@@ -1049,8 +1044,7 @@  discard block
 block discarded – undo
1049 1044
 			try {
1050 1045
 				$attach = mapi_message_openattach($this->message, $row[PR_ATTACH_NUM]);
1051 1046
 				$task = mapi_attach_openobj($attach);
1052
-			}
1053
-			catch (MAPIException $e) {
1047
+			} catch (MAPIException $e) {
1054 1048
 				continue;
1055 1049
 			}
1056 1050
 
Please login to merge, or discard this patch.
class.recurrence.php 1 patch
Braces   +28 added lines, -56 removed lines patch added patch discarded remove patch
@@ -51,8 +51,7 @@  discard block
 block discarded – undo
51 51
 	public function __construct($store, $message, $proptags = []) {
52 52
 		if (!empty($proptags)) {
53 53
 			$this->proptags = $proptags;
54
-		}
55
-		else {
54
+		} else {
56 55
 			$properties = [];
57 56
 			$properties["entryid"] = PR_ENTRYID;
58 57
 			$properties["parent_entryid"] = PR_PARENT_ENTRYID;
@@ -192,8 +191,7 @@  discard block
 block discarded – undo
192 191
 
193 192
 			// Add the changed occurrence to the list
194 193
 			array_push($this->recur["changed_occurrences"], $changed_item);
195
-		}
196
-		else {
194
+		} else {
197 195
 			// Delete the occurrence by placing it in the deleted occurrences list
198 196
 			array_push($this->recur["deleted_occurrences"], $baseday);
199 197
 		}
@@ -290,12 +288,10 @@  discard block
 block discarded – undo
290 288
 			if ($copy_attach_from) {
291 289
 				$this->deleteExceptionAttachment($base_date);
292 290
 				$this->createException($exception_props, $base_date, false, $exception_recips, $copy_attach_from);
293
-			}
294
-			else {
291
+			} else {
295 292
 				$this->createExceptionAttachment($exception_props, $exception_recips, $copy_attach_from);
296 293
 			}
297
-		}
298
-		else {
294
+		} else {
299 295
 			$message = mapi_attach_openobj($attach, MAPI_MODIFY);
300 296
 
301 297
 			// Set exception properties on embedded message and save
@@ -339,8 +335,7 @@  discard block
 block discarded – undo
339 335
 			// the exception used to be.
340 336
 			$oldexception = $this->getChangeException($basedate);
341 337
 			$prevday = $this->dayStartOf($oldexception["start"]);
342
-		}
343
-		else {
338
+		} else {
344 339
 			// If its a new exception, we want to look at the original placement of this item.
345 340
 			$prevday = $basedate;
346 341
 		}
@@ -350,8 +345,7 @@  discard block
 block discarded – undo
350 345
 		// Get all the occurrences on the days between the basedate (may be reversed)
351 346
 		if ($prevday < $startday) {
352 347
 			$items = $this->getItems($this->toGMT($this->tz, $prevday), $this->toGMT($this->tz, $startday + 24 * 60 * 60));
353
-		}
354
-		else {
348
+		} else {
355 349
 			$items = $this->getItems($this->toGMT($this->tz, $startday), $this->toGMT($this->tz, $prevday + 24 * 60 * 60));
356 350
 		}
357 351
 
@@ -538,12 +532,10 @@  discard block
 block discarded – undo
538 532
 				if ($everyn == 1) {
539 533
 					$type = dgettext('zarafa', 'workday');
540 534
 					$occSingleDayRank = true;
541
-				}
542
-				elseif ($everyn == (24 * 60)) {
535
+				} elseif ($everyn == (24 * 60)) {
543 536
 					$type = dgettext('zarafa', 'day');
544 537
 					$occSingleDayRank = true;
545
-				}
546
-				else {
538
+				} else {
547 539
 					$everyn /= (24 * 60);
548 540
 					$type = dgettext('zarafa', 'days');
549 541
 					$occSingleDayRank = false;
@@ -554,8 +546,7 @@  discard block
 block discarded – undo
554 546
 				if ($everyn == 1) {
555 547
 					$type = dgettext('zarafa', 'week');
556 548
 					$occSingleDayRank = true;
557
-				}
558
-				else {
549
+				} else {
559 550
 					$type = dgettext('zarafa', 'weeks');
560 551
 					$occSingleDayRank = false;
561 552
 				}
@@ -565,8 +556,7 @@  discard block
 block discarded – undo
565 556
 				if ($everyn == 1) {
566 557
 					$type = dgettext('zarafa', 'month');
567 558
 					$occSingleDayRank = true;
568
-				}
569
-				else {
559
+				} else {
570 560
 					$type = dgettext('zarafa', 'months');
571 561
 					$occSingleDayRank = false;
572 562
 				}
@@ -577,8 +567,7 @@  discard block
 block discarded – undo
577 567
 					$everyn = 1;
578 568
 					$type = dgettext('zarafa', 'year');
579 569
 					$occSingleDayRank = true;
580
-				}
581
-				else {
570
+				} else {
582 571
 					$everyn = $everyn / 12;
583 572
 					$type = dgettext('zarafa', 'years');
584 573
 					$occSingleDayRank = false;
@@ -607,21 +596,17 @@  discard block
 block discarded – undo
607 596
 			if ($occTimeRange) {
608 597
 				if ($occSingleDayRank) {
609 598
 					$pattern = sprintf(dgettext('zarafa', 'Occurs every %s effective %s from %s to %s.'), $type, $start, $startocc, $endocc);
610
-				}
611
-				else {
599
+				} else {
612 600
 					$pattern = sprintf(dgettext('zarafa', 'Occurs every %s %s effective %s from %s to %s.'), $everyn, $type, $start, $startocc, $endocc);
613 601
 				}
614
-			}
615
-			else {
602
+			} else {
616 603
 				if ($occSingleDayRank) {
617 604
 					$pattern = sprintf(dgettext('zarafa', 'Occurs every %s effective %s.'), $type, $start);
618
-				}
619
-				else {
605
+				} else {
620 606
 					$pattern = sprintf(dgettext('zarafa', 'Occurs every %s %s effective %s.'), $everyn, $type, $start);
621 607
 				}
622 608
 			}
623
-		}
624
-		elseif ($term == 0x22) {
609
+		} elseif ($term == 0x22) {
625 610
 			// After a number of times
626 611
 			if ($occTimeRange) {
627 612
 				if ($occSingleDayRank) {
@@ -631,8 +616,7 @@  discard block
 block discarded – undo
631 616
 						'Occurs every %s effective %s for %s occurrences from %s to %s.',
632 617
 						$numocc
633 618
 					), $type, $start, $numocc, $startocc, $endocc);
634
-				}
635
-				else {
619
+				} else {
636 620
 					$pattern = sprintf(dngettext(
637 621
 						'zarafa',
638 622
 						'Occurs every %s %s effective %s for %s occurrence from %s to %s.',
@@ -640,8 +624,7 @@  discard block
 block discarded – undo
640 624
 						$numocc
641 625
 					), $everyn, $type, $start, $numocc, $startocc, $endocc);
642 626
 				}
643
-			}
644
-			else {
627
+			} else {
645 628
 				if ($occSingleDayRank) {
646 629
 					$pattern = sprintf(dngettext(
647 630
 						'zarafa',
@@ -649,8 +632,7 @@  discard block
 block discarded – undo
649 632
 						'Occurs every %s effective %s for %s occurrences.',
650 633
 						$numocc
651 634
 					), $type, $start, $numocc);
652
-				}
653
-				else {
635
+				} else {
654 636
 					$pattern = sprintf(dngettext(
655 637
 						'zarafa',
656 638
 						'Occurs every %s %s effective %s for %s occurrence.',
@@ -659,22 +641,18 @@  discard block
 block discarded – undo
659 641
 					), $everyn, $type, $start, $numocc);
660 642
 				}
661 643
 			}
662
-		}
663
-		elseif ($term == 0x21) {
644
+		} elseif ($term == 0x21) {
664 645
 			// After the given enddate
665 646
 			if ($occTimeRange) {
666 647
 				if ($occSingleDayRank) {
667 648
 					$pattern = sprintf(dgettext('zarafa', 'Occurs every %s effective %s until %s from %s to %s.'), $type, $start, $end, $startocc, $endocc);
668
-				}
669
-				else {
649
+				} else {
670 650
 					$pattern = sprintf(dgettext('zarafa', 'Occurs every %s %s effective %s until %s from %s to %s.'), $everyn, $type, $start, $end, $startocc, $endocc);
671 651
 				}
672
-			}
673
-			else {
652
+			} else {
674 653
 				if ($occSingleDayRank) {
675 654
 					$pattern = sprintf(dgettext('zarafa', 'Occurs every %s effective %s until %s.'), $type, $start, $end);
676
-				}
677
-				else {
655
+				} else {
678 656
 					$pattern = sprintf(dgettext('zarafa', 'Occurs every %s %s effective %s until %s.'), $everyn, $type, $start, $end);
679 657
 				}
680 658
 			}
@@ -709,8 +687,7 @@  discard block
 block discarded – undo
709 687
 		foreach ($this->recur["changed_occurrences"] as $entry) {
710 688
 			if (!$this->isSameDay($entry["basedate"], $base_date)) {
711 689
 				$new[] = $entry;
712
-			}
713
-			else {
690
+			} else {
714 691
 				$this->deleteExceptionAttachment($this->toGMT($this->tz, $base_date + $this->recur["startocc"] * 60));
715 692
 			}
716 693
 		}
@@ -1031,8 +1008,7 @@  discard block
 block discarded – undo
1031 1008
 	public function setExceptionRecipients($message, $exception_recips, $copy_orig_recips = true): void {
1032 1009
 		if (isset($exception_recips['add']) || isset($exception_recips['remove']) || isset($exception_recips['modify'])) {
1033 1010
 			$this->setDeltaExceptionRecipients($message, $exception_recips, $copy_orig_recips);
1034
-		}
1035
-		else {
1011
+		} else {
1036 1012
 			$this->setAllExceptionRecipients($message, $exception_recips);
1037 1013
 		}
1038 1014
 	}
@@ -1073,8 +1049,7 @@  discard block
 block discarded – undo
1073 1049
 			foreach ($exception_recips['remove'] as &$recip) {
1074 1050
 				if (!isset($recip[PR_RECIPIENT_FLAGS]) || $recip[PR_RECIPIENT_FLAGS] != (recipReserved | recipExceptionalDeleted | recipSendable)) {
1075 1051
 					$recip[PR_RECIPIENT_FLAGS] = recipSendable | recipExceptionalDeleted;
1076
-				}
1077
-				else {
1052
+				} else {
1078 1053
 					$recip[PR_RECIPIENT_FLAGS] = recipReserved | recipExceptionalDeleted | recipSendable;
1079 1054
 				}
1080 1055
 				$recip[PR_RECIPIENT_TRACKSTATUS] = olResponseNone;		// No Response required
@@ -1148,8 +1123,7 @@  discard block
 block discarded – undo
1148 1123
 					if (!$foundInDeletedRecipients) {
1149 1124
 						if (!isset($recipient[PR_RECIPIENT_FLAGS]) || $recipient[PR_RECIPIENT_FLAGS] != (recipReserved | recipExceptionalDeleted | recipSendable)) {
1150 1125
 							$recipient[PR_RECIPIENT_FLAGS] = recipSendable | recipExceptionalDeleted;
1151
-						}
1152
-						else {
1126
+						} else {
1153 1127
 							$recipient[PR_RECIPIENT_FLAGS] = recipReserved | recipExceptionalDeleted | recipSendable;
1154 1128
 						}
1155 1129
 						$recipient[PR_RECIPIENT_TRACKSTATUS] = olRecipientTrackStatusNone;	// No Response required
@@ -1168,8 +1142,7 @@  discard block
 block discarded – undo
1168 1142
 				}
1169 1143
 			}
1170 1144
 			$exception_recips = array_merge($exception_recips, $deletedRecipients);
1171
-		}
1172
-		else {
1145
+		} else {
1173 1146
 			$exception_recips = $recipientRows;
1174 1147
 		}
1175 1148
 
@@ -1213,8 +1186,7 @@  discard block
 block discarded – undo
1213 1186
 		foreach ($recipients as $key => $recipient) {
1214 1187
 			if (isset($recipient[PR_RECIPIENT_FLAGS]) && $recipient[PR_RECIPIENT_FLAGS] == (recipSendable | recipOrganizer)) {
1215 1188
 				$hasOrganizer = true;
1216
-			}
1217
-			elseif ($isException && !isset($recipient[PR_RECIPIENT_FLAGS])) {
1189
+			} elseif ($isException && !isset($recipient[PR_RECIPIENT_FLAGS])) {
1218 1190
 				// Recipients for an occurrence
1219 1191
 				$recipients[$key][PR_RECIPIENT_FLAGS] = recipSendable | recipExceptionalResponse;
1220 1192
 			}
Please login to merge, or discard this patch.
mapi.util.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -67,8 +67,7 @@  discard block
 block discarded – undo
67 67
 				}
68 68
 			}
69 69
 		}
70
-	}
71
-	else {
70
+	} else {
72 71
 		return "NOERROR";
73 72
 	}
74 73
 
@@ -109,11 +108,9 @@  discard block
 block discarded – undo
109 108
 
110 109
 			if (substr($split[2], 0, 2) == "0x") {
111 110
 				$id = hexdec(substr($split[2], 2));
112
-			}
113
-			elseif (preg_match('/^[1-9][0-9]{0,12}$/', $split[2])) {
111
+			} elseif (preg_match('/^[1-9][0-9]{0,12}$/', $split[2])) {
114 112
 				$id = (int) $split[2];
115
-			}
116
-			else {
113
+			} else {
117 114
 				$id = $split[2];
118 115
 			}
119 116
 
@@ -123,8 +120,7 @@  discard block
 block discarded – undo
123 120
 					$guids[$split[1]] = makeguid($split[1]);
124 121
 				}
125 122
 				$guid = $guids[$split[1]];
126
-			}
127
-			else {
123
+			} else {
128 124
 				$guid = constant($split[1]);
129 125
 			}
130 126
 
@@ -134,8 +130,7 @@  discard block
 block discarded – undo
134 130
 			$ids["guid"][$num] = $guid;
135 131
 			$ids["type"][$num] = $split[0];
136 132
 			++$num;
137
-		}
138
-		else {
133
+		} else {
139 134
 			// not a named property
140 135
 			$props[$name] = $val;
141 136
 		}
@@ -266,8 +261,7 @@  discard block
 block discarded – undo
266 261
 				$item = $occurrence + $row;
267 262
 				array_push($items, $item);
268 263
 			}
269
-		}
270
-		else {
264
+		} else {
271 265
 			// Normal item, it matched the search criteria and therefore overlaps the interval <$viewstart, $viewend>
272 266
 			array_push($items, $row);
273 267
 		}
Please login to merge, or discard this patch.
class.meetingrequest.php 1 patch
Braces   +70 added lines, -140 removed lines patch added patch discarded remove patch
@@ -339,8 +339,7 @@  discard block
 block discarded – undo
339 339
 		if (isset($messageprops[PR_RCVD_REPRESENTING_ENTRYID])) {
340 340
 			$delegatorStore = $this->getDelegatorStore($messageprops[PR_RCVD_REPRESENTING_ENTRYID], [PR_IPM_APPOINTMENT_ENTRYID]);
341 341
 			$userStore = $delegatorStore['store'];
342
-		}
343
-		else {
342
+		} else {
344 343
 			$userStore = $this->store;
345 344
 		}
346 345
 
@@ -410,8 +409,7 @@  discard block
 block discarded – undo
410 409
 			// Create/modify exception
411 410
 			if ($recurr->isException($basedate)) {
412 411
 				$recurr->modifyException($exception_props, $basedate);
413
-			}
414
-			else {
412
+			} else {
415 413
 				// When we are creating an exception we need copy recipients from main recurring item
416 414
 				$recipTable = mapi_message_getrecipienttable($calendarItem);
417 415
 				$recips = mapi_table_queryallrows($recipTable, $this->recipprops);
@@ -429,8 +427,7 @@  discard block
 block discarded – undo
429 427
 			if ($attach) {
430 428
 				$recurringItem = $calendarItem;
431 429
 				$calendarItem = mapi_attach_openobj($attach, MAPI_MODIFY);
432
-			}
433
-			else {
430
+			} else {
434 431
 				return false;
435 432
 			}
436 433
 		}
@@ -517,8 +514,7 @@  discard block
 block discarded – undo
517 514
 			$props = [];
518 515
 			if ($messageprops[$this->proptags['counter_proposal']]) {
519 516
 				$props[$this->proptags['counter_proposal']] = true;
520
-			}
521
-			else {
517
+			} else {
522 518
 				$props[$this->proptags['counter_proposal']] = false;
523 519
 			}
524 520
 
@@ -573,8 +569,7 @@  discard block
 block discarded – undo
573 569
 			$delegatorStore = $this->getDelegatorStore($messageProps[PR_RCVD_REPRESENTING_ENTRYID], [PR_IPM_APPOINTMENT_ENTRYID]);
574 570
 
575 571
 			$store = $delegatorStore['store'];
576
-		}
577
-		else {
572
+		} else {
578 573
 			$store = $this->store;
579 574
 		}
580 575
 
@@ -601,13 +596,11 @@  discard block
 block discarded – undo
601 596
 
602 597
 					if ($recurr->isException($basedate)) {
603 598
 						$recurr->modifyException($messageProps, $basedate);
604
-					}
605
-					else {
599
+					} else {
606 600
 						$recurr->createException($messageProps, $basedate);
607 601
 					}
608 602
 				}
609
-			}
610
-			else {
603
+			} else {
611 604
 				// set the properties of the cancellation object
612 605
 				mapi_setprops($calendarItem, $messageProps);
613 606
 			}
@@ -661,8 +654,7 @@  discard block
 block discarded – undo
661 654
 
662 655
 			$store = $delegatorStore['store'];
663 656
 			$calFolder = $delegatorStore[PR_IPM_APPOINTMENT_ENTRYID];
664
-		}
665
-		else {
657
+		} else {
666 658
 			$calFolder = $this->openDefaultCalendar();
667 659
 			$store = $this->store;
668 660
 		}
@@ -725,8 +717,7 @@  discard block
 block discarded – undo
725 717
 		$senderEntryId = isset($messageprops[PR_SENT_REPRESENTING_ENTRYID]) ? $messageprops[PR_SENT_REPRESENTING_ENTRYID] : $messageprops[PR_SENDER_ENTRYID];
726 718
 		if (isset($messageprops[PR_RECEIVED_BY_ENTRYID]) && compareEntryIds($senderEntryId, $messageprops[PR_RECEIVED_BY_ENTRYID])) {
727 719
 			$entryid = $this->accept(false, $sendresponse, $move, $proposeNewTimeProps, $body, true, $store, $calFolder, $basedate);
728
-		}
729
-		else {
720
+		} else {
730 721
 			$entryid = $this->accept($tentative, $sendresponse, $move, $proposeNewTimeProps, $body, $userAction, $store, $calFolder, $basedate);
731 722
 		}
732 723
 
@@ -789,8 +780,7 @@  discard block
 block discarded – undo
789 780
 				if (!$calendarItem) {
790 781
 					// Recurring item not found, so create new meeting in Calendar
791 782
 					$calendarItem = mapi_folder_createmessage($calFolder);
792
-				}
793
-				else {
783
+				} else {
794 784
 					// we have found the main recurring item, check if this meeting request is already processed
795 785
 					if (isset($messageprops[PR_PROCESSED]) && $messageprops[PR_PROCESSED] == true) {
796 786
 						// only set required properties, other properties are already copied when processing this meeting request
@@ -812,8 +802,7 @@  discard block
 block discarded – undo
812 802
 					if (isset($props[$this->proptags['reminderminutes']])) {
813 803
 						$props[$this->proptags['flagdueby']] = $props[$this->proptags['startdate']] - ($props[$this->proptags['reminderminutes']] * 60);
814 804
 					}
815
-				}
816
-				else {
805
+				} else {
817 806
 					// only get required properties so we will not overwrite existing updated properties from calendar
818 807
 					$props = mapi_getprops($this->message, [PR_ENTRYID]);
819 808
 				}
@@ -834,13 +823,11 @@  discard block
 block discarded – undo
834 823
 				if (isset($props[$this->proptags['intendedbusystatus']])) {
835 824
 					if ($tentative && $props[$this->proptags['intendedbusystatus']] !== fbFree) {
836 825
 						$props[$this->proptags['busystatus']] = fbTentative;
837
-					}
838
-					else {
826
+					} else {
839 827
 						$props[$this->proptags['busystatus']] = $props[$this->proptags['intendedbusystatus']];
840 828
 					}
841 829
 				// we already have intendedbusystatus value in $props so no need to copy it
842
-				}
843
-				else {
830
+				} else {
844 831
 					$props[$this->proptags['busystatus']] = $tentative ? fbTentative : fbBusy;
845 832
 				}
846 833
 
@@ -903,8 +890,7 @@  discard block
 block discarded – undo
903 890
 				}
904 891
 
905 892
 				$entryid = $props[PR_ENTRYID];
906
-			}
907
-			else {
893
+			} else {
908 894
 				/**
909 895
 				 * This meeting request is not recurring, so can be an exception or normal meeting.
910 896
 				 * If exception then find main recurring item and update exception
@@ -977,13 +963,11 @@  discard block
 block discarded – undo
977 963
 						if (isset($messageprops[$this->proptags['intendedbusystatus']])) {
978 964
 							if ($tentative && $messageprops[$this->proptags['intendedbusystatus']] !== fbFree) {
979 965
 								$calItemProps[$this->proptags['busystatus']] = fbTentative;
980
-							}
981
-							else {
966
+							} else {
982 967
 								$calItemProps[$this->proptags['busystatus']] = $messageprops[$this->proptags['intendedbusystatus']];
983 968
 							}
984 969
 							$calItemProps[$this->proptags['intendedbusystatus']] = $messageprops[$this->proptags['intendedbusystatus']];
985
-						}
986
-						else {
970
+						} else {
987 971
 							$calItemProps[$this->proptags['busystatus']] = $tentative ? fbTentative : fbBusy;
988 972
 						}
989 973
 
@@ -1033,8 +1017,7 @@  discard block
 block discarded – undo
1033 1017
 
1034 1018
 						$messageprops = mapi_getprops($calmsg, [PR_ENTRYID]);
1035 1019
 						$entryid = $messageprops[PR_ENTRYID];
1036
-					}
1037
-					else {
1020
+					} else {
1038 1021
 						// Create a new appointment with duplicate properties and recipient, but as an IPM.Appointment
1039 1022
 						$new = mapi_folder_createmessage($calFolder);
1040 1023
 						$props = mapi_getprops($this->message);
@@ -1080,13 +1063,11 @@  discard block
 block discarded – undo
1080 1063
 						if (isset($props[$this->proptags['intendedbusystatus']])) {
1081 1064
 							if ($tentative && $props[$this->proptags['intendedbusystatus']] !== fbFree) {
1082 1065
 								$props[$this->proptags['busystatus']] = fbTentative;
1083
-							}
1084
-							else {
1066
+							} else {
1085 1067
 								$props[$this->proptags['busystatus']] = $props[$this->proptags['intendedbusystatus']];
1086 1068
 							}
1087 1069
 						// we already have intendedbusystatus value in $props so no need to copy it
1088
-						}
1089
-						else {
1070
+						} else {
1090 1071
 							$props[$this->proptags['busystatus']] = $tentative ? fbTentative : fbBusy;
1091 1072
 						}
1092 1073
 
@@ -1117,8 +1098,7 @@  discard block
 block discarded – undo
1117 1098
 								],
1118 1099
 							];
1119 1100
 							$recips = mapi_table_queryallrows($reciptable, $this->recipprops, $res);
1120
-						}
1121
-						else {
1101
+						} else {
1122 1102
 							$recips = mapi_table_queryallrows($reciptable, $this->recipprops);
1123 1103
 						}
1124 1104
 
@@ -1131,8 +1111,7 @@  discard block
 block discarded – undo
1131 1111
 					}
1132 1112
 				}
1133 1113
 			}
1134
-		}
1135
-		else {
1114
+		} else {
1136 1115
 			// Here only properties are set on calendaritem, because user is responding from calendar.
1137 1116
 			$props = [];
1138 1117
 			$props[$this->proptags['responsestatus']] = $tentative ? olResponseTentative : olResponseAccepted;
@@ -1140,13 +1119,11 @@  discard block
 block discarded – undo
1140 1119
 			if (isset($messageprops[$this->proptags['intendedbusystatus']])) {
1141 1120
 				if ($tentative && $messageprops[$this->proptags['intendedbusystatus']] !== fbFree) {
1142 1121
 					$props[$this->proptags['busystatus']] = fbTentative;
1143
-				}
1144
-				else {
1122
+				} else {
1145 1123
 					$props[$this->proptags['busystatus']] = $messageprops[$this->proptags['intendedbusystatus']];
1146 1124
 				}
1147 1125
 				$props[$this->proptags['intendedbusystatus']] = $messageprops[$this->proptags['intendedbusystatus']];
1148
-			}
1149
-			else {
1126
+			} else {
1150 1127
 				$props[$this->proptags['busystatus']] = $tentative ? fbTentative : fbBusy;
1151 1128
 			}
1152 1129
 
@@ -1169,8 +1146,7 @@  discard block
 block discarded – undo
1169 1146
 
1170 1147
 				if ($recurr->isException($basedate)) {
1171 1148
 					$recurr->modifyException($proposeNewTimeProps + $props, $basedate, $recips);
1172
-				}
1173
-				else {
1149
+				} else {
1174 1150
 					$props[$this->proptags['startdate']] = $recurr->getOccurrenceStart($basedate);
1175 1151
 					$props[$this->proptags['duedate']] = $recurr->getOccurrenceEnd($basedate);
1176 1152
 
@@ -1182,8 +1158,7 @@  discard block
 block discarded – undo
1182 1158
 
1183 1159
 					$recurr->createException($proposeNewTimeProps + $props, $basedate, false, $recips);
1184 1160
 				}
1185
-			}
1186
-			else {
1161
+			} else {
1187 1162
 				mapi_setprops($this->message, $proposeNewTimeProps + $props);
1188 1163
 			}
1189 1164
 			mapi_savechanges($this->message);
@@ -1224,8 +1199,7 @@  discard block
 block discarded – undo
1224 1199
 
1225 1200
 			$store = $delegatorStore['store'];
1226 1201
 			$calFolder = $delegatorStore[PR_IPM_APPOINTMENT_ENTRYID];
1227
-		}
1228
-		else {
1202
+		} else {
1229 1203
 			$calFolder = $this->openDefaultCalendar();
1230 1204
 			$store = $this->store;
1231 1205
 		}
@@ -1319,8 +1293,7 @@  discard block
 block discarded – undo
1319 1293
 
1320 1294
 			$store = $delegatorStore['store'];
1321 1295
 			$calFolder = $delegatorStore[PR_IPM_APPOINTMENT_ENTRYID];
1322
-		}
1323
-		else {
1296
+		} else {
1324 1297
 			$store = $this->store;
1325 1298
 			$calFolder = $this->openDefaultCalendar();
1326 1299
 		}
@@ -1352,8 +1325,7 @@  discard block
 block discarded – undo
1352 1325
 						// exception found, remove it from calendar
1353 1326
 						$this->doRemoveExceptionFromCalendar($basedate, $calendarItem, $store);
1354 1327
 					}
1355
-				}
1356
-				else {
1328
+				} else {
1357 1329
 					// remove normal / recurring series from calendar
1358 1330
 					$entryids = mapi_getprops($calendarItem, [PR_ENTRYID]);
1359 1331
 
@@ -1368,14 +1340,12 @@  discard block
 block discarded – undo
1368 1340
 
1369 1341
 			// Move the cancellation mail to wastebasket
1370 1342
 			mapi_folder_copymessages($sourcefolder, [$messageprops[PR_ENTRYID]], $wastebasket, MESSAGE_MOVE);
1371
-		}
1372
-		else {
1343
+		} else {
1373 1344
 			// Here only properties are set on calendaritem, because user is responding from calendar.
1374 1345
 			if ($basedate) {
1375 1346
 				// remove the occurrence
1376 1347
 				$this->doRemoveExceptionFromCalendar($basedate, $this->message, $store);
1377
-			}
1378
-			else {
1348
+			} else {
1379 1349
 				// remove normal/recurring meeting item.
1380 1350
 				// Move the message to the waste basket
1381 1351
 				mapi_folder_copymessages($sourcefolder, [$messageprops[PR_ENTRYID]], $wastebasket, MESSAGE_MOVE);
@@ -1423,8 +1393,7 @@  discard block
 block discarded – undo
1423 1393
 
1424 1394
 			// save changes in the message
1425 1395
 			mapi_savechanges($this->message);
1426
-		}
1427
-		else {
1396
+		} else {
1428 1397
 			// cancellation of normal meeting request
1429 1398
 			// Send the cancellation
1430 1399
 			$this->updateMeetingRequest();
@@ -1574,8 +1543,7 @@  discard block
 block discarded – undo
1574 1543
 					}
1575 1544
 				}
1576 1545
 			}
1577
-		}
1578
-		else {
1546
+		} else {
1579 1547
 			// Basedate found, an exception is to be sent
1580 1548
 			if ($basedate) {
1581 1549
 				$recurr = new Recurrence($this->openDefaultStore(), $this->message);
@@ -1583,8 +1551,7 @@  discard block
 block discarded – undo
1583 1551
 				if ($cancel) {
1584 1552
 					// @TODO: remove occurrence from Resource's Calendar if resource was booked for whole series
1585 1553
 					$this->submitMeetingRequest($this->message, $cancel, $prefix, $basedate, $recurr, false);
1586
-				}
1587
-				else {
1554
+				} else {
1588 1555
 					$attach = $recurr->getExceptionAttachment($basedate);
1589 1556
 
1590 1557
 					if ($attach) {
@@ -1603,8 +1570,7 @@  discard block
 block discarded – undo
1603 1570
 						}
1604 1571
 					}
1605 1572
 				}
1606
-			}
1607
-			else {
1573
+			} else {
1608 1574
 				// This is normal meeting
1609 1575
 				$resourceRecipData = $this->bookResources($this->message, $cancel, $prefix);
1610 1576
 
@@ -1638,8 +1604,7 @@  discard block
 block discarded – undo
1638 1604
 
1639 1605
 		if (!isset($messageprops[$this->proptags['goid']])) {
1640 1606
 			$this->setMeetingRequest($basedate);
1641
-		}
1642
-		else {
1607
+		} else {
1643 1608
 			$counter = $messageprops[$this->proptags['last_updatecounter']] + 1;
1644 1609
 
1645 1610
 			// increment value of last_updatecounter, last_updatecounter will be common for recurring series
@@ -1658,8 +1623,7 @@  discard block
 block discarded – undo
1658 1623
 		if (!$this->isMeetingRequest($props[PR_MESSAGE_CLASS]) && !$this->isMeetingRequestResponse($props[PR_MESSAGE_CLASS]) && !$this->isMeetingCancellation($props[PR_MESSAGE_CLASS])) {
1659 1624
 			// we are checking with calendar item
1660 1625
 			$calendarItem = $this->message;
1661
-		}
1662
-		else {
1626
+		} else {
1663 1627
 			// we are checking with meeting request / response / cancellation mail
1664 1628
 			// get calendar items
1665 1629
 			$calendarItem = $this->getCorrespondentCalendarItem(true);
@@ -1791,8 +1755,7 @@  discard block
 block discarded – undo
1791 1755
 			if (isset($inboxprops[$prop])) {
1792 1756
 				return $inboxprops[$prop];
1793 1757
 			}
1794
-		}
1795
-		catch (MAPIException $e) {
1758
+		} catch (MAPIException $e) {
1796 1759
 			// public store doesn't support this method
1797 1760
 			if ($e->getCode() == MAPI_E_NO_SUPPORT) {
1798 1761
 				// don't propagate this error to parent handlers, if store doesn't support it
@@ -1882,8 +1845,7 @@  discard block
 block discarded – undo
1882 1845
 				if (($folderProps[PR_ACCESS] & MAPI_ACCESS_CREATE_CONTENTS) === MAPI_ACCESS_CREATE_CONTENTS) {
1883 1846
 					$accessToFolder = true;
1884 1847
 				}
1885
-			}
1886
-			catch (MAPIException $e) {
1848
+			} catch (MAPIException $e) {
1887 1849
 				// we don't have rights to open folder, so return false
1888 1850
 				if ($e->getCode() == MAPI_E_NO_ACCESS) {
1889 1851
 					return $accessToFolder;
@@ -1912,8 +1874,7 @@  discard block
 block discarded – undo
1912 1874
 				$delegatorStore = $this->getDelegatorStore($messageProps[PR_RCVD_REPRESENTING_ENTRYID]);
1913 1875
 
1914 1876
 				$store = $delegatorStore['store'];
1915
-			}
1916
-			else {
1877
+			} else {
1917 1878
 				$store = $this->store;
1918 1879
 			}
1919 1880
 		}
@@ -1923,8 +1884,7 @@  discard block
 block discarded – undo
1923 1884
 		if (isset($provider[PR_MDB_PROVIDER]) && $provider[PR_MDB_PROVIDER] === ZARAFA_STORE_PUBLIC_GUID) {
1924 1885
 			$entryid = mapi_getprops($this->message, [PR_PARENT_ENTRYID]);
1925 1886
 			$entryid = $entryid[PR_PARENT_ENTRYID];
1926
-		}
1927
-		else {
1887
+		} else {
1928 1888
 			$entryid = $this->getDefaultFolderEntryID(PR_IPM_APPOINTMENT_ENTRYID, $store);
1929 1889
 			if ($entryid === false) {
1930 1890
 				$entryid = $this->getBaseEntryID(PR_IPM_APPOINTMENT_ENTRYID, $store);
@@ -1950,8 +1910,7 @@  discard block
 block discarded – undo
1950 1910
 
1951 1911
 		try {
1952 1912
 			$mailuser = mapi_ab_openentry($ab, $ownerentryid);
1953
-		}
1954
-		catch (MAPIException $e) {
1913
+		} catch (MAPIException $e) {
1955 1914
 			return;
1956 1915
 		}
1957 1916
 
@@ -2021,8 +1980,7 @@  discard block
 block discarded – undo
2021 1980
 				$props[$this->proptags['meetingstatus']] = $imsgprops[$this->proptags['meetingstatus']];
2022 1981
 				$props[$this->proptags['responsestatus']] = $imsgprops[$this->proptags['responsestatus']];
2023 1982
 				$props[PR_SUBJECT] = $imsgprops[PR_SUBJECT];
2024
-			}
2025
-			else {
1983
+			} else {
2026 1984
 				// Exceptions is deleted.
2027 1985
 				// Update $messageprops with timings of occurrence
2028 1986
 				$messageprops[$this->proptags['startdate']] = $recurr->getOccurrenceStart($basedate);
@@ -2034,8 +1992,7 @@  discard block
 block discarded – undo
2034 1992
 
2035 1993
 			$props[$this->proptags['recurring']] = false;
2036 1994
 			$props[$this->proptags['is_exception']] = true;
2037
-		}
2038
-		else {
1995
+		} else {
2039 1996
 			// we are creating a response from meeting request mail (it could be recurring or non-recurring)
2040 1997
 			// Send all recurrence info in response, if this is a recurrence meeting.
2041 1998
 			$isRecurring = isset($messageprops[$this->proptags['recurring']]) && $messageprops[$this->proptags['recurring']];
@@ -2221,8 +2178,7 @@  discard block
 block discarded – undo
2221 2178
 			if (!$abitem) {
2222 2179
 				return '';
2223 2180
 			}
2224
-		}
2225
-		catch (MAPIException $e) {
2181
+		} catch (MAPIException $e) {
2226 2182
 			return '';
2227 2183
 		}
2228 2184
 
@@ -2319,8 +2275,7 @@  discard block
 block discarded – undo
2319 2275
 		foreach ($recipients as $key => $recipient) {
2320 2276
 			if (isset($recipient[PR_RECIPIENT_FLAGS]) && $recipient[PR_RECIPIENT_FLAGS] == (recipSendable | recipOrganizer)) {
2321 2277
 				$hasOrganizer = true;
2322
-			}
2323
-			elseif ($isException && !isset($recipient[PR_RECIPIENT_FLAGS])) {
2278
+			} elseif ($isException && !isset($recipient[PR_RECIPIENT_FLAGS])) {
2324 2279
 				// Recipients for an occurrence
2325 2280
 				$recipients[$key][PR_RECIPIENT_FLAGS] = recipSendable | recipExceptionalResponse;
2326 2281
 			}
@@ -2459,8 +2414,7 @@  discard block
 block discarded – undo
2459 2414
 				],
2460 2415
 			];
2461 2416
 			$recipients = mapi_table_queryallrows($recipientTable, $this->recipprops, $res);
2462
-		}
2463
-		else {
2417
+		} else {
2464 2418
 			$recipients = mapi_table_queryallrows($recipientTable, $this->recipprops);
2465 2419
 		}
2466 2420
 
@@ -2556,8 +2510,7 @@  discard block
 block discarded – undo
2556 2510
 				if ($accessToFolder) {
2557 2511
 					$calFolder = mapi_msgstore_openentry($userStore, $userRootProps[PR_IPM_APPOINTMENT_ENTRYID]);
2558 2512
 				}
2559
-			}
2560
-			catch (MAPIException $e) {
2513
+			} catch (MAPIException $e) {
2561 2514
 				$e->setHandled();
2562 2515
 				$this->errorSetResource = 1; // No access
2563 2516
 			}
@@ -2583,8 +2536,7 @@  discard block
 block discarded – undo
2583 2536
 						 */
2584 2537
 						// $errorSetResource = 2;
2585 2538
 						$this->nonAcceptingResources[] = $resourceRecipients[$i];
2586
-					}
2587
-					else {
2539
+					} else {
2588 2540
 						if ($declineRecurringMeetingRequests && !$cancel) {
2589 2541
 							// Check if appointment is recurring
2590 2542
 							if ($messageprops[$this->proptags['recurring']]) {
@@ -2644,8 +2596,7 @@  discard block
 block discarded – undo
2644 2596
 					if (!$newResourceMsg) {
2645 2597
 						$newResourceMsg = mapi_folder_createmessage($calFolder);
2646 2598
 					}
2647
-				}
2648
-				else {
2599
+				} else {
2649 2600
 					$newResourceMsg = mapi_msgstore_openentry($userStore, $rows[0]);
2650 2601
 				}
2651 2602
 
@@ -2659,8 +2610,7 @@  discard block
 block discarded – undo
2659 2610
 				if ($cancel) {
2660 2611
 					$messageprops[$this->proptags['meetingstatus']] = olMeetingCanceled; // The meeting has been canceled
2661 2612
 					$messageprops[$this->proptags['busystatus']] = fbFree; // Free
2662
-				}
2663
-				else {
2613
+				} else {
2664 2614
 					$messageprops[$this->proptags['meetingstatus']] = olMeetingReceived; // The recipient is receiving the request
2665 2615
 				}
2666 2616
 				$messageprops[$this->proptags['responsestatus']] = olResponseAccepted; // The resource automatically accepts the appointment
@@ -2704,8 +2654,7 @@  discard block
 block discarded – undo
2704 2654
 						$messageprops[PR_SENT_REPRESENTING_ENTRYID] = $ownerentryid;
2705 2655
 						$messageprops[PR_SENT_REPRESENTING_SEARCH_KEY] = $ownersearchkey;
2706 2656
 					}
2707
-				}
2708
-				else {
2657
+				} else {
2709 2658
 					// get organizer information
2710 2659
 					$addrInfo = $this->getOwnerAddress($this->store);
2711 2660
 
@@ -2741,12 +2690,10 @@  discard block
 block discarded – undo
2741 2690
 					// Update occurrence
2742 2691
 					if ($recurr->isException($basedate)) {
2743 2692
 						$recurr->modifyException($messageprops, $basedate, $recips);
2744
-					}
2745
-					else {
2693
+					} else {
2746 2694
 						$recurr->createException($messageprops, $basedate, false, $recips);
2747 2695
 					}
2748
-				}
2749
-				else {
2696
+				} else {
2750 2697
 					mapi_setprops($newResourceMsg, $messageprops);
2751 2698
 
2752 2699
 					// Copy attachments
@@ -2770,8 +2717,7 @@  discard block
 block discarded – undo
2770 2717
 					'msg' => $newResourceMsg,
2771 2718
 				];
2772 2719
 				$this->includesResources = true;
2773
-			}
2774
-			else {
2720
+			} else {
2775 2721
 				/*
2776 2722
 				 * If no other errors occurred and you have no access to the
2777 2723
 				 * folder of the resource, throw an error=1.
@@ -2849,8 +2795,7 @@  discard block
 block discarded – undo
2849 2795
 				],
2850 2796
 			];
2851 2797
 			$recips = mapi_table_queryallrows($reciptable, $this->recipprops, $res);
2852
-		}
2853
-		else {
2798
+		} else {
2854 2799
 			$recips = mapi_table_queryallrows($reciptable, $this->recipprops);
2855 2800
 		}
2856 2801
 
@@ -2868,13 +2813,11 @@  discard block
 block discarded – undo
2868 2813
 		if (isset($exception_props[$this->proptags['intendedbusystatus']])) {
2869 2814
 			if ($tentative && $exception_props[$this->proptags['intendedbusystatus']] !== fbFree) {
2870 2815
 				$exception_props[$this->proptags['busystatus']] = fbTentative;
2871
-			}
2872
-			else {
2816
+			} else {
2873 2817
 				$exception_props[$this->proptags['busystatus']] = $exception_props[$this->proptags['intendedbusystatus']];
2874 2818
 			}
2875 2819
 		// we already have intendedbusystatus value in $exception_props so no need to copy it
2876
-		}
2877
-		else {
2820
+		} else {
2878 2821
 			$exception_props[$this->proptags['busystatus']] = $tentative ? fbTentative : fbBusy;
2879 2822
 		}
2880 2823
 
@@ -2890,8 +2833,7 @@  discard block
 block discarded – undo
2890 2833
 
2891 2834
 		if ($recurr->isException($basedate)) {
2892 2835
 			$recurr->modifyException($exception_props, $basedate, $recips, $occurrenceItem);
2893
-		}
2894
-		else {
2836
+		} else {
2895 2837
 			$recurr->createException($exception_props, $basedate, false, $recips, $occurrenceItem);
2896 2838
 		}
2897 2839
 
@@ -2928,8 +2870,7 @@  discard block
 block discarded – undo
2928 2870
 
2929 2871
 		if ($recurr->isException($basedate)) {
2930 2872
 			$recurr->modifyException($exception_props, $basedate, $recips, $occurrenceItem);
2931
-		}
2932
-		else {
2873
+		} else {
2933 2874
 			$recurr->createException($exception_props, $basedate, false, $recips, $occurrenceItem);
2934 2875
 		}
2935 2876
 
@@ -3028,8 +2969,7 @@  discard block
 block discarded – undo
3028 2969
 
3029 2970
 			if (!$deletedRecips) {
3030 2971
 				$deletedRecips = array_merge([], $recipients);
3031
-			}
3032
-			else {
2972
+			} else {
3033 2973
 				$deletedRecips = array_merge($deletedRecips, $recipients);
3034 2974
 			}
3035 2975
 		}
@@ -3174,8 +3114,7 @@  discard block
 block discarded – undo
3174 3114
 				$newmessageprops[PR_MESSAGE_CLASS] = 'IPM.Schedule.Meeting.Canceled';
3175 3115
 				$newmessageprops[$this->proptags['meetingstatus']] = olMeetingCanceled; // It's a cancel request
3176 3116
 				$newmessageprops[$this->proptags['busystatus']] = fbFree; // set the busy status as free
3177
-			}
3178
-			else {
3117
+			} else {
3179 3118
 				$newmessageprops[PR_MESSAGE_CLASS] = 'IPM.Schedule.Meeting.Request';
3180 3119
 				$newmessageprops[$this->proptags['meetingstatus']] = olMeetingReceived; // The recipient is receiving the request
3181 3120
 			}
@@ -3343,8 +3282,7 @@  discard block
 block discarded – undo
3343 3282
 					$sentprops[PR_SENDER_SEARCH_KEY] = $ownersearchkey;
3344 3283
 				}
3345 3284
 			}
3346
-		}
3347
-		else {
3285
+		} else {
3348 3286
 			// normal user is sending mail, so both set of properties will be same
3349 3287
 			$userDetails = $this->getOwnerAddress($userStore);
3350 3288
 
@@ -3508,8 +3446,7 @@  discard block
 block discarded – undo
3508 3446
 					$message = mapi_attach_openobj($attach, MAPI_MODIFY);
3509 3447
 				}
3510 3448
 			}
3511
-		}
3512
-		else {
3449
+		} else {
3513 3450
 			// use normal message or recurring series message
3514 3451
 			$message = $this->message;
3515 3452
 		}
@@ -3552,8 +3489,7 @@  discard block
 block discarded – undo
3552 3489
 			if (($recipient[PR_RECIPIENT_FLAGS] & recipOrganizer) != recipOrganizer) {
3553 3490
 				// Recipient is attendee, set the trackstatus to 'Not Responded'
3554 3491
 				$recipient[PR_RECIPIENT_TRACKSTATUS] = olRecipientTrackStatusNone;
3555
-			}
3556
-			else {
3492
+			} else {
3557 3493
 				// Recipient is organizer, this is not possible, but for safety
3558 3494
 				// it is best to clear the trackstatus for him as well by setting
3559 3495
 				// the trackstatus to 'Organized'.
@@ -3591,8 +3527,7 @@  discard block
 block discarded – undo
3591 3527
 
3592 3528
 			$store = $delegatorStore['store'];
3593 3529
 			$calFolder = $delegatorStore[PR_IPM_APPOINTMENT_ENTRYID];
3594
-		}
3595
-		else {
3530
+		} else {
3596 3531
 			$store = $this->store;
3597 3532
 			$calFolder = $this->openDefaultCalendar();
3598 3533
 		}
@@ -3654,8 +3589,7 @@  discard block
 block discarded – undo
3654 3589
 			if (isset($props[PR_RCVD_REPRESENTING_ENTRYID])) {
3655 3590
 				$delegatorStore = $this->getDelegatorStore($props[PR_RCVD_REPRESENTING_ENTRYID]);
3656 3591
 				$store = $delegatorStore['store'];
3657
-			}
3658
-			else {
3592
+			} else {
3659 3593
 				$store = $this->store;
3660 3594
 			}
3661 3595
 		}
@@ -3743,8 +3677,7 @@  discard block
 block discarded – undo
3743 3677
 									++$noOfInstances;
3744 3678
 									break;
3745 3679
 								}
3746
-							}
3747
-							else {
3680
+							} else {
3748 3681
 								++$noOfInstances;
3749 3682
 								break;
3750 3683
 							}
@@ -3755,8 +3688,7 @@  discard block
 block discarded – undo
3755 3688
 				if ($noOfInstances > 0) {
3756 3689
 					$returnValue = $noOfInstances;
3757 3690
 				}
3758
-			}
3759
-			else {
3691
+			} else {
3760 3692
 				// Get all items in the timeframe that we want to book, and get the goid and busystatus for each item
3761 3693
 				$items = getCalendarItems($userStore, $calFolder, $messageProps[$this->proptags['startdate']], $messageProps[$this->proptags['duedate']], [$this->proptags['goid'], $this->proptags['busystatus']]);
3762 3694
 
@@ -3777,8 +3709,7 @@  discard block
 block discarded – undo
3777 3709
 								$returnValue = true;
3778 3710
 								break;
3779 3711
 							}
3780
-						}
3781
-						else {
3712
+						} else {
3782 3713
 							$returnValue = true;
3783 3714
 							break;
3784 3715
 						}
@@ -3939,8 +3870,7 @@  discard block
 block discarded – undo
3939 3870
 		foreach ($localCategories as $key => $value) {
3940 3871
 			if ($recurrence->isException($key)) {
3941 3872
 				$recurrence->modifyException([$this->proptags['categories'] => $value], $key);
3942
-			}
3943
-			else {
3873
+			} else {
3944 3874
 				$recurrence->createException([$this->proptags['categories'] => $value], $key, false);
3945 3875
 			}
3946 3876
 			mapi_savechanges($message);
Please login to merge, or discard this patch.
class.baserecurrence.php 1 patch
Braces   +36 added lines, -72 removed lines patch added patch discarded remove patch
@@ -52,8 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
 		if (is_array($message)) {
54 54
 			$this->messageprops = $message;
55
-		}
56
-		else {
55
+		} else {
57 56
 			$this->message = $message;
58 57
 			$this->messageprops = mapi_getprops($this->message, $this->proptags);
59 58
 		}
@@ -241,8 +240,7 @@  discard block
 block discarded – undo
241 240
 
242 241
 				if ($ret["subtype"] == rptMonthNth) {
243 242
 					$ret["weekdays"] = $data["monthday"];
244
-				}
245
-				else {
243
+				} else {
246 244
 					$ret["monthday"] = $data["monthday"];
247 245
 				}
248 246
 
@@ -274,8 +272,7 @@  discard block
 block discarded – undo
274 272
 
275 273
 				if ($ret["subtype"] == rptMonthNth) {
276 274
 					$ret["weekdays"] = $data["monthday"];
277
-				}
278
-				else {
275
+				} else {
279 276
 					$ret["monthday"] = $data["monthday"];
280 277
 				}
281 278
 
@@ -636,8 +633,7 @@  discard block
 block discarded – undo
636 633
 				if ($this->recur["subtype"] == rptWeek) {
637 634
 					// Daily every workday
638 635
 					$rdata .= pack("VVVV", 6 * 24 * 60, 1, 0, 0x3E);
639
-				}
640
-				else {
636
+				} else {
641 637
 					// Calc first occ
642 638
 					$firstocc = $this->unixDataToRecurData($this->recur["start"]) % ((int) $this->recur["everyn"]);
643 639
 
@@ -707,8 +703,7 @@  discard block
 block discarded – undo
707 703
 
708 704
 				if ($this->recur["regen"]) {
709 705
 					$rdata .= pack("VVV", $firstocc, (int) $this->recur["everyn"], 1);
710
-				}
711
-				else {
706
+				} else {
712 707
 					$rdata .= pack("VVVV", $firstocc, (int) $this->recur["everyn"], 0, (int) $this->recur["weekdays"]);
713 708
 				}
714 709
 				break;
@@ -727,8 +722,7 @@  discard block
 block discarded – undo
727 722
 					if ($everyn > 99 || $everyn < 0) {
728 723
 						return;
729 724
 					}
730
-				}
731
-				else {
725
+				} else {
732 726
 					$everyn = $this->recur["regen"] ? ((int) $this->recur["everyn"]) * 12 : 12;
733 727
 				}
734 728
 
@@ -771,18 +765,15 @@  discard block
 block discarded – undo
771 765
 							if ($rtype == IDC_RCEV_PAT_ORB_YEARLY) {
772 766
 								if ($curmonth > $selmonth) {// go to next occurrence in 'everyn' months minus difference in first occurrence and original date
773 767
 									$count = $everyn - ($curmonth - $selmonth);
774
-								}
775
-								elseif ($curmonth < $selmonth) {// go to next occurrence upto difference in first occurrence and original date
768
+								} elseif ($curmonth < $selmonth) {// go to next occurrence upto difference in first occurrence and original date
776 769
 									$count = $selmonth - $curmonth;
777
-								}
778
-								else {
770
+								} else {
779 771
 									// Go to next occurrence while recurrence start date is greater than occurrence date but within same month
780 772
 									if (((int) $this->recur["monthday"]) < $curmonthday) {
781 773
 										$count = $everyn;
782 774
 									}
783 775
 								}
784
-							}
785
-							else {
776
+							} else {
786 777
 								$count = $everyn; // Monthly, go to next occurrence in 'everyn' months
787 778
 							}
788 779
 
@@ -819,8 +810,7 @@  discard block
 block discarded – undo
819 810
 							}
820 811
 
821 812
 							$rdata .= pack("VVVV", $firstocc, $everyn, $this->recur["regen"], (int) $this->recur["monthday"]);
822
-						}
823
-						else {
813
+						} else {
824 814
 							// Calc first occ
825 815
 							$firstocc = 0;
826 816
 							$monthIndex = (int) gmdate("n", $this->recur["start"]);
@@ -848,8 +838,7 @@  discard block
 block discarded – undo
848 838
 						if ($nday == 5) {
849 839
 							// Set date on the last day of the last month
850 840
 							$monthbegindow += (gmdate("t", $monthbegindow) - gmdate("j", $monthbegindow)) * 24 * 60 * 60;
851
-						}
852
-						else {
841
+						} else {
853 842
 							// Set on the first day of the month
854 843
 							$monthbegindow -= ((gmdate("j", $monthbegindow) - 1) * 24 * 60 * 60);
855 844
 						}
@@ -858,8 +847,7 @@  discard block
 block discarded – undo
858 847
 							// Set on right month
859 848
 							if ($selmonth < $curmonth) {
860 849
 								$tmp = 12 - $curmonth + $selmonth;
861
-							}
862
-							else {
850
+							} else {
863 851
 								$tmp = ($selmonth - $curmonth);
864 852
 							}
865 853
 
@@ -872,8 +860,7 @@  discard block
 block discarded – undo
872 860
 								}
873 861
 								++$curmonth;
874 862
 							}
875
-						}
876
-						else {
863
+						} else {
877 864
 							// Check or you exist in the right month
878 865
 
879 866
 							$dayofweek = gmdate("w", $monthbegindow);
@@ -932,8 +919,7 @@  discard block
 block discarded – undo
932 919
 						}
933 920
 						if ($nday == 5) {
934 921
 							$monthbegindow -= $day * 24 * 60 * 60;
935
-						}
936
-						else {
922
+						} else {
937 923
 							$monthbegindow += ($day - 1) * 24 * 60 * 60;
938 924
 						}
939 925
 
@@ -947,8 +933,7 @@  discard block
 block discarded – undo
947 933
 							}
948 934
 
949 935
 							$rdata .= pack("VVVVV", $firstocc, $everyn, 0, $weekdays, $nday);
950
-						}
951
-						else {
936
+						} else {
952 937
 							// Calc first occ
953 938
 							$monthIndex = (int) gmdate("n", $this->recur["start"]);
954 939
 
@@ -991,8 +976,7 @@  discard block
 block discarded – undo
991 976
 		// Strange little thing for the recurrence type "every workday"
992 977
 		if ($rtype == IDC_RCEV_PAT_ORB_WEEKLY && ((int) $this->recur["subtype"]) == 1) {
993 978
 			$rdata .= pack("V", 1);
994
-		}
995
-		else { // Other recurrences
979
+		} else { // Other recurrences
996 980
 			$rdata .= pack("V", 0);
997 981
 		}
998 982
 
@@ -1069,8 +1053,7 @@  discard block
 block discarded – undo
1069 1053
 
1070 1054
 								$occenddate += 24 * 60 * 60;
1071 1055
 							}
1072
-						}
1073
-						else {
1056
+						} else {
1074 1057
 							// -1 because the first day already counts (from 1-1-1980 to 1-1-1980 is 1 occurrence)
1075 1058
 							$occenddate += (((int) $this->recur["everyn"]) * 60 * ((int) $this->recur["numoccur"] - 1));
1076 1059
 						}
@@ -1118,8 +1101,7 @@  discard block
 block discarded – undo
1118 1101
 									if ($curmonth >= 12) {
1119 1102
 										$curmonth = 1;
1120 1103
 										++$curyear;
1121
-									}
1122
-									else {
1104
+									} else {
1123 1105
 										++$curmonth;
1124 1106
 									}
1125 1107
 									--$forwardcount;
@@ -1130,8 +1112,7 @@  discard block
 block discarded – undo
1130 1112
 									gmdate("j", $occenddate) < ((int) $this->recur["monthday"])) {
1131 1113
 									if (gmdate("j", $occenddate) < 28) {
1132 1114
 										$occenddate -= gmdate("j", $occenddate) * 24 * 60 * 60;
1133
-									}
1134
-									else {
1115
+									} else {
1135 1116
 										$occenddate += (gmdate("t", $occenddate) - gmdate("j", $occenddate)) * 24 * 60 * 60;
1136 1117
 									}
1137 1118
 								}
@@ -1147,8 +1128,7 @@  discard block
 block discarded – undo
1147 1128
 									if ($curmonth >= 12) {
1148 1129
 										$curmonth = 1;
1149 1130
 										++$curyear;
1150
-									}
1151
-									else {
1131
+									} else {
1152 1132
 										++$curmonth;
1153 1133
 									}
1154 1134
 
@@ -1158,8 +1138,7 @@  discard block
 block discarded – undo
1158 1138
 								if ($nday == 5) {
1159 1139
 									// Set date on the last day of the last month
1160 1140
 									$occenddate += (gmdate("t", $occenddate) - gmdate("j", $occenddate)) * 24 * 60 * 60;
1161
-								}
1162
-								else {
1141
+								} else {
1163 1142
 									// Set date on the first day of the last month
1164 1143
 									$occenddate -= (gmdate("j", $occenddate) - 1) * 24 * 60 * 60;
1165 1144
 								}
@@ -1226,8 +1205,7 @@  discard block
 block discarded – undo
1226 1205
 
1227 1206
 			// set named prop 'side_effects' to 369, needed for Outlook to ask for single or total recurrence when deleting
1228 1207
 			$propsToSet[$this->proptags["side_effects"]] = 369;
1229
-		}
1230
-		else {
1208
+		} else {
1231 1209
 			$propsToSet[$this->proptags["side_effects"]] = 3441;
1232 1210
 		}
1233 1211
 
@@ -1257,12 +1235,10 @@  discard block
 block discarded – undo
1257 1235
 			if ($occ) {
1258 1236
 				if (isset($reminderprops[$this->proptags["flagdueby"]])) {
1259 1237
 					$propsToSet[$this->proptags["flagdueby"]] = $reminderprops[$this->proptags["flagdueby"]];
1260
-				}
1261
-				else {
1238
+				} else {
1262 1239
 					$propsToSet[$this->proptags["flagdueby"]] = $occ[$this->proptags["startdate"]] - ($reminderprops[$this->proptags["reminder_minutes"]] * 60);
1263 1240
 				}
1264
-			}
1265
-			else {
1241
+			} else {
1266 1242
 				// Last reminder passed, no reminders any more.
1267 1243
 				$propsToSet[$this->proptags["reminder"]] = false;
1268 1244
 				$propsToSet[$this->proptags["flagdueby"]] = 0x7FF00000;
@@ -1487,11 +1463,9 @@  discard block
 block discarded – undo
1487 1463
 	public function getMonthInSeconds($year, $month): int {
1488 1464
 		if (in_array($month, [1, 3, 5, 7, 8, 10, 12])) {
1489 1465
 			$day = 31;
1490
-		}
1491
-		elseif (in_array($month, [4, 6, 9, 11])) {
1466
+		} elseif (in_array($month, [4, 6, 9, 11])) {
1492 1467
 			$day = 30;
1493
-		}
1494
-		else {
1468
+		} else {
1495 1469
 			$day = 28;
1496 1470
 			if ($this->isLeapYear($year) == 1) {
1497 1471
 				++$day;
@@ -1561,8 +1535,7 @@  discard block
 block discarded – undo
1561 1535
 			if ($date > $dststart && $date < $dstend) {
1562 1536
 				$dst = true;
1563 1537
 			}
1564
-		}
1565
-		else {
1538
+		} else {
1566 1539
 			// Southern hemisphere, eg DST is during Oct-Mar
1567 1540
 			if ($date < $dstend || $date > $dststart) {
1568 1541
 				$dst = true;
@@ -1761,8 +1734,7 @@  discard block
 block discarded – undo
1761 1734
 
1762 1735
 			if (isset($this->recur['regen'], $this->action['datecompleted']) && $this->recur['regen']) {
1763 1736
 				$daystart = $this->dayStartOf($this->action['datecompleted']);
1764
-			}
1765
-			else {
1737
+			} else {
1766 1738
 				$daystart = $this->dayStartOf($this->recur["start"]); // start on first day of occurrence
1767 1739
 			}
1768 1740
 
@@ -1770,8 +1742,7 @@  discard block
 block discarded – undo
1770 1742
 			// or the end of the recurrence, whichever comes first
1771 1743
 			if ($end > $this->toGMT($this->tz, $this->recur["end"])) {
1772 1744
 				$rangeend = $this->toGMT($this->tz, $this->recur["end"]);
1773
-			}
1774
-			else {
1745
+			} else {
1775 1746
 				$rangeend = $end;
1776 1747
 			}
1777 1748
 
@@ -1791,8 +1762,7 @@  discard block
 block discarded – undo
1791 1762
 						for ($now = $daystart; $now <= $dayend && ($limit == 0 || count($items) < $limit); $now += 60 * $this->recur["everyn"]) {
1792 1763
 							$this->processOccurrenceItem($items, $start, $end, $now, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly);
1793 1764
 						}
1794
-					}
1795
-					else {
1765
+					} else {
1796 1766
 						// Every workday
1797 1767
 						for ($now = $daystart; $now <= $dayend && ($limit == 0 || count($items) < $limit); $now += 60 * 1440) {
1798 1768
 							$nowtime = $this->gmtime($now);
@@ -1816,8 +1786,7 @@  discard block
 block discarded – undo
1816 1786
 					for ($now = $daystart; $now <= $dayend && ($limit == 0 || count($items) < $limit); $now += (60 * 60 * 24 * 7 * $this->recur["everyn"])) {
1817 1787
 						if ($this->recur['regen']) {
1818 1788
 							$this->processOccurrenceItem($items, $start, $end, $now, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly);
1819
-						}
1820
-						else {
1789
+						} else {
1821 1790
 							// Loop through the whole following week to the first occurrence of the week, add each day that is specified
1822 1791
 							for ($wday = 0; $wday < 7; ++$wday) {
1823 1792
 								$daynow = $now + $wday * 60 * 60 * 24;
@@ -1850,8 +1819,7 @@  discard block
 block discarded – undo
1850 1819
 							if ($daynow <= $dayend) {
1851 1820
 								$this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly);
1852 1821
 							}
1853
-						}
1854
-						elseif (isset($this->recur["nday"], $this->recur["weekdays"])) { // Nth [weekday] of every N months
1822
+						} elseif (isset($this->recur["nday"], $this->recur["weekdays"])) { // Nth [weekday] of every N months
1855 1823
 							// Sanitize input
1856 1824
 							if ($this->recur["weekdays"] == 0) {
1857 1825
 								$this->recur["weekdays"] = 1;
@@ -1877,8 +1845,7 @@  discard block
 block discarded – undo
1877 1845
 								}
1878 1846
 								// $firstday is the day of the month on which the asked pattern of nth weekday matches
1879 1847
 								$daynow = $now + $firstday * 60 * 60 * 24;
1880
-							}
1881
-							else {
1848
+							} else {
1882 1849
 								// Find last day in the month ($now is the firstday of the month)
1883 1850
 								$NumDaysInMonth = $this->daysInMonth($now, 1);
1884 1851
 								$daynow = $now + (($NumDaysInMonth - 1) * 24 * 60 * 60);
@@ -1896,8 +1863,7 @@  discard block
 block discarded – undo
1896 1863
 							if ($daynow <= $dayend && $daynow >= $daystart) {
1897 1864
 								$this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly);
1898 1865
 							}
1899
-						}
1900
-						elseif ($this->recur['regen']) {
1866
+						} elseif ($this->recur['regen']) {
1901 1867
 							$next_month_start = $now + ($this->daysInMonth($now, 1) * 24 * 60 * 60);
1902 1868
 							$now = $daystart + ($this->daysInMonth($next_month_start, $this->recur['everyn']) * 24 * 60 * 60);
1903 1869
 
@@ -1924,8 +1890,7 @@  discard block
 block discarded – undo
1924 1890
 							}	// Cap $monthday on month length (eg 28 feb instead of 29 feb)
1925 1891
 							$daynow = $monthstart + ($monthday - 1) * 24 * 60 * 60;
1926 1892
 							$this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly);
1927
-						}
1928
-						elseif (isset($this->recur["nday"], $this->recur["weekdays"])) { // Nth [weekday] in month X of every N years
1893
+						} elseif (isset($this->recur["nday"], $this->recur["weekdays"])) { // Nth [weekday] in month X of every N years
1929 1894
 							// Go the correct month
1930 1895
 							$monthnow = $now + $this->daysInMonth($now, $this->monthOfYear($this->recur["month"])) * 24 * 60 * 60;
1931 1896
 
@@ -1948,8 +1913,7 @@  discard block
 block discarded – undo
1948 1913
 							}
1949 1914
 
1950 1915
 							$this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly);
1951
-						}
1952
-						elseif ($this->recur['regen']) {
1916
+						} elseif ($this->recur['regen']) {
1953 1917
 							$year_starttime = $this->gmtime($now);
1954 1918
 							$is_next_leapyear = $this->isLeapYear($year_starttime['tm_year'] + 1900 + 1);	// +1 next year
1955 1919
 							$now = $daystart + ($is_next_leapyear ? 31622400 /* Leap year in seconds */ : 31536000 /* year in seconds */);
Please login to merge, or discard this patch.
class.taskrecurrence.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -169,8 +169,7 @@  discard block
 block discarded – undo
169 169
 				}
170 170
 
171 171
 				$props[$this->proptags["dead_occurrence"]] = false;
172
-			}
173
-			else {
172
+			} else {
174 173
 				if (isset($this->action['deleteOccurrence']) && $this->action['deleteOccurrence']) {
175 174
 					return false;
176 175
 				}
@@ -328,8 +327,7 @@  discard block
 block discarded – undo
328 327
 			// If startdate and enddate are set on task, then slide enddate according to duration
329 328
 			if (isset($this->messageprops[$this->proptags["startdate"]], $this->messageprops[$this->proptags["duedate"]])) {
330 329
 				$newItem[$this->proptags['duedate']] = $newItem[$this->proptags['startdate']] + ($this->messageprops[$this->proptags["duedate"]] - $this->messageprops[$this->proptags["startdate"]]);
331
-			}
332
-			else {
330
+			} else {
333 331
 				$newItem[$this->proptags['duedate']] = $newItem[$this->proptags['startdate']];
334 332
 			}
335 333
 
@@ -383,8 +381,7 @@  discard block
 block discarded – undo
383 381
 				$props[$this->proptags['flagdueby']] = $next_reminder_time;
384 382
 				$this->action['reminder'] = $props[$this->proptags['reminder']] = true;
385 383
 			}
386
-		}
387
-		else {
384
+		} else {
388 385
 			// Didn't get next occurrence, probably this is the last occurrence
389 386
 			$props[$this->proptags['reminder']] = false;
390 387
 			$props[$this->proptags['reset_reminder']] = false;
Please login to merge, or discard this patch.