Passed
Branch master (f497d2)
by Mike
03:18
created
lib/core/synccollections.php 1 patch
Braces   +11 added lines, -22 removed lines patch added patch discarded remove patch
@@ -60,8 +60,7 @@  discard block
 block discarded – undo
60 60
 			}
61 61
 
62 62
 			return true;
63
-		}
64
-		catch (GSyncException $e) {
63
+		} catch (GSyncException $e) {
65 64
 		}
66 65
 
67 66
 		return false;
@@ -165,8 +164,7 @@  discard block
 block discarded – undo
165 164
 
166 165
 				return true;
167 166
 			}
168
-		}
169
-		catch (StateInvalidException $sive) {
167
+		} catch (StateInvalidException $sive) {
170 168
 			// in case there is something wrong with the state, just stop here
171 169
 			// later when trying to retrieve the SyncParameters nothing will be found
172 170
 
@@ -193,8 +191,7 @@  discard block
 block discarded – undo
193 191
 			try {
194 192
 				// make sure the hierarchy cache is loaded when we are loading hierarchy states
195 193
 				$this->addparms[$folderid]["state"] = $this->stateManager->GetSyncState($spa->GetLatestSyncKey($confirmedOnly), ($folderid === false));
196
-			}
197
-			catch (StateNotFoundException $snfe) {
194
+			} catch (StateNotFoundException $snfe) {
198 195
 				// if we can't find the state, first we should try a sync of that folder, so
199 196
 				// we generate a fake change, so a sync on this folder is triggered
200 197
 				$this->changes[$folderid] = 1;
@@ -387,8 +384,7 @@  discard block
 block discarded – undo
387 384
 		// take the requested global windowsize or the max 512 if not defined
388 385
 		if (isset($this->globalWindowSize)) {
389 386
 			$globalWindowSize = $this->globalWindowSize;
390
-		}
391
-		else {
387
+		} else {
392 388
 			$globalWindowSize = WINDOW_SIZE_MAX; // 512 by default
393 389
 		}
394 390
 
@@ -476,19 +472,16 @@  discard block
 block discarded – undo
476 472
 		}
477 473
 		if (empty($classes)) {
478 474
 			$checkClasses = "policies only";
479
-		}
480
-		elseif (array_sum($classes) > 4) {
475
+		} elseif (array_sum($classes) > 4) {
481 476
 			$checkClasses = "";
482 477
 			foreach ($classes as $class => $count) {
483 478
 				if ($count == 1) {
484 479
 					$checkClasses .= sprintf("%s ", $class);
485
-				}
486
-				else {
480
+				} else {
487 481
 					$checkClasses .= sprintf("%s(%d) ", $class, $count);
488 482
 				}
489 483
 			}
490
-		}
491
-		else {
484
+		} else {
492 485
 			$checkClasses = implode(" ", array_keys($classes));
493 486
 		}
494 487
 
@@ -601,8 +594,7 @@  discard block
 block discarded – undo
601 594
 						if ($this->countHierarchyChange(true)) {
602 595
 							throw new StatusException("SyncCollections->CheckForChanges(): HierarchySync required.", self::HIERARCHY_CHANGED);
603 596
 						}
604
-					}
605
-					else {
597
+					} else {
606 598
 						// the backend will notify on the backend folderid
607 599
 						$folderid = GSync::GetDeviceManager()->GetFolderIdForBackendId($backendFolderId);
608 600
 
@@ -611,8 +603,7 @@  discard block
 block discarded – undo
611 603
 							SLog::Write(LOGLEVEL_DEBUG, sprintf("SyncCollections->CheckForChanges(): Notification received on folder '%s'", $folderid));
612 604
 							$validNotifications = true;
613 605
 							$this->waitingTime = time() - $started;
614
-						}
615
-						else {
606
+						} else {
616 607
 							SLog::Write(LOGLEVEL_DEBUG, sprintf("SyncCollections->CheckForChanges(): Notification received on folder '%s', but it is not relevant", $folderid));
617 608
 						}
618 609
 					}
@@ -698,8 +689,7 @@  discard block
 block discarded – undo
698 689
 					$changecount = $exporter->GetChangeCount();
699 690
 				}
700 691
 			}
