Passed
Push — master ( f497d2...0d7e8b )
by
unknown
03:27 queued 12s
created
lib/request/folderchange.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -130,11 +130,9 @@  discard block
 block discarded – undo
130 130
 			if (self::$deviceManager->GetFolderTypeFromCacheById($serverid) != SYNC_FOLDER_TYPE_UNKNOWN && !self::$backend->Setup(GSync::GetAdditionalSyncFolderStore((($parentBackendId != false) ? $parentBackendId : $backendid)))) {
131 131
 				throw new StatusException(sprintf("HandleFolderChange() could not Setup() the backend for folder id '%s'", (($parentBackendId != false) ? $parentBackendId : $backendid)), SYNC_FSSTATUS_SERVERERROR);
132 132
 			}
133
-		}
134
-		catch (StateNotFoundException $snfex) {
133
+		} catch (StateNotFoundException $snfex) {
135 134
 			$status = SYNC_FSSTATUS_SYNCKEYERROR;
136
-		}
137
-		catch (StatusException $stex) {
135
+		} catch (StatusException $stex) {
138 136
 			$status = $stex->getCode();
139 137
 		}
140 138
 
@@ -174,8 +172,7 @@  discard block
 block discarded – undo
174 172
 					// delete folder
175 173
 					$changesMem->ImportFolderDeletion($folder);
176 174
 				}
177
-			}
178
-			catch (StatusException $stex) {
175
+			} catch (StatusException $stex) {
179 176
 				$status = $stex->getCode();
180 177
 			}
181 178
 		}
Please login to merge, or discard this patch.
lib/request/moveitems.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -92,8 +92,7 @@
 block discarded – undo
92 92
 
93 93
 				$result = $importer->ImportMessageMove($move["srcmsgid"], self::$deviceManager->GetBackendIdForFolderId($move["dstfldid"]));
94 94
 				// We discard the standard importer state for now.
95
-			}
96
-			catch (StatusException $stex) {
95
+			} catch (StatusException $stex) {
97 96
 				if ($stex->getCode() == SYNC_STATUS_FOLDERHIERARCHYCHANGED) { // same as SYNC_FSSTATUS_CODEUNKNOWN
98 97
 					$status = SYNC_MOVEITEMSSTATUS_INVALIDSOURCEID;
99 98
 				}
Please login to merge, or discard this patch.
lib/request/ping.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -30,8 +30,7 @@  discard block
 block discarded – undo
30 30
 		// Load all collections - do load states, check permissions and allow unconfirmed states
31 31
 		try {
32 32
 			$sc->LoadAllCollections(true, true, true, true, false);
33
-		}
34
-		catch (StateInvalidException $siex) {
33
+		} catch (StateInvalidException $siex) {
35 34
 			// if no params are present, indicate to send params, else do hierarchy sync
36 35
 			if (!$params_present) {
37 36
 				$pingstatus = SYNC_PINGSTATUS_FAILINGPARAMS;
@@ -49,8 +48,7 @@  discard block
 block discarded – undo
49 48
 
50 49
 				self::$topCollector->AnnounceInformation("StateInvalidException: force sync", true);
51 50
 			}
52
-		}
53
-		catch (StatusException $stex) {
51
+		} catch (StatusException $stex) {
54 52
 			$pingstatus = SYNC_PINGSTATUS_FOLDERHIERSYNCREQUIRED;
55 53
 			self::$topCollector->AnnounceInformation("StatusException: require HierarchySync", true);
56 54
 		}
@@ -103,8 +101,7 @@  discard block
 block discarded – undo
103 101
 
104 102
 								continue;
105 103
 							}
106
-						}
107
-						catch (NoHierarchyCacheAvailableException $nhca) {
104
+						} catch (NoHierarchyCacheAvailableException $nhca) {
108 105
 							SLog::Write(LOGLEVEL_INFO, sprintf("HandlePing(): unknown collection '%s', triggering HierarchySync", $folderid));
109 106
 							$pingstatus = SYNC_PINGSTATUS_FOLDERHIERSYNCREQUIRED;
110 107
 						}
@@ -165,8 +162,7 @@  discard block
 block discarded – undo
165 162
 				self::$deviceManager->DoAutomaticASDeviceSaving(false);
166 163
 				$foundchanges = $sc->CheckForChanges($sc->GetLifetime(), $interval, true);
167 164
 			}
