Passed
Branch master (f497d2)
by Mike
03:18
created
lib/grommunio/importer.php 1 patch
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -60,13 +60,11 @@  discard block
 block discarded – undo
60 60
 			if ($folderidForBackendId != $this->folderidHex) {
61 61
 				$this->prefix = $folderidForBackendId . ':';
62 62
 			}
63
-		}
64
-		else {
63
+		} else {
65 64
 			$storeprops = mapi_getprops($store, [PR_IPM_SUBTREE_ENTRYID, PR_IPM_PUBLIC_FOLDERS_ENTRYID]);
66 65
 			if (GSync::GetBackend()->GetImpersonatedUser() == 'system') {
67 66
 				$entryid = $storeprops[PR_IPM_PUBLIC_FOLDERS_ENTRYID];
68
-			}
69
-			else {
67
+			} else {
70 68
 				$entryid = $storeprops[PR_IPM_SUBTREE_ENTRYID];
71 69
 			}
72 70
 		}
@@ -88,8 +86,7 @@  discard block
 block discarded – undo
88 86
 
89 87
 		if ($folderid) {
90 88
 			$this->importer = mapi_openproperty($folder, PR_COLLECTOR, IID_IExchangeImportContentsChanges, 0, 0);
91
-		}
92
-		else {
89
+		} else {
93 90
 			$this->importer = mapi_openproperty($folder, PR_COLLECTOR, IID_IExchangeImportHierarchyChanges, 0, 0);
94 91
 		}
95 92
 	}
@@ -127,8 +124,7 @@  discard block
 block discarded – undo
127 124
 			// possible conflicting messages will be cached here
128 125
 			$this->memChanges = new ChangesMemoryWrapper();
129 126
 			$stat = mapi_importcontentschanges_config($this->importer, $stream, $flags);
130
-		}
131
-		else {
127
+		} else {
132 128
 			$stat = mapi_importhierarchychanges_config($this->importer, $stream, $flags);
133 129
 		}
134 130
 
@@ -201,8 +197,7 @@  discard block
 block discarded – undo
201 197
 			$data = mapi_stream_read($this->statestream, 4096);
202 198
 			if (strlen($data)) {
203 199
 				$state .= $data;
204
-			}
205
-			else {
200
+			} else {
206 201
 				break;
207 202
 			}
208 203
 		}
@@ -395,8 +390,7 @@  discard block
 block discarded – undo
395 390
 
396 391
 				return false;
397 392
 			}
398
-		}
399
-		else {
393
+		} else {
400 394
 			$flags = SYNC_NEW_MESSAGE;
401 395
 		}
402 396
 
@@ -436,8 +430,7 @@  discard block
 block discarded – undo
436 430
 		$this->lazyLoadConflicts();
437 431
 		if ($this->memChanges->IsChanged($id)) {
438 432
 			SLog::Write(LOGLEVEL_INFO, sprintf("ImportChangesICS->ImportMessageDeletion('%s'): Conflict detected. Data from Server will be dropped! PIM deleted object.", $id));
439
-		}
440
-		elseif ($this->memChanges->IsDeleted($id)) {
433
+		} elseif ($this->memChanges->IsDeleted($id)) {
441 434
 			SLog::Write(LOGLEVEL_INFO, sprintf("ImportChangesICS->ImportMessageDeletion('%s'): Conflict detected. Data is already deleted. Request will be ignored.", $id));
442 435
 
443 436
 			return true;
@@ -658,12 +651,10 @@  discard block
 block discarded – undo
658 651
 				$parentprops = mapi_getprops($this->store, [PR_IPM_SUBTREE_ENTRYID, PR_IPM_PUBLIC_FOLDERS_ENTRYID]);
659 652
 				if (GSync::GetBackend()->GetImpersonatedUser() == 'system' && isset($parentprops[PR_IPM_PUBLIC_FOLDERS_ENTRYID])) {
660 653
 					$parentfentryid = $parentprops[PR_IPM_PUBLIC_FOLDERS_ENTRYID];
661
-				}
662
-				elseif (isset($parentprops[PR_IPM_SUBTREE_ENTRYID])) {
654
+				} elseif (isset($parentprops[PR_IPM_SUBTREE_ENTRYID])) {
663 655
 					$parentfentryid = $parentprops[PR_IPM_SUBTREE_ENTRYID];
664 656
 				}
665
-			}
666
-			else {
657
+			} else {
667 658
 				$parentfentryid = mapi_msgstore_entryidfromsourcekey($this->store, hex2bin($parent));
668 659
 			}