701
-		}
702
-		catch (StatusException $ste) {
692
+		} catch (StatusException $ste) {
703 693
 			if ($ste->getCode() == SYNC_STATUS_FOLDERHIERARCHYCHANGED) {
704 694
 				SLog::Write(LOGLEVEL_WARN, "SyncCollections->CountChange(): exporter can not be re-configured due to state error, emulating change in folder to force Sync.");
705 695
 				$this->changes[$folderid] = 1;
@@ -767,8 +757,7 @@  discard block
 block discarded – undo
767 757
 
768 758
 					$this->hierarchyExporterChecked = true;
769 759
 				}
770
-			}
771
-			catch (StatusException $ste) {
760
+			} catch (StatusException $ste) {
772 761
 				throw new StatusException("SyncCollections->countHierarchyChange(): exporter can not be re-configured.", self::ERROR_WRONG_HIERARCHY, null, LOGLEVEL_WARN);
773 762
 			}
774 763
 
Please login to merge, or discard this patch.
lib/core/streamimporter.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -90,8 +90,7 @@  discard block
 block discarded – undo
90 90
 
91 91
 		if ($message->flags === false || $message->flags === SYNC_NEWMESSAGE) {
92 92
 			$this->encoder->startTag(SYNC_ADD);
93
-		}
94
-		else {
93
+		} else {
95 94
 			// on update of an SyncEmail we only export the flags and categories
96 95
 			if ($message instanceof SyncMail && ((isset($message->flag) && $message->flag instanceof SyncMailFlags) || isset($message->categories))) {
97 96
 				$newmessage = new SyncMail();
@@ -144,8 +143,7 @@  discard block
 block discarded – undo
144 143
 		++$this->importedMsgs;
145 144
 		if ($asSoftDelete) {
146 145
 			$this->encoder->startTag(SYNC_SOFTDELETE);
147
-		}
148
-		else {
146
+		} else {
149 147
 			$this->encoder->startTag(SYNC_REMOVE);
150 148
 		}
151 149
 		$this->encoder->startTag(SYNC_SERVERENTRYID);
@@ -227,8 +225,7 @@  discard block
 block discarded – undo
227 225
 		// send a modify flag if the folder is already known on the device
228 226
 		if (isset($folder->flags) && $folder->flags === SYNC_NEWMESSAGE) {
229 227
 			$this->encoder->startTag(SYNC_FOLDERHIERARCHY_ADD);
230
-		}
231
-		else {
228
+		} else {
232 229
 			$this->encoder->startTag(SYNC_FOLDERHIERARCHY_UPDATE);
233 230
 		}
234 231
 
Please login to merge, or discard this patch.
lib/core/streamer.php 1 patch
Braces   +26 added lines, -52 removed lines patch added patch discarded remove patch
@@ -70,14 +70,11 @@  discard block
 block discarded – undo
70 70
 					$map = $this->mapping[$entity[EN_TAG]];
71 71
 					if (isset($map[self::STREAMER_ARRAY])) {
72 72
 						$this->{$map[self::STREAMER_VAR]} = [];
73
-					}
74
-					elseif (isset($map[self::STREAMER_PROP]) && $map[self::STREAMER_PROP] == self::STREAMER_TYPE_SEND_EMPTY) {
73
+					} elseif (isset($map[self::STREAMER_PROP]) && $map[self::STREAMER_PROP] == self::STREAMER_TYPE_SEND_EMPTY) {
75 74
 						$this->{$map[self::STREAMER_VAR]} = "1";
76
-					}
77
-					elseif (!isset($map[self::STREAMER_TYPE])) {
75
+					} elseif (!isset($map[self::STREAMER_TYPE])) {
78 76
 						$this->{$map[self::STREAMER_VAR]} = "";
79
-					}
80
-					elseif ($map[self::STREAMER_TYPE] == self::STREAMER_TYPE_DATE || $map[self::STREAMER_TYPE] == self::STREAMER_TYPE_DATE_DASHES) {
77
+					} elseif ($map[self::STREAMER_TYPE] == self::STREAMER_TYPE_DATE || $map[self::STREAMER_TYPE] == self::STREAMER_TYPE_DATE_DASHES) {
81 78
 						$this->{$map[self::STREAMER_VAR]} = "";
82 79
 					}
83 80
 
@@ -107,15 +104,13 @@  discard block
 block discarded – undo
107 104
 							$decoded = new $map[self::STREAMER_TYPE]();
108 105
 
109 106
 							$decoded->Decode($decoder);
110
-						}
111
-						else {
107
+						} else {
112 108
 							$decoded = $decoder->getElementContent();
113 109
 						}
114 110
 
115 111
 						if (!isset($this->{$map[self::STREAMER_VAR]})) {
116 112
 							$this->{$map[self::STREAMER_VAR]} = [$decoded];
117
-						}
118
-						else {
113
+						} else {
119 114
 							array_push($this->{$map[self::STREAMER_VAR]}, $decoded);
120 115
 						}
121 116
 
@@ -144,8 +139,7 @@  discard block
 block discarded – undo
144 139
 							return false;
145 140
 						}