168
-		}
169
-		catch (StatusException $ste) {
165
+		} catch (StatusException $ste) {
170 166
 			switch ($ste->getCode()) {
171 167
 				case SyncCollections::ERROR_NO_COLLECTIONS:
172 168
 					$pingstatus = SYNC_PINGSTATUS_FAILINGPARAMS;
Please login to merge, or discard this patch.
lib/request/itemoperations.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -315,8 +315,7 @@  discard block
 block discarded – undo
315 315
 					try {
316 316
 						self::$topCollector->AnnounceInformation("Get attachment data from backend with file reference");
317 317
 						$data = self::$backend->GetAttachmentData($operation['filereference']);
318
-					}
319
-					catch (StatusException $stex) {
318
+					} catch (StatusException $stex) {
320 319
 						$status = $stex->getCode();
321 320
 					}
322 321
 				}
@@ -331,8 +330,7 @@  discard block
 block discarded – undo
331 330
 							$tmp = explode(":", $operation['longid']);
332 331
 							$data = self::$backend->Fetch(self::$deviceManager->GetBackendIdForFolderId($tmp[0]), $tmp[1], $operation["cpo"]);
333 332
 						}
334
-					}
335
-					catch (StatusException $stex) {
333
+					} catch (StatusException $stex) {
336 334
 						// the only option to return is that we could not retrieve it
337 335
 						$status = SYNC_ITEMOPERATIONSSTATUS_CONVERSIONFAILED;
338 336
 					}
@@ -396,8 +394,7 @@  discard block
 block discarded – undo
396 394
 
397 395
 					// send request to backend
398 396
 					self::$backend->EmptyFolder($operation['backendfolderid'], $operation['deletesubfolders']);
399
-				}
400
-				catch (StatusException $stex) {
397
+				} catch (StatusException $stex) {
401 398
 					$status = $stex->getCode();
402 399
 				}
403 400
 
Please login to merge, or discard this patch.
lib/request/getitemestimate.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -38,8 +38,7 @@  discard block
 block discarded – undo
38 38
 				if (self::$decoder->getElementStartTag(SYNC_SYNCKEY)) {
39 39
 					try {
40 40
 						$spa->SetSyncKey(self::$decoder->getElementContent());
41
-					}
42
-					catch (StateInvalidException $siex) {
41
+					} catch (StateInvalidException $siex) {
43 42
 						$spastatus = SYNC_GETITEMESTSTATUS_SYNCSTATENOTPRIMED;
44 43
 					}
45 44
 
@@ -149,8 +148,7 @@  discard block
 block discarded – undo
149 148
 			if (!$spa->HasContentClass() && $spa->HasFolderId()) {
150 149
 				try {
151 150
 					$spa->SetContentClass(self::$deviceManager->GetFolderClassFromCacheByID($spa->GetFolderId()));
152
-				}
153
-				catch (NoHierarchyCacheAvailableException $nhca) {
151
+				} catch (NoHierarchyCacheAvailableException $nhca) {
154 152
 					$spastatus = SYNC_GETITEMESTSTATUS_COLLECTIONINVALID;
155 153
 				}
156 154
 			}
@@ -174,22 +172,19 @@  discard block
 block discarded – undo
174 172
 					if (!self::$backend->Setup(GSync::GetAdditionalSyncFolderStore($spa->GetBackendFolderId()))) {
175 173
 						throw new StatusException(sprintf("HandleGetItemEstimate() could not Setup() the backend for folder id %s/%s", $spa->GetFolderId(), $spa->GetBackendFolderId()), SYNC_GETITEMESTSTATUS_COLLECTIONINVALID);
176 174
 					}
177
-				}
178
-				catch (StateNotFoundException $snfex) {
175
+				} catch (StateNotFoundException $snfex) {
179 176
 					// ok, the key is invalid. Question is, if the hierarchycache is still ok
180 177
 					// if not, we have to issue SYNC_GETITEMESTSTATUS_COLLECTIONINVALID which triggers a FolderSync
181 178
 					try {
182 179
 						self::$deviceManager->GetFolderClassFromCacheByID($spa->GetFolderId());
183 180
 						// we got here, so the HierarchyCache is ok
184 181
 						$sc->AddParameter($spa, "status", SYNC_GETITEMESTSTATUS_SYNCKKEYINVALID);
185
-					}
186
-					catch (NoHierarchyCacheAvailableException $nhca) {
182
+					} catch (NoHierarchyCacheAvailableException $nhca) {
187 183
 						$sc->AddParameter($spa, "status", SYNC_GETITEMESTSTATUS_COLLECTIONINVALID);
188 184
 					}
189 185
 
190 186
 					self::$topCollector->AnnounceInformation("StateNotFoundException " . $sc->GetParameter($spa, "status"), true);
191
-				}
192
-				catch (StatusException $stex) {
187
+				} catch (StatusException $stex) {
193 188
 					if ($stex->getCode() == SYNC_GETITEMESTSTATUS_COLLECTIONINVALID) {
194 189
 						$sc->AddParameter($spa, "status", SYNC_GETITEMESTSTATUS_COLLECTIONINVALID);
195 190
 					}
@@ -216,8 +211,7 @@  discard block
 block discarded – undo
216 211
 
217 212
 		try {
218 213
 			$sc->CountChanges();
219
-		}
220
-		catch (StatusException $ste) {
214
+		} catch (StatusException $ste) {
221 215
 			$status = SYNC_GETITEMESTSTATUS_COLLECTIONINVALID;
222 216
 		}
223 217
 		$changes = $sc->GetChangedFolderIds();
Please login to merge, or discard this patch.
lib/request/search.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -352,8 +352,7 @@
 block discarded – undo
352 352
 					$cpo->SetSearchFolderid($backendFolderId);
353 353
 					$rows = $searchprovider->GetMailboxSearchResults($cpo);
354 354
 				}