669 660
 
@@ -726,8 +717,7 @@  discard block
 block discarded – undo
726 717
 			$parentprops = mapi_getprops($this->store, [PR_IPM_SUBTREE_ENTRYID, PR_IPM_PUBLIC_FOLDERS_ENTRYID]);
727 718
 			if (GSync::GetBackend()->GetImpersonatedUser() == 'system') {
728 719
 				$parentfentryid = $parentprops[PR_IPM_PUBLIC_FOLDERS_ENTRYID];
729
-			}
730
-			else {
720
+			} else {
731 721
 				$parentfentryid = $parentprops[PR_IPM_SUBTREE_ENTRYID];
732 722
 			}
733 723
 			$mapifolder = mapi_msgstore_openentry($this->store, $parentfentryid);
Please login to merge, or discard this patch.
lib/core/redisconnection.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -48,8 +48,7 @@  discard block
 block discarded – undo
48 48
 	public function getKey($key) {
49 49
 		try {
50 50
 			return $this->redisObj->get($key);
51
-		}
52
-		catch (Exception $e) {
51
+		} catch (Exception $e) {
53 52
 			SLog::Write(LOGLEVEL_ERROR, sprintf("%s->getKey(): %s", get_class($this), $e->getMessage()));
54 53
 		}
55 54
 	}
@@ -61,8 +60,7 @@  discard block
 block discarded – undo
61 60
 			}
62 61
 
63 62
 			return $this->redisObj->set($key, $value);
64
-		}
65
-		catch (Exception $e) {
63
+		} catch (Exception $e) {
66 64
 			SLog::Write(LOGLEVEL_ERROR, sprintf("%s->setKey(): %s", get_class($this), $e->getMessage()));
67 65
 		}
68 66
 	}
@@ -70,8 +68,7 @@  discard block
 block discarded – undo
70 68
 	public function delKey($key) {
71 69
 		try {
72 70
 			return $this->redisObj->del($key);
73
-		}
74
-		catch (Exception $e) {
71
+		} catch (Exception $e) {
75 72
 			SLog::Write(LOGLEVEL_ERROR, sprintf("%s->delKey(): %s", get_class($this), $e->getMessage()));
76 73
 		}
77 74
 	}
Please login to merge, or discard this patch.
lib/core/topcollector.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -148,8 +148,7 @@
 block discarded – undo
148 148
 
149 149
 		if ($all == true) {
150 150
 			$this->getRedis()->delKey(self::TOPDATA);
151
-		}
152
-		else {
151
+		} else {
153 152
 			foreach ($this->getRawDeviceUserData(self::TOPDATA) as $compKey => $rawline) {
154 153
 				$line = json_decode($rawline, true);
155 154
 				// remove everything which terminated for 20 secs or is not updated for more than 120 secs
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
 			"ended" => 0,
46 46
 			"push" => false,
47 47
 		];
48
-		$this->disabled = (bool) (defined('TOPCOLLECTOR_DISABLED') && constant('TOPCOLLECTOR_DISABLED') === true);
48
+		$this->disabled = (bool)(defined('TOPCOLLECTOR_DISABLED') && constant('TOPCOLLECTOR_DISABLED') === true);
49 49
 		$this->checkEnabledTime = time() - self::ENABLED_CACHETIME - 1;
50 50
 		$this->AnnounceInformation("initializing");
51 51
 	}
Please login to merge, or discard this patch.
lib/core/changesmemorywrapper.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -86,8 +86,7 @@  discard block
 block discarded – undo
86 86
 						SLog::Write(LOGLEVEL_INFO, sprintf("ChangesMemoryWrapper->Config(AdditionalFolders) : previously synchronized folder '%s' is not to be synched anymore. Sending delete to mobile.", $folder->displayname));
87 87
 						$this->ImportFolderDeletion($folder);
88 88
 					}
89
-				}
90
-				else {
89
+				} else {
91 90
 					$folderIdsOnClient[] = $sid;
92 91
 				}
93 92
 			}
@@ -187,8 +186,7 @@  discard block
 block discarded – undo