146 141
 					}
147
-				}
148
-				else { // Handle single value
142
+				} else { // Handle single value
149 143
 					if (isset($map[self::STREAMER_TYPE])) {
150 144
 						// Complex type, decode recursively
151 145
 						if ($map[self::STREAMER_TYPE] == self::STREAMER_TYPE_DATE || $map[self::STREAMER_TYPE] == self::STREAMER_TYPE_DATE_DASHES) {
@@ -153,8 +147,7 @@  discard block
 block discarded – undo
153 147
 							if (!$decoder->getElementEndTag()) {
154 148
 								return false;
155 149
 							}
156
-						}
157
-						elseif ($map[self::STREAMER_TYPE] == self::STREAMER_TYPE_HEX) {
150
+						} elseif ($map[self::STREAMER_TYPE] == self::STREAMER_TYPE_HEX) {
158 151
 							$decoded = hex2bin($decoder->getElementContent());
159 152
 							if (!$decoder->getElementEndTag()) {
160 153
 								return false;
@@ -167,14 +160,12 @@  discard block
 block discarded – undo
167 160
 							if (!$decoder->getElementEndTag()) {
168 161
 								return false;
169 162
 							}
170
-						}
171
-						elseif ($map[self::STREAMER_TYPE] == self::STREAMER_TYPE_STREAM_ASPLAIN) {
163
+						} elseif ($map[self::STREAMER_TYPE] == self::STREAMER_TYPE_STREAM_ASPLAIN) {
172 164
 							$decoded = StringStreamWrapper::Open($decoder->getElementContent());
173 165
 							if (!$decoder->getElementEndTag()) {
174 166
 								return false;
175 167
 							}
176
-						}
177
-						else {
168
+						} else {
178 169
 							$subdecoder = new $map[self::STREAMER_TYPE]();
179 170
 							if ($subdecoder->Decode($decoder) === false) {
180 171
 								return false;
@@ -188,8 +179,7 @@  discard block
 block discarded – undo
188 179
 								return false;
189 180
 							}
190 181
 						}
191
-					}
192
-					else {
182
+					} else {
193 183
 						// Simple type, just get content
194 184
 						$decoded = $decoder->getElementContent();
195 185
 
@@ -208,13 +198,11 @@  discard block
 block discarded – undo
208 198
 					// $decoded now contains data object (or string)
209 199
 					$this->{$map[self::STREAMER_VAR]} = $decoded;
210 200
 				}
211
-			}
212
-			elseif ($entity[EN_TYPE] == EN_TYPE_ENDTAG) {
201
+			} elseif ($entity[EN_TYPE] == EN_TYPE_ENDTAG) {
213 202
 				$decoder->ungetElement($entity);
214 203
 
215 204
 				break;
216
-			}
217
-			else {
205
+			} else {
218 206
 				SLog::Write(LOGLEVEL_WBXMLSTACK, "Unexpected content in type");
219 207
 
220 208
 				break;
@@ -243,8 +231,7 @@  discard block
 block discarded – undo
243 231
 						if (!$res && isset($map[self::STREAMER_PROP]) && $map[self::STREAMER_PROP] == self::STREAMER_TYPE_SEND_EMPTY) {
244 232
 							$encoder->startTag($tag, false, true);
245 233
 						}
246
-					}
247
-					else {
234
+					} else {
248 235
 						SLog::Write(LOGLEVEL_ERROR, sprintf("Streamer->Encode(): parameter '%s' of object %s is not of type Streamer", $map[self::STREAMER_VAR], get_class($this)));
249 236
 					}
250 237
 				}