355
-			}
356
-			catch (StatusException $stex) {
355
+			} catch (StatusException $stex) {
357 356
 				$storestatus = $stex->getCode();
358 357
 			}
359 358
 		}
Please login to merge, or discard this patch.
lib/request/sendmail.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -108,8 +108,7 @@
 block discarded – undo
108 108
 
109 109
 		try {
110 110
 			$status = self::$backend->SendMail($sm);
111
-		}
112
-		catch (StatusException $se) {
111
+		} catch (StatusException $se) {
113 112
 			$status = $se->getCode();
114 113
 			$statusMessage = $se->getMessage();
115 114
 		}
Please login to merge, or discard this patch.
lib/request/sync.php 1 patch
Braces   +17 added lines, -34 removed lines patch added patch discarded remove patch
@@ -141,8 +141,7 @@  discard block
 block discarded – undo
141 141
 							}
142 142
 							$spa->SetSyncKey($synckey);
143 143
 						}
144
-					}
145
-					catch (StateInvalidException $stie) {
144
+					} catch (StateInvalidException $stie) {
146 145
 						$spa = new SyncParameters();
147 146
 						$status = SYNC_STATUS_INVALIDSYNCKEY;
148 147
 						self::$topCollector->AnnounceInformation("State invalid - Resync folder", $this->singleFolder);
@@ -163,8 +162,7 @@  discard block
 block discarded – undo
163 162
 						try {
164 163
 							$spa->SetContentClass(self::$deviceManager->GetFolderClassFromCacheByID($spa->GetFolderId()));
165 164
 							SLog::Write(LOGLEVEL_DEBUG, sprintf("GetFolderClassFromCacheByID from Device Manager: '%s' for id:'%s'", $spa->GetContentClass(), $spa->GetFolderId()));
166
-						}
167
-						catch (NoHierarchyCacheAvailableException $nhca) {
165
+						} catch (NoHierarchyCacheAvailableException $nhca) {
168 166
 							$status = SYNC_STATUS_FOLDERHIERARCHYCHANGED;
169 167
 							self::$deviceManager->ForceFullResync();
170 168
 						}
@@ -563,8 +561,7 @@  discard block
 block discarded – undo
563 561
 							try {
564 562
 								// Save the updated state, which is used for the exporter later
565 563
 								$sc->AddParameter($spa, "state", $this->importer->GetState());
566
-							}
567
-							catch (StatusException $stex) {
564
+							} catch (StatusException $stex) {
568 565
 								$status = $stex->getCode();
569 566
 							}
570 567
 						}
@@ -657,13 +654,11 @@  discard block
 block discarded – undo
657 654
 			// Load all collections - do not overwrite existing (received!), load states, check permissions and only load confirmed states!