187 186
 	public function ImportMessageDeletion($id, $asSoftDelete = false) {
188 187
 		if ($asSoftDelete === true) {
189 188
 			$this->changes[] = [self::SOFTDELETION, $id];
190
-		}
191
-		else {
189
+		} else {
192 190
 			$this->changes[] = [self::DELETION, $id];
193 191
 		}
194 192
 
Please login to merge, or discard this patch.
lib/core/gsyncdefs.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -984,7 +984,7 @@
 block discarded – undo
984 984
 define("LOGLEVEL_DEVICEID", 64);
985 985
 define("LOGLEVEL_WBXMLSTACK", 128);
986 986
 
987
-define("LOGLEVEL_ALL", LOGLEVEL_FATAL | LOGLEVEL_ERROR | LOGLEVEL_WARN | LOGLEVEL_INFO | LOGLEVEL_DEBUG | LOGLEVEL_WBXML);
987
+define("LOGLEVEL_ALL", LOGLEVEL_FATAL|LOGLEVEL_ERROR|LOGLEVEL_WARN|LOGLEVEL_INFO|LOGLEVEL_DEBUG|LOGLEVEL_WBXML);
988 988
 
989 989
 define("BACKEND_DISCARD_DATA", 1);
990 990
 
Please login to merge, or discard this patch.
lib/core/interprocessdata.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -36,8 +36,7 @@  discard block
 block discarded – undo
36 36
 			// this method is not suitable for the TopCollector atm
37 37
 			$type = Request::GetDeviceID();
38 38
 			$this->ipcProvider = GSync::GetRedis();
39
-		}
40
-		catch (Exception $e) {
39
+		} catch (Exception $e) {
41 40
 			// ipcProvider could not initialise
42 41
 			SLog::Write(LOGLEVEL_ERROR, sprintf("%s could not initialise IPC Redis provider: %s", get_class($this), $e->getMessage()));
43 42
 		}
@@ -193,8 +192,7 @@  discard block
 block discarded – undo
193 192
 		elseif ($doCas == "replace") {
194 193
 			if (!$rawdata) {
195 194
 				$ok = ($this->ipcProvider->get()->hset($key, $compKey, json_encode($data)) !== false);
196
-			}
197
-			else {
195
+			} else {
198 196
 				$ok = $this->ipcProvider->CASHash($key, $compKey, $rawdata, json_encode($data));
199 197
 			}
200 198
 		}
@@ -270,8 +268,7 @@  discard block
 block discarded – undo
270 268
 			}
271 269
 			if (!$subkey) {
272 270
 				$_data[$devid][$user] = $_data;
273
-			}
274
-			else {
271
+			} else {
275 272
 				if (!isset($_data[$devid][$user])) {
276 273
 					$_data[$devid][$user] = [];
277 274
 				}
Please login to merge, or discard this patch.
lib/core/asdevice.php 1 patch
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -83,8 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
 		if (!$stripHierarchyCache && $this->hierarchyCache !== false && $this->hierarchyCache instanceof ChangesMemoryWrapper) {
85 85
 			$this->hierarchyCache->StripData();
86
-		}
87
-		else {
86
+		} else {
88 87
 			unset($this->hierarchyCache);
89 88
 		}
90 89
 
@@ -245,8 +244,7 @@  discard block
 block discarded – undo
245 244
 							$foundMessage = true;
246 245
 							if (count($this->ignoredMessageIds[$folderid]) == 1) {
247 246
 								unset($this->ignoredMessageIds[$folderid]);
248
-							}
249
-							else {
247
+							} else {
250 248
 								unset($this->ignoredMessageIds[$folderid][array_search($id, $this->ignoredMessageIds[$folderid])]);
251 249
 							}
252 250
 
@@ -314,8 +312,7 @@  discard block
 block discarded – undo
314 312
 		if ($hierarchydata !== false && $hierarchydata instanceof ChangesMemoryWrapper) {
315 313
 			$this->hierarchyCache = $hierarchydata;
316 314
 			$this->hierarchyCache->CopyOldState();
317
-		}
318
-		else {
315
+		} else {
319 316
 			$this->hierarchyCache = new ChangesMemoryWrapper();
320 317
 		}
321 318
 
@@ -407,8 +404,7 @@  discard block
 block discarded – undo
407 404
 				$this->backend2folderidCache = false;
408 405
 			}
409 406
 			$this->changed = true;