@@ -252,8 +239,7 @@  discard block
 block discarded – undo
252 239
 				elseif (isset($map[self::STREAMER_ARRAY])) {
253 240
 					if (empty($this->{$map[self::STREAMER_VAR]}) && isset($map[self::STREAMER_PROP]) && $map[self::STREAMER_PROP] == self::STREAMER_TYPE_SEND_EMPTY) {
254 241
 						$encoder->startTag($tag, false, true);
255
-					}
256
-					else {
242
+					} else {
257 243
 						// Outputs array container (eg Attachments)
258 244
 						// Do not output start and end tag when type is STREAMER_TYPE_NO_CONTAINER
259 245
 						if (!isset($map[self::STREAMER_PROP]) || $map[self::STREAMER_PROP] != self::STREAMER_TYPE_NO_CONTAINER) {
@@ -265,8 +251,7 @@  discard block
 block discarded – undo
265 251
 								$encoder->startTag($map[self::STREAMER_ARRAY]); // Outputs object container (eg Attachment)
266 252
 								$element->Encode($encoder);
267 253
 								$encoder->endTag();
268
-							}
269
-							else {
254
+							} else {
270 255
 								if (strlen($element) == 0)
271 256
 									  // Do not output empty items. Not sure if we should output an empty tag with $encoder->startTag($map[self::STREAMER_ARRAY], false, true);
272 257
 									  ; else {
@@ -282,8 +267,7 @@  discard block
 block discarded – undo
282 267
 							$encoder->endTag();
283 268
 						}
284 269
 					}
285
-				}
286
-				else {
270
+				} else {
287 271
 					if (isset($map[self::STREAMER_TYPE]) && $map[self::STREAMER_TYPE] == self::STREAMER_TYPE_IGNORE) {
288 272
 						continue;
289 273
 					}
@@ -313,14 +297,11 @@  discard block
 block discarded – undo
313 297
 						if ($this->{$map[self::STREAMER_VAR]} != 0) { // don't output 1-1-1970
314 298
 							$encoder->content($this->formatDate($this->{$map[self::STREAMER_VAR]}, $map[self::STREAMER_TYPE]));
315 299
 						}
316
-					}
317
-					elseif (isset($map[self::STREAMER_TYPE]) && $map[self::STREAMER_TYPE] == self::STREAMER_TYPE_HEX) {
300
+					} elseif (isset($map[self::STREAMER_TYPE]) && $map[self::STREAMER_TYPE] == self::STREAMER_TYPE_HEX) {
318 301
 						$encoder->content(strtoupper(bin2hex($this->{$map[self::STREAMER_VAR]})));
319
-					}
320
-					elseif (isset($map[self::STREAMER_TYPE]) && $map[self::STREAMER_TYPE] == self::STREAMER_TYPE_STREAM_ASPLAIN) {
302
+					} elseif (isset($map[self::STREAMER_TYPE]) && $map[self::STREAMER_TYPE] == self::STREAMER_TYPE_STREAM_ASPLAIN) {
321 303
 						$encoder->contentStream($this->{$map[self::STREAMER_VAR]}, false);
322
-					}
323
-					elseif (isset($map[self::STREAMER_TYPE]) && ($map[self::STREAMER_TYPE] == self::STREAMER_TYPE_STREAM_ASBASE64 || $map[self::STREAMER_TYPE] == self::STREAMER_TYPE_STREAM)) {
304
+					} elseif (isset($map[self::STREAMER_TYPE]) && ($map[self::STREAMER_TYPE] == self::STREAMER_TYPE_STREAM_ASBASE64 || $map[self::STREAMER_TYPE] == self::STREAMER_TYPE_STREAM)) {
324 305
 						$encoder->contentStream($this->{$map[self::STREAMER_VAR]}, true);
325 306
 					}
326 307
 					// implode comma or semicolon arrays into a string
@@ -328,8 +309,7 @@  discard block
 block discarded – undo
328 309
 						($map[self::STREAMER_TYPE] == self::STREAMER_TYPE_COMMA_SEPARATED || $map[self::STREAMER_TYPE] == self::STREAMER_TYPE_SEMICOLON_SEPARATED)) {
329 310
 						$glue = ($map[self::STREAMER_TYPE] == self::STREAMER_TYPE_COMMA_SEPARATED) ? ", " : "; ";
330 311
 						$encoder->content(implode($glue, $this->{$map[self::STREAMER_VAR]}));
331
-					}
332
-					else {
312
+					} else {
333 313
 						$encoder->content($this->{$map[self::STREAMER_VAR]});
334 314
 					}