658 655
 			try {
659 656
 				$sc->LoadAllCollections(false, true, true, true, true);
660
-			}
661
-			catch (StateInvalidException $siex) {
657
+			} catch (StateInvalidException $siex) {
662 658
 				$status = SYNC_STATUS_INVALIDSYNCKEY;
663 659
 				self::$topCollector->AnnounceInformation("StateNotFoundException", $this->singleFolder);
664 660
 				$this->saveMultiFolderInfo("exception", "StateNotFoundException");
665
-			}
666
-			catch (StatusException $stex) {
661
+			} catch (StatusException $stex) {
667 662
 				$status = SYNC_STATUS_FOLDERHIERARCHYCHANGED;
668 663
 				self::$topCollector->AnnounceInformation(sprintf("StatusException code: %d", $status), $this->singleFolder);
669 664
 				$this->saveMultiFolderInfo("exception", "StatusException");
@@ -730,8 +725,7 @@  discard block
 block discarded – undo
730 725
 					// always check for changes
731 726
 					SLog::Write(LOGLEVEL_DEBUG, sprintf("HandleSync(): Entering Heartbeat mode"));
732 727
 					$foundchanges = $sc->CheckForChanges($sc->GetLifetime(), $interval);
733
-				}
734
-				catch (StatusException $stex) {
728
+				} catch (StatusException $stex) {
735 729
 					if ($stex->getCode() == SyncCollections::OBSOLETE_CONNECTION) {
736 730
 						$status = SYNC_COMMONSTATUS_SYNCSTATEVERSIONINVALID;
737 731
 					}
@@ -875,8 +869,7 @@  discard block
 block discarded – undo
875 869
 							if ($exporter === false) {
876 870
 								throw new StatusException(sprintf("HandleSync() could not get an exporter for folder id %s/%s", $spa->GetFolderId(), $spa->GetBackendFolderId()), SYNC_STATUS_FOLDERHIERARCHYCHANGED);
877 871
 							}
878
-						}
879
-						catch (StatusException $stex) {
872
+						} catch (StatusException $stex) {
880 873
 							$status = $stex->getCode();
881 874
 						}
882 875
 
@@ -891,8 +884,7 @@  discard block
 block discarded – undo
891 884
 
892 885
 								$changecount = $exporter->GetChangeCount();
893 886
 							}
894
-						}
895
-						catch (StatusException $stex) {
887
+						} catch (StatusException $stex) {
896 888
 							if ($stex->getCode() === SYNC_FSSTATUS_CODEUNKNOWN && $spa->HasSyncKey()) {
897 889
 								$status = SYNC_STATUS_INVALIDSYNCKEY;
898 890
 							}
@@ -1150,8 +1142,7 @@  discard block
 block discarded – undo
1150 1142
 						SLog::Write(LOGLEVEL_DEBUG, sprintf("HandleSync(): message not to be streamed as requested by DeviceManager, id = %s", $id));
1151 1143
 						$fetchstatus = SYNC_STATUS_CLIENTSERVERCONVERSATIONERROR;
1152 1144
 					}
1153
-				}
1154
-				catch (StatusException $stex) {
1145
+				} catch (StatusException $stex) {
1155 1146
 					$fetchstatus = $stex->getCode();
1156 1147
 				}
1157 1148
 
@@ -1215,8 +1206,7 @@  discard block
 block discarded – undo
1215 1206
 					if ($n % 10 == 0) {
1216 1207
 						self::$topCollector->AnnounceInformation(sprintf("Streamed data of %d objects out of %d", $n, (($changecount > $windowSize) ? $windowSize : $changecount)));
1217 1208
 					}