410
-		}
411
-		else {
407
+		} else {
412 408
 			$contentData = $this->contentData;
413 409
 
414 410
 			if (!isset($contentData[$folderid])) {
@@ -422,8 +418,7 @@  discard block
 block discarded – undo
422 418
 
423 419
 			if ($uuid) {
424 420
 				$contentData[$folderid]->{self::FOLDERUUID} = $uuid;
425
-			}
426
-			else {
421
+			} else {
427 422
 				$contentData[$folderid]->{self::FOLDERUUID} = false;
428 423
 			}
429 424
 
@@ -678,8 +673,7 @@  discard block
 block discarded – undo
678 673
 		}
679 674
 		if ($status !== false) {
680 675
 			$contentData[$folderid]->{self::FOLDERSYNCSTATUS} = $status;
681
-		}
682
-		elseif (isset($contentData[$folderid]->{self::FOLDERSYNCSTATUS})) {
676
+		} elseif (isset($contentData[$folderid]->{self::FOLDERSYNCSTATUS})) {
683 677
 			unset($contentData[$folderid]->{self::FOLDERSYNCSTATUS});
684 678
 		}
685 679
 
@@ -939,8 +933,7 @@  discard block
 block discarded – undo
939 933
 		foreach ($this->additionalfolders as $keepFolder) {
940 934
 			if ($keepFolder['store'] !== $store) {
941 935
 				$newAF[$keepFolder['folderid']] = $keepFolder;
942
-			}
943
-			else {
936
+			} else {
944 937
 				$noDupsCheck[$keepFolder['folderid']] = true;
945 938
 			}
946 939
 		}
Please login to merge, or discard this patch.
lib/core/loopdetection.php 2 patches
Braces   +11 added lines, -22 removed lines patch added patch discarded remove patch
@@ -264,8 +264,7 @@  discard block
 block discarded – undo
264 264
 					if (isset($se['stat'], $se['stat']['hierarchy']) && $se['stat']['hierarchy'] == SYNC_FSSTATUS_SYNCKEYERROR) {
265 265
 						SLog::Write(LOGLEVEL_DEBUG, "LoopDetection->ProcessLoopDetectionIsHierarchyResyncRequired(): a full FolderReSync was already requested. Resetting fail counter.");
266 266
 						$seenFailed = [];
267
-					}
268
-					else {
267
+					} else {
269 268
 						$seenFolderSync = true;
270 269
 						if (!empty($seenFailed)) {
271 270
 							SLog::Write(LOGLEVEL_DEBUG, "LoopDetection->ProcessLoopDetectionIsHierarchyResyncRequired(): seen FolderSync after other failing command");
@@ -355,8 +354,7 @@  discard block
 block discarded – undo
355 354
 			foreach ($stack as $entry) {
356 355
 				if ($entry['id'] != $updateentry['id']) {
357 356
 					$nstack[] = $entry;
358
-				}
359
-				else {
357
+				} else {
360 358
 					$nstack[] = $updateentry;
361 359
 					$found = true;
362 360
 				}
@@ -589,8 +587,7 @@  discard block
 block discarded – undo
589 587
 			if (!isset($current["uuid"]) || $current["uuid"] != $uuid) {
590 588
 				SLog::Write(LOGLEVEL_DEBUG, "LoopDetection->IsSyncStateObsolete(): yes, uuid changed or not set");
591 589
 				$obsolete = true;
592
-			}
593
-			else {
590
+			} else {
594 591
 				SLog::Write(LOGLEVEL_DEBUG, sprintf(
595 592
 					"LoopDetection->IsSyncStateObsolete(): check folderid: '%s' uuid '%s' counter: %d - last counter: %d with %d queued",
596 593
 					$folderid,
@@ -610,8 +607,7 @@  discard block
 block discarded – undo
610 607
 					$obsolete = true;
611 608
 				}
612 609
 			}
613
-		}
614
-		else {
610
+		} else {
615 611
 			SLog::Write(LOGLEVEL_DEBUG, sprintf("LoopDetection->IsSyncStateObsolete(): check folderid: '%s' uuid '%s' counter: %d - no data found: not obsolete", $folderid, $uuid, $counter));
616 612
 		}
617 613
 
@@ -685,8 +681,7 @@  discard block
 block discarded – undo
685 681
 					SLog::Write(LOGLEVEL_DEBUG, "LoopDetection->Detect(): UUID changed and while items where sent to device - forcing loop mode");
686 682
 					$loop = true; // force loop mode
687 683
 					$current['queued'] = $queuedMessages;
688
-				}
689
-				else {
684
+				} else {
690 685
 					$current['queued'] = 0;
691 686
 				}
692 687
 
@@ -747,8 +742,7 @@  discard block
 block discarded – undo
747 742
 							// return suggested new window size
748 743
 							$current['windowLimit'] = 25;
749 744
 							$loop = $current['windowLimit'];
750
-						}
751
-						else {
745
+						} else {
752 746
 							// case 3.1) we have just encountered a loop!
753 747
 							SLog::Write(LOGLEVEL_DEBUG, "LoopDetection->Detect(): case 3.1 detected - loop detected, init loop mode");
754 748
 							if (isset($current['windowLimit'])) {
@@ -760,14 +754,12 @@  discard block
 block discarded – undo
760 754
 							$current['maxCount'] = $counter + (($maxItems < $queuedMessages) ? $maxItems : $queuedMessages);
761 755
 							$loop = true;   // loop mode!!
762 756
 						}
763
-					}
764
-					elseif ($queuedMessages == 0) {
757
+					} elseif ($queuedMessages == 0) {
765 758
 						// case 3.2) there was a loop before but now the changes are GONE
766 759
 						SLog::Write(LOGLEVEL_DEBUG, "LoopDetection->Detect(): case 3.2 detected - changes gone - clearing loop data");
767 760
 						$current['queued'] = 0;
768 761
 						unset($current['loopcount'], $current['ignored'], $current['maxCount'], $current['potential'], $current['windowLimit']);
769
-					}
770
-					else {
762
+					} else {
771 763
 						// case 3.3) still looping the same message! Increase counter
772 764
 						SLog::Write(LOGLEVEL_DEBUG, "LoopDetection->Detect(): case 3.3 detected - in loop mode, increase loop counter");
773 765
 						++$current['loopcount'];
@@ -916,14 +908,11 @@  discard block
 block discarded – undo
916 908
 
917 909
 			if ($user == false && $devid == false) {
918 910
 				$loopdata = [];
919
-			}
920
-			elseif ($user == false && $devid != false) {
911
+			} elseif ($user == false && $devid != false) {
921 912
 				$loopdata[$devid] = [];
922
-			}
923
-			elseif ($user != false && $devid != false) {
913
+			} elseif ($user != false && $devid != false) {
924 914
 				$loopdata[$devid][$user] = [];
925
-			}
926
-			elseif ($user != false && $devid == false) {
915
+			} elseif ($user != false && $devid == false) {
927 916
 				SLog::Write(LOGLEVEL_WARN, sprintf("Not possible to reset loop detection data for user '%s' without a specifying a device id", $user));
928 917
 				$stat = false;
929 918
 			}
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -758,7 +758,7 @@  discard block
 block discarded – undo
758 758
 							$current['loopcount'] = 1;
759 759
 							// the MaxCount is the max number of messages exported before
760 760
 							$current['maxCount'] = $counter + (($maxItems < $queuedMessages) ? $maxItems : $queuedMessages);
761
-							$loop = true;   // loop mode!!
761
+							$loop = true; // loop mode!!
762 762
 						}
763 763
 					}
764 764
 					elseif ($queuedMessages == 0) {
@@ -778,7 +778,7 @@  discard block
 block discarded – undo
778 778
 							$this->ignore_messageid = $current['potential'];
779 779
 						}
780 780
 						$current['maxCount'] = $counter + (($maxItems < $queuedMessages) ? $maxItems : $queuedMessages);
781
-						$loop = true;   // loop mode!!
781
+						$loop = true; // loop mode!!
782 782
 					}