335 315
 					$encoder->endTag();
@@ -357,27 +337,22 @@  discard block
 block discarded – undo
357 337
 			if (isset($this->{$v[self::STREAMER_VAR]})) {
358 338
 				if (is_object($this->{$v[self::STREAMER_VAR]}) && method_exists($this->{$v[self::STREAMER_VAR]}, "StripData")) {
359 339
 					$this->{$v[self::STREAMER_VAR]}->StripData($flags);
360
-				}
361
-				elseif (isset($v[self::STREAMER_ARRAY]) && !empty($this->{$v[self::STREAMER_VAR]})) {
340
+				} elseif (isset($v[self::STREAMER_ARRAY]) && !empty($this->{$v[self::STREAMER_VAR]})) {
362 341
 					foreach ($this->{$v[self::STREAMER_VAR]} as $element) {
363 342
 						if (is_object($element) && method_exists($element, "StripData")) {
364 343
 							$element->StripData($flags);
365
-						}
366
-						elseif ($flags === Streamer::STRIP_PRIVATE_DATA && isset($v[self::STREAMER_PRIVATE])) {
344
+						} elseif ($flags === Streamer::STRIP_PRIVATE_DATA && isset($v[self::STREAMER_PRIVATE])) {
367 345
 							if ($v[self::STREAMER_PRIVATE] !== true) {
368 346
 								$this->{$v[self::STREAMER_VAR]} = $v[self::STREAMER_PRIVATE];
369
-							}
370
-							else {
347
+							} else {
371 348
 								unset($this->{$v[self::STREAMER_VAR]});
372 349
 							}
373 350
 						}
374 351
 					}
375
-				}
376
-				elseif ($flags === Streamer::STRIP_PRIVATE_DATA && isset($v[self::STREAMER_PRIVATE])) {
352
+				} elseif ($flags === Streamer::STRIP_PRIVATE_DATA && isset($v[self::STREAMER_PRIVATE])) {
377 353
 					if ($v[self::STREAMER_PRIVATE] !== true) {
378 354
 						$this->{$v[self::STREAMER_VAR]} = $v[self::STREAMER_PRIVATE];
379
-					}
380
-					else {
355
+					} else {
381 356
 						unset($this->{$v[self::STREAMER_VAR]});
382 357
 					}
383 358
 				}
@@ -436,8 +411,7 @@  discard block
 block discarded – undo
436 411
 				SLog::Write(LOGLEVEL_DEBUG, sprintf("Streamer->jsonDeserialize(): top class '%s'", $v->gsSyncStateClass));
437 412
 				$this->{$k} = new $v->gsSyncStateClass();
438 413
 				$this->{$k}->jsonDeserialize($v);
439
-			}
440
-			else {
414
+			} else {
441 415
 				$this->{$k} = $v;
442 416
 			}
443 417
 		}
Please login to merge, or discard this patch.
lib/core/slog.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -63,8 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
 		try {
65 65
 			self::getLogger()->Log($loglevel, $message);
66
-		}
67
-		catch (\Exception $e) {
66
+		} catch (\Exception $e) {
68 67
 			// @TODO How should we handle logging error ?
69 68
 			// Ignore any error.
70 69
 		}
@@ -126,8 +125,7 @@  discard block
 block discarded – undo
126 125
 			// if there is an impersonated user it's used instead of the GET user
127 126
 			if (Request::GetImpersonatedUser()) {
128 127
 				$user = Request::GetImpersonatedUser();
129
-			}
130
-			else {
128
+			} else {
131 129
 				list($user) = Utils::SplitDomainUser(strtolower(Request::GetGETUser()));
132 130
 			}