1218
-				}
1219
-				catch (SyncObjectBrokenException $mbe) {
1209
+				} catch (SyncObjectBrokenException $mbe) {
1220 1210
 					$brokenSO = $mbe->GetSyncObject();
1221 1211
 					if (!$brokenSO) {
1222 1212
 						SLog::Write(LOGLEVEL_ERROR, sprintf("HandleSync(): Caught SyncObjectBrokenException but broken SyncObject not available. This should be fixed in the backend."));
@@ -1316,8 +1306,7 @@  discard block
 block discarded – undo
1316 1306
 				elseif (!$spa->HasSyncKey()) {
1317 1307
 					$state = "";
1318 1308
 				}
1319
-			}
1320
-			catch (StatusException $stex) {
1309
+			} catch (StatusException $stex) {
1321 1310
 				$status = $stex->getCode();
1322 1311
 			}
1323 1312
 
@@ -1365,13 +1354,11 @@  discard block
 block discarded – undo
1365 1354
 				if (!self::$backend->Setup(GSync::GetAdditionalSyncFolderStore($spa->GetBackendFolderId()))) {
1366 1355
 					throw new StatusException(sprintf("HandleSync() could not Setup() the backend for folder id %s/%s", $spa->GetFolderId(), $spa->GetBackendFolderId()), SYNC_STATUS_FOLDERHIERARCHYCHANGED);
1367 1356
 				}
1368
-			}
1369
-			catch (StateNotFoundException $snfex) {
1357
+			} catch (StateNotFoundException $snfex) {
1370 1358
 				$status = SYNC_STATUS_INVALIDSYNCKEY;
1371 1359
 				self::$topCollector->AnnounceInformation("StateNotFoundException", $this->singleFolder);
1372 1360
 				$this->saveMultiFolderInfo("exception", "StateNotFoundException");
1373
-			}
1374
-			catch (StatusException $stex) {
1361
+			} catch (StatusException $stex) {
1375 1362
 				$status = $stex->getCode();
1376 1363
 				self::$topCollector->AnnounceInformation(sprintf("StatusException code: %d", $status), $this->singleFolder);
1377 1364
 				$this->saveMultiFolderInfo("exception", "StateNotFoundException");
@@ -1420,8 +1407,7 @@  discard block
 block discarded – undo
1420 1407
 				$this->importer->ConfigContentParameters($spa->GetCPO());
1421 1408
 				$this->importer->LoadConflicts($spa->GetCPO(), $sc->GetParameter($spa, "state"));
1422 1409
 			}
1423
-		}
1424
-		catch (StatusException $stex) {
1410
+		} catch (StatusException $stex) {
1425 1411
 			$status = $stex->getCode();
1426 1412
 		}
1427 1413
 
@@ -1521,8 +1507,7 @@  discard block
 block discarded – undo
1521 1507
 
1522 1508
 							$actiondata["statusids"][$serverid] = SYNC_STATUS_SUCCESS;
1523 1509
 						}
1524
-					}
1525
-					catch (StatusException $stex) {
1510
+					} catch (StatusException $stex) {
1526 1511
 						$actiondata["statusids"][$serverid] = $stex->getCode();
1527 1512
 					}
1528 1513
 					break;
@@ -1552,8 +1537,7 @@  discard block
 block discarded – undo
1552 1537
 							$actiondata["clientids"][$clientid] = $this->importer->ImportMessageChange(false, $message);
1553 1538
 							$actiondata["statusids"][$clientid] = SYNC_STATUS_SUCCESS;
1554 1539
 						}
1555
-					}
1556
-					catch (StatusException $stex) {
1540
+					} catch (StatusException $stex) {
1557 1541
 						$actiondata["statusids"][$clientid] = $stex->getCode();
1558 1542
 					}
1559 1543
 					break;
@@ -1587,8 +1571,7 @@  discard block
 block discarded – undo
1587 1571
 							$this->importer->ImportMessageDeletion($serverid);
1588 1572
 							$actiondata["statusids"][$serverid] = SYNC_STATUS_SUCCESS;
1589 1573
 						}
1590
-					}
1591
-					catch (StatusException $stex) {
1574
+					} catch (StatusException $stex) {
1592 1575
 						if ($stex->getCode() != SYNC_MOVEITEMSSTATUS_SUCCESS) {
1593 1576
 							$actiondata["statusids"][$serverid] = SYNC_STATUS_OBJECTNOTFOUND;
1594 1577
 						}
Please login to merge, or discard this patch.
lib/grommunio/mapiphpwrapper.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -117,8 +117,7 @@
 block discarded – undo
117 117
 					return SYNC_E_IGNORE;
118 118
 				}
119 119
 			}
120
-		}
121
-		catch (SyncObjectBrokenException $mbe) {
120
+		} catch (SyncObjectBrokenException $mbe) {
122 121
 			$brokenSO = $mbe->GetSyncObject();
123 122
 			if (!$brokenSO) {
124 123
 				SLog::Write(LOGLEVEL_ERROR, sprintf("PHPWrapper->ImportMessageChange(): Caught SyncObjectBrokenException but broken SyncObject available"));
Please login to merge, or discard this patch.