783 783
 				}
784 784
 			}
Please login to merge, or discard this patch.
lib/core/gsync.php 2 patches
Braces   +13 added lines, -26 removed lines patch added patch discarded remove patch
@@ -178,8 +178,7 @@  discard block
 block discarded – undo
178 178
 
179 179
 		if (defined('BASE_PATH_CLI') && file_exists(BASE_PATH_CLI)) {
180 180
 			define('REAL_BASE_PATH', BASE_PATH_CLI);
181
-		}
182
-		else {
181
+		} else {
183 182
 			define('REAL_BASE_PATH', BASE_PATH);
184 183
 		}
185 184
 
@@ -212,8 +211,7 @@  discard block
 block discarded – undo
212 211
 			if (LOG_SYSLOG_HOST && LOG_SYSLOG_PORT <= 0) {
213 212
 				throw new FatalMisconfigurationException("LOG_SYSLOG_HOST is defined but the LOG_SYSLOG_PORT does not seem to be valid.");
214 213
 			}
215
-		}
216
-		elseif (strtolower(LOGBACKEND) == 'filelog') {
214
+		} elseif (strtolower(LOGBACKEND) == 'filelog') {
217 215
 			define('LOGBACKEND_CLASS', 'FileLog');
218 216
 			if (!defined('LOGFILEDIR')) {
219 217
 				throw new FatalMisconfigurationException("The LOGFILEDIR is not configured. Check if the config.php file is in place.");
@@ -238,8 +236,7 @@  discard block
 block discarded – undo
238 236
 			// check ownership on the (eventually) just created files
239 237
 			Utils::FixFileOwner(LOGFILE);
240 238
 			Utils::FixFileOwner(LOGERRORFILE);
241
-		}
242
-		else {
239
+		} else {
243 240
 			define('LOGBACKEND_CLASS', LOGBACKEND);
244 241
 		}
245 242
 
@@ -249,8 +246,7 @@  discard block
 block discarded – undo
249 246
 			if (!@date_default_timezone_set(TIMEZONE)) {
250 247
 				throw new FatalMisconfigurationException(sprintf("The configured TIMEZONE '%s' is not valid. Please check supported timezones at http://www.php.net/manual/en/timezones.php", constant('TIMEZONE')));
251 248
 			}
252
-		}
253
-		elseif (!ini_get('date.timezone')) {
249
+		} elseif (!ini_get('date.timezone')) {
254 250
 			date_default_timezone_set('Europe/Vienna');
255 251
 		}