133 131
 
Please login to merge, or discard this patch.
lib/wbxml/wbxmldecoder.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -33,8 +33,7 @@  discard block
 block discarded – undo
33 33
 	public static function InWhile($name) {
34 34
 		if (!isset(self::$loopCounter[$name])) {
35 35
 			self::$loopCounter[$name] = 0;
36
-		}
37
-		else {
36
+		} else {
38 37
 			++self::$loopCounter[$name];
39 38
 		}
40 39
 
@@ -119,8 +118,7 @@  discard block
 block discarded – undo
119 118
 					}
120 119
 					if ($next[EN_TYPE] == EN_CONTENT) {
121 120
 						$element[EN_CONTENT] .= $next[EN_CONTENT];
122
-					}
123
-					else {
121
+					} else {
124 122
 						$this->ungetElement($next);
125 123
 
126 124
 						break;
@@ -293,8 +291,7 @@  discard block
 block discarded – undo
293 291
 				if ($el[EN_FLAGS] & EN_FLAGS_CONTENT) {
294 292
 					SLog::Write(LOGLEVEL_WBXML, "I " . $spaces . " <" . $el[EN_TAG] . ">");
295 293
 					array_push($this->logStack, $el[EN_TAG]);
296
-				}
297
-				else {
294
+				} else {
298 295
 					SLog::Write(LOGLEVEL_WBXML, "I " . $spaces . " <" . $el[EN_TAG] . "/>");
299 296
 				}
300 297
 				break;
@@ -311,8 +308,7 @@  discard block
 block discarded – undo
311 308
 				$messagesize = strlen($el[EN_CONTENT]);
312 309
 				if ($messagesize > 10240 && !defined('WBXML_DEBUGGING')) {
313 310
 					$content = substr($el[EN_CONTENT], 0, 10240) . sprintf(" <log message with %d bytes truncated>", $messagesize);
314
-				}
315
-				else {
311
+				} else {
316 312
 					$content = $el[EN_CONTENT];
317 313
 				}
318 314
 				// Log but make sure it's not truncated again (will be slightly bigger than 10KB)
@@ -467,8 +463,7 @@  discard block
 block discarded – undo
467 463
 
468 464
 			if ($byte & 0x80) {
469 465
 				$uint = $uint << 7;
470
-			}
471
-			else {
466
+			} else {
472 467
 				break;
473 468
 			}
474 469
 		}
Please login to merge, or discard this patch.
lib/wbxml/wbxmlencoder.php 1 patch
Braces   +9 added lines, -18 removed lines patch added patch discarded remove patch
@@ -53,8 +53,7 @@  discard block
 block discarded – undo
53 53
 		if ($this->multipart) {
54 54
 			header("Content-Type: application/vnd.ms-sync.multipart");
55 55
 			SLog::Write(LOGLEVEL_DEBUG, "WBXMLEncoder->startWBXML() type: vnd.ms-sync.multipart");
56
-		}
57
-		else {
56
+		} else {
58 57
 			header("Content-Type: application/vnd.ms-sync.wbxml");
59 58
 			SLog::Write(LOGLEVEL_DEBUG, "WBXMLEncoder->startWBXML() type: vnd.ms-sync.wbxml");
60 59
 		}
@@ -86,8 +85,7 @@  discard block
 block discarded – undo
86 85
 
87 86
 		// If 'nocontent' is specified, then apparently the user wants to force
88 87
 			// output of an empty tag, and we therefore output the stack here
89
-		}
90
-		else {
88
+		} else {
91 89
 			$this->_outputStack();
92 90
 			$this->_startTag($tag, $nocontent);
93 91
 		}
@@ -274,8 +272,7 @@  discard block
 block discarded – undo
274 272
 		if ($opaque) {
275 273
 			$this->outByte(self::WBXML_OPAQUE);
276 274
 			$this->outMBUInt($stat['size']);
277
-		}
278
-		else {
275
+		} else {
279 276
 			$this->outByte(self::WBXML_STR_I);
280 277
 		}
281 278
 