256 252
 
@@ -287,8 +283,7 @@  discard block
 block discarded – undo
287 283
 
288 284
 		if (!defined('SYNC_CONTACTS_MAXPICTURESIZE')) {
289 285
 			define('SYNC_CONTACTS_MAXPICTURESIZE', 49152);
290
-		}
291
-		elseif ((!is_int(SYNC_CONTACTS_MAXPICTURESIZE) || SYNC_CONTACTS_MAXPICTURESIZE < 1)) {
286
+		} elseif ((!is_int(SYNC_CONTACTS_MAXPICTURESIZE) || SYNC_CONTACTS_MAXPICTURESIZE < 1)) {
292 287
 			throw new FatalMisconfigurationException("The SYNC_CONTACTS_MAXPICTURESIZE value must be a number higher than 0.");
293 288
 		}
294 289
 
@@ -298,14 +293,12 @@  discard block
 block discarded – undo
298 293
 
299 294
 		if (!defined('PING_LOWER_BOUND_LIFETIME')) {
300 295
 			define('PING_LOWER_BOUND_LIFETIME', false);
301
-		}
302
-		elseif (PING_LOWER_BOUND_LIFETIME !== false && (!is_int(PING_LOWER_BOUND_LIFETIME) || PING_LOWER_BOUND_LIFETIME < 1 || PING_LOWER_BOUND_LIFETIME > 3540)) {
296
+		} elseif (PING_LOWER_BOUND_LIFETIME !== false && (!is_int(PING_LOWER_BOUND_LIFETIME) || PING_LOWER_BOUND_LIFETIME < 1 || PING_LOWER_BOUND_LIFETIME > 3540)) {
303 297
 			throw new FatalMisconfigurationException("The PING_LOWER_BOUND_LIFETIME value must be 'false' or a number between 1 and 3540 inclusively.");
304 298
 		}
305 299
 		if (!defined('PING_HIGHER_BOUND_LIFETIME')) {
306 300
 			define('PING_HIGHER_BOUND_LIFETIME', false);
307
-		}
308
-		elseif (PING_HIGHER_BOUND_LIFETIME !== false && (!is_int(PING_HIGHER_BOUND_LIFETIME) || PING_HIGHER_BOUND_LIFETIME < 1 || PING_HIGHER_BOUND_LIFETIME > 3540)) {
301
+		} elseif (PING_HIGHER_BOUND_LIFETIME !== false && (!is_int(PING_HIGHER_BOUND_LIFETIME) || PING_HIGHER_BOUND_LIFETIME < 1 || PING_HIGHER_BOUND_LIFETIME > 3540)) {
309 302
 			throw new FatalMisconfigurationException("The PING_HIGHER_BOUND_LIFETIME value must be 'false' or a number between 1 and 3540 inclusively.");
310 303
 		}