@@ -344,8 +341,7 @@  discard block
 block discarded – undo
344 341
 			$uint = $uint >> 7;
345 342
 			if ($i == 0) {
346 343
 				$out = chr($byte) . $out;
347
-			}
348
-			else {
344
+			} else {
349 345
 				$out = chr($byte | 0x80) . $out;
350 346
 			}
351 347
 		}
@@ -390,8 +386,7 @@  discard block
 block discarded – undo
390 386
 
391 387
 		if (isset($split["ns"])) {
392 388
 			$cp = $this->_dtd["namespaces"][$split["ns"]];
393
-		}
394
-		else {
389
+		} else {
395 390
 			$cp = 0;
396 391
 		}
397 392
 
@@ -417,8 +412,7 @@  discard block
 block discarded – undo
417 412
 		if ($pos) {
418 413
 			$ns = substr($fulltag, 0, $pos);
419 414
 			$tag = substr($fulltag, $pos + 1);
420
-		}
421
-		else {
415
+		} else {
422 416
 			$tag = $fulltag;
423 417
 		}
424 418
 
@@ -443,8 +437,7 @@  discard block
 block discarded – undo
443 437
 		$spaces = str_repeat(" ", count($this->logStack));
444 438
 		if ($nocontent) {
445 439
 			SLog::Write(LOGLEVEL_WBXML, "O " . $spaces . " <{$tag}/>");
446
-		}
447
-		else {
440
+		} else {
448 441
 			array_push($this->logStack, $tag);
449 442
 			SLog::Write(LOGLEVEL_WBXML, "O " . $spaces . " <{$tag}>");
450 443
 		}
@@ -509,11 +502,9 @@  discard block
 block discarded – undo
509 502
 	private function writeLog() {
510 503
 		if (ob_get_length() === false) {
511 504
 			$data = "output buffer disabled";
512
-		}
513
-		elseif (ob_get_length() < 524288) {
505
+		} elseif (ob_get_length() < 524288) {
514 506
 			$data = base64_encode(ob_get_contents());
515
-		}
516
-		else {
507
+		} else {
517 508
 			$data = "more than 512K of data";
518 509
 		}
519 510
 		SLog::Write(LOGLEVEL_WBXML, "WBXML-OUT: " . $data, false);
Please login to merge, or discard this patch.
lib/utils/compat.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -207,8 +207,7 @@
 block discarded – undo
207 207
 			header($protocol . ' ' . $code . ' ' . $text);
208 208
 
209 209
 			$GLOBALS['http_response_code'] = $code;
210
-		}
211
-		else {
210
+		} else {
212 211
 			$code = (isset($GLOBALS['http_response_code']) ? $GLOBALS['http_response_code'] : 200);
213 212
 		}
214 213
 
Please login to merge, or discard this patch.
lib/utils/timezoneutil.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1120,8 +1120,7 @@
 block discarded – undo
1120 1120
 		SLog::Write(LOGLEVEL_DEBUG, "TimezoneUtil::FillTZNames() filling up bias " . $tz["bias"]);
1121 1121
 		if (!isset($tz["bias"])) {
1122 1122
 			SLog::Write(LOGLEVEL_WARN, "TimezoneUtil::FillTZNames() submitted TZ array does not have a bias");
1123
-		}
1124
-		else {
1123
+		} else {
1125 1124
 			$tzname = self::guessTZNameFromOffset($tz);
1126 1125
 			$tz['tzname'] = $tz['tznamedst'] = self::encodeTZName(self::getMSTZnameFromTZName($tzname));
1127 1126
 		}
Please login to merge, or discard this patch.
lib/utils/stringstreamwrapper.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -87,11 +87,9 @@
 block discarded – undo
87 87
 	public function stream_seek($offset, $whence = SEEK_SET) {
88 88
 		if ($whence == SEEK_CUR) {
89 89
 			$this->position += $offset;
90
-		}
91
-		elseif ($whence == SEEK_END) {
90
+		} elseif ($whence == SEEK_END) {
92 91
 			$this->position = $this->stringlength + $offset;
93
-		}
94
-		else {
92
+		} else {
95 93
 			$this->position = $offset;
96 94
 		}
97 95
 
Please login to merge, or discard this patch.