311 304
 		if (PING_HIGHER_BOUND_LIFETIME !== false && PING_LOWER_BOUND_LIFETIME !== false && PING_HIGHER_BOUND_LIFETIME < PING_LOWER_BOUND_LIFETIME) {
@@ -314,8 +307,7 @@  discard block
 block discarded – undo
314 307
 
315 308
 		if (!defined('RETRY_AFTER_DELAY')) {
316 309
 			define('RETRY_AFTER_DELAY', 300);
317
-		}
318
-		elseif (RETRY_AFTER_DELAY !== false && (!is_int(RETRY_AFTER_DELAY) || RETRY_AFTER_DELAY < 1)) {
310
+		} elseif (RETRY_AFTER_DELAY !== false && (!is_int(RETRY_AFTER_DELAY) || RETRY_AFTER_DELAY < 1)) {
319 311
 			throw new FatalMisconfigurationException("The RETRY_AFTER_DELAY value must be 'false' or a number greater than 0.");
320 312
 		}
321 313
 
@@ -330,8 +322,7 @@  discard block
 block discarded – undo
330 322
 		// the check on additional folders will not throw hard errors, as this is probably changed on live systems
331 323
 		if (isset($additionalFolders) && !is_array($additionalFolders)) {
332 324
 			SLog::Write(LOGLEVEL_ERROR, "GSync::CheckConfig(): The additional folders synchronization not available as array.");
333
-		}
334
-		else {
325
+		} else {
335 326
 			// check configured data
336 327
 			foreach ($additionalFolders as $af) {
337 328
 				if (!is_array($af) || !isset($af['store']) || !isset($af['folderid']) || !isset($af['name']) || !isset($af['type'])) {
@@ -478,11 +469,9 @@  discard block
 block discarded – undo
478 469
 
479 470
 		if (is_file($subdirbackend)) {
480 471
 			$toLoad = $subdirbackend;
481
-		}
482
-		elseif (is_file($stdbackend)) {
472
+		} elseif (is_file($stdbackend)) {
483 473
 			$toLoad = $stdbackend;
484
-		}
485
-		else {
474
+		} else {
486 475
 			return false;
487 476
 		}
488 477
 
@@ -543,8 +532,7 @@  discard block
 block discarded – undo
543 532
 	public static function GetAdditionalSyncFolderStore($backendid, $noDebug = false) {
544 533
 		if (isset(self::getAddSyncFolders()[$backendid]->Store)) {
545 534
 			$val = self::getAddSyncFolders()[$backendid]->Store;
546
-		}
547
-		else {
535
+		} else {
548 536
 			$val = self::GetDeviceManager()->GetAdditionalUserSyncFolder($backendid);
549 537
 			if (isset($val['store'])) {
550 538
 				$val = $val['store'];
@@ -593,8 +581,7 @@  discard block
 block discarded – undo
593 581
 
594 582
 			if (isset($additionalFolders) && !is_array($additionalFolders)) {
595 583
 				SLog::Write(LOGLEVEL_ERROR, "GSync::getAddSyncFolders() : The additional folders synchronization not available as array.");
596
-			}
597
-			else {
584
+			} else {
598 585
 				foreach ($additionalFolders as $af) {
599 586
 					if (!is_array($af) || !isset($af['store']) || !isset($af['folderid']) || !isset($af['name']) || !isset($af['type'])) {
600 587
 						SLog::Write(LOGLEVEL_ERROR, "GSync::getAddSyncFolders() : the additional folder synchronization is not configured correctly. Missing parameters. Entry will be ignored.");
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 	public const UNAUTHENTICATED = 1;
12 12
 	public const UNPROVISIONED = 2;
13 13
 	public const NOACTIVESYNCCOMMAND = 3;
14
-	public const WEBSERVICECOMMAND = 4;    // DEPRECATED
14
+	public const WEBSERVICECOMMAND = 4; // DEPRECATED
15 15
 	public const HIERARCHYCOMMAND = 5;
16 16
 	public const PLAININPUT = 6;
17 17
 	public const REQUESTHANDLER = 7;
Please login to merge, or discard this patch.