Passed
Push — master ( 21b7e5...813bdc )
by Christoph
12:53 queued 10s
created
apps/dav/lib/Connector/Sabre/FilesPlugin.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 		$this->server->on('propPatch', [$this, 'handleUpdateProperties']);
179 179
 		$this->server->on('afterBind', [$this, 'sendFileIdHeader']);
180 180
 		$this->server->on('afterWriteContent', [$this, 'sendFileIdHeader']);
181
-		$this->server->on('afterMethod:GET', [$this,'httpGet']);
181
+		$this->server->on('afterMethod:GET', [$this, 'httpGet']);
182 182
 		$this->server->on('afterMethod:GET', [$this, 'handleDownloadToken']);
183 183
 		$this->server->on('afterResponse', function($request, ResponseInterface $response) {
184 184
 			$body = $response->getBody();
@@ -208,11 +208,11 @@  discard block
 block discarded – undo
208 208
 		if ($sourceDir !== $destinationDir) {
209 209
 			$sourceNodeFileInfo = $sourceNode->getFileInfo();
210 210
 			if ($sourceNodeFileInfo === null) {
211
-				throw new NotFound($source . ' does not exist');
211
+				throw new NotFound($source.' does not exist');
212 212
 			}
213 213
 
214 214
 			if (!$sourceNodeFileInfo->isDeletable()) {
215
-				throw new Forbidden($source . " cannot be deleted");
215
+				throw new Forbidden($source." cannot be deleted");
216 216
 			}
217 217
 		}
218 218
 	}
@@ -265,10 +265,10 @@  discard block
 block discarded – undo
265 265
 					Request::USER_AGENT_ANDROID_MOBILE_CHROME,
266 266
 					Request::USER_AGENT_FREEBOX,
267 267
 				])) {
268
-				$response->addHeader('Content-Disposition', 'attachment; filename="' . rawurlencode($filename) . '"');
268
+				$response->addHeader('Content-Disposition', 'attachment; filename="'.rawurlencode($filename).'"');
269 269
 			} else {
270
-				$response->addHeader('Content-Disposition', 'attachment; filename*=UTF-8\'\'' . rawurlencode($filename)
271
-													 . '; filename="' . rawurlencode($filename) . '"');
270
+				$response->addHeader('Content-Disposition', 'attachment; filename*=UTF-8\'\''.rawurlencode($filename)
271
+													 . '; filename="'.rawurlencode($filename).'"');
272 272
 			}
273 273
 		}
274 274
 
@@ -357,13 +357,13 @@  discard block
 block discarded – undo
357 357
 				}
358 358
 			});
359 359
 
360
-			$propFind->handle(self::HAS_PREVIEW_PROPERTYNAME, function () use ($node) {
360
+			$propFind->handle(self::HAS_PREVIEW_PROPERTYNAME, function() use ($node) {
361 361
 				return json_encode($this->previewManager->isAvailable($node->getFileInfo()));
362 362
 			});
363 363
 			$propFind->handle(self::SIZE_PROPERTYNAME, function() use ($node) {
364 364
 				return $node->getSize();
365 365
 			});
366
-			$propFind->handle(self::MOUNT_TYPE_PROPERTYNAME, function () use ($node) {
366
+			$propFind->handle(self::MOUNT_TYPE_PROPERTYNAME, function() use ($node) {
367 367
 				return $node->getFileInfo()->getMountPoint()->getMountType();
368 368
 			});
369 369
 
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
 			list($path, $name) = \Sabre\Uri\split($filePath);
504 504
 			$info = \OC_FileChunking::decodeName($name);
505 505
 			if (!empty($info)) {
506
-				$filePath = $path . '/' . $info['name'];
506
+				$filePath = $path.'/'.$info['name'];
507 507
 			}
508 508
 		}
509 509
 
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/ServerFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 		$server->addPlugin(new \OCA\DAV\Connector\Sabre\LockPlugin());
129 129
 		// Some WebDAV clients do require Class 2 WebDAV support (locking), since
130 130
 		// we do not provide locking we emulate it using a fake locking plugin.
131
-		if($this->request->isUserAgent([
131
+		if ($this->request->isUserAgent([
132 132
 			'/WebDAVFS/',
133 133
 			'/OneNote/',
134 134
 			'/Microsoft-WebDAV-MiniRedir/',
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 		}
142 142
 
143 143
 		// wait with registering these until auth is handled and the filesystem is setup
144
-		$server->on('beforeMethod:*', function () use ($server, $objectTree, $viewCallBack) {
144
+		$server->on('beforeMethod:*', function() use ($server, $objectTree, $viewCallBack) {
145 145
 			// ensure the skeleton is copied
146 146
 			$userFolder = \OC::$server->getUserFolder();
147 147
 
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 			);
174 174
 			$server->addPlugin(new \OCA\DAV\Connector\Sabre\QuotaPlugin($view, true));
175 175
 
176
-			if($this->userSession->isLoggedIn()) {
176
+			if ($this->userSession->isLoggedIn()) {
177 177
 				$server->addPlugin(new \OCA\DAV\Connector\Sabre\TagsPlugin($objectTree, $this->tagManager));
178 178
 				$server->addPlugin(new \OCA\DAV\Connector\Sabre\SharesPlugin(
179 179
 					$objectTree,
Please login to merge, or discard this patch.
apps/dav/lib/CalDAV/Calendar.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 	 * @return array
138 138
 	 */
139 139
 	public function getACL() {
140
-		$acl =  [
140
+		$acl = [
141 141
 			[
142 142
 				'privilege' => '{DAV:}read',
143 143
 				'principal' => $this->getOwner(),
@@ -145,12 +145,12 @@  discard block
 block discarded – undo
145 145
 			],
146 146
 			[
147 147
 				'privilege' => '{DAV:}read',
148
-				'principal' => $this->getOwner() . '/calendar-proxy-write',
148
+				'principal' => $this->getOwner().'/calendar-proxy-write',
149 149
 				'protected' => true,
150 150
 			],
151 151
 			[
152 152
 				'privilege' => '{DAV:}read',
153
-				'principal' => $this->getOwner() . '/calendar-proxy-read',
153
+				'principal' => $this->getOwner().'/calendar-proxy-read',
154 154
 				'protected' => true,
155 155
 			],
156 156
 		];
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 			];
164 164
 			$acl[] = [
165 165
 				'privilege' => '{DAV:}write',
166
-				'principal' => $this->getOwner() . '/calendar-proxy-write',
166
+				'principal' => $this->getOwner().'/calendar-proxy-write',
167 167
 				'protected' => true,
168 168
 			];
169 169
 		} else {
@@ -174,14 +174,14 @@  discard block
 block discarded – undo
174 174
 			];
175 175
 			$acl[] = [
176 176
 				'privilege' => '{DAV:}write-properties',
177
-				'principal' => $this->getOwner() . '/calendar-proxy-write',
177
+				'principal' => $this->getOwner().'/calendar-proxy-write',
178 178
 				'protected' => true,
179 179
 			];
180 180
 		}
181 181
 
182 182
 		$acl[] = [
183 183
 			'privilege' => '{DAV:}write-properties',
184
-			'principal' => $this->getOwner() . '/calendar-proxy-read',
184
+			'principal' => $this->getOwner().'/calendar-proxy-read',
185 185
 			'protected' => true,
186 186
 		];
187 187
 
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 		}
191 191
 
192 192
 		if ($this->getOwner() !== parent::getOwner()) {
193
-			$acl[] =  [
193
+			$acl[] = [
194 194
 				'privilege' => '{DAV:}read',
195 195
 				'principal' => parent::getOwner(),
196 196
 				'protected' => true,
@@ -220,8 +220,8 @@  discard block
 block discarded – undo
220 220
 		$acl = $this->caldavBackend->applyShareAcl($this->getResourceId(), $acl);
221 221
 		$allowedPrincipals = [
222 222
 			$this->getOwner(),
223
-			$this->getOwner(). '/calendar-proxy-read',
224
-			$this->getOwner(). '/calendar-proxy-write',
223
+			$this->getOwner().'/calendar-proxy-read',
224
+			$this->getOwner().'/calendar-proxy-write',
225 225
 			parent::getOwner(),
226 226
 			'principals/system/public'
227 227
 		];
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 	public function delete() {
245 245
 		if (isset($this->calendarInfo['{http://owncloud.org/ns}owner-principal']) &&
246 246
 			$this->calendarInfo['{http://owncloud.org/ns}owner-principal'] !== $this->calendarInfo['principaluri']) {
247
-			$principal = 'principal:' . parent::getOwner();
247
+			$principal = 'principal:'.parent::getOwner();
248 248
 			$shares = $this->caldavBackend->getShares($this->getResourceId());
249 249
 			$shares = array_filter($shares, function($share) use ($principal){
250 250
 				return $share['href'] === $principal;
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
 
344 344
 		$uris = $this->caldavBackend->calendarQuery($this->calendarInfo['id'], $filters);
345 345
 		if ($this->isShared()) {
346
-			return array_filter($uris, function ($uri) {
346
+			return array_filter($uris, function($uri) {
347 347
 				return $this->childExists($uri);
348 348
 			});
349 349
 		}
Please login to merge, or discard this patch.
apps/dav/lib/CalDAV/CalDavBackend.php 1 patch
Spacing   +150 added lines, -150 removed lines patch added patch discarded remove patch
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 			$query->andWhere($query->expr()->neq('uri', $query->createNamedParameter(BirthdayService::BIRTHDAY_CALENDAR_URI)));
227 227
 		}
228 228
 
229
-		return (int)$query->execute()->fetchColumn();
229
+		return (int) $query->execute()->fetchColumn();
230 230
 	}
231 231
 
232 232
 	/**
@@ -273,25 +273,25 @@  discard block
 block discarded – undo
273 273
 		$stmt = $query->execute();
274 274
 
275 275
 		$calendars = [];
276
-		while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
276
+		while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
277 277
 
278 278
 			$components = [];
279 279
 			if ($row['components']) {
280
-				$components = explode(',',$row['components']);
280
+				$components = explode(',', $row['components']);
281 281
 			}
282 282
 
283 283
 			$calendar = [
284 284
 				'id' => $row['id'],
285 285
 				'uri' => $row['uri'],
286 286
 				'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
287
-				'{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'),
288
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
289
-				'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
290
-				'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'),
291
-				'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $this->convertPrincipal($principalUri, !$this->legacyEndpoint),
287
+				'{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'),
288
+				'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
289
+				'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
290
+				'{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'),
291
+				'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}owner-principal' => $this->convertPrincipal($principalUri, !$this->legacyEndpoint),
292 292
 			];
293 293
 
294
-			foreach($this->propertyMap as $xmlName=>$dbName) {
294
+			foreach ($this->propertyMap as $xmlName=>$dbName) {
295 295
 				$calendar[$xmlName] = $row[$dbName];
296 296
 			}
297 297
 
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
 		$principals = array_map(function($principal) {
312 312
 			return urldecode($principal);
313 313
 		}, $principals);
314
-		$principals[]= $principalUri;
314
+		$principals[] = $principalUri;
315 315
 
316 316
 		$fields = array_values($this->propertyMap);
317 317
 		$fields[] = 'a.id';
@@ -331,8 +331,8 @@  discard block
 block discarded – undo
331 331
 			->setParameter('principaluri', $principals, \Doctrine\DBAL\Connection::PARAM_STR_ARRAY)
332 332
 			->execute();
333 333
 
334
-		$readOnlyPropertyName = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only';
335
-		while($row = $result->fetch()) {
334
+		$readOnlyPropertyName = '{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}read-only';
335
+		while ($row = $result->fetch()) {
336 336
 			if ($row['principaluri'] === $principalUri) {
337 337
 				continue;
338 338
 			}
@@ -351,25 +351,25 @@  discard block
 block discarded – undo
351 351
 			}
352 352
 
353 353
 			list(, $name) = Uri\split($row['principaluri']);
354
-			$uri = $row['uri'] . '_shared_by_' . $name;
355
-			$row['displayname'] = $row['displayname'] . ' (' . $this->getUserDisplayName($name) . ')';
354
+			$uri = $row['uri'].'_shared_by_'.$name;
355
+			$row['displayname'] = $row['displayname'].' ('.$this->getUserDisplayName($name).')';
356 356
 			$components = [];
357 357
 			if ($row['components']) {
358
-				$components = explode(',',$row['components']);
358
+				$components = explode(',', $row['components']);
359 359
 			}
360 360
 			$calendar = [
361 361
 				'id' => $row['id'],
362 362
 				'uri' => $uri,
363 363
 				'principaluri' => $this->convertPrincipal($principalUri, !$this->legacyEndpoint),
364
-				'{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'),
365
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
366
-				'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
367
-				'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp('transparent'),
368
-				'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
364
+				'{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'),
365
+				'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
366
+				'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
367
+				'{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp('transparent'),
368
+				'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}owner-principal' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
369 369
 				$readOnlyPropertyName => $readOnly,
370 370
 			];
371 371
 
372
-			foreach($this->propertyMap as $xmlName=>$dbName) {
372
+			foreach ($this->propertyMap as $xmlName=>$dbName) {
373 373
 				$calendar[$xmlName] = $row[$dbName];
374 374
 			}
375 375
 
@@ -402,21 +402,21 @@  discard block
 block discarded – undo
402 402
 			->orderBy('calendarorder', 'ASC');
403 403
 		$stmt = $query->execute();
404 404
 		$calendars = [];
405
-		while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
405
+		while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
406 406
 			$components = [];
407 407
 			if ($row['components']) {
408
-				$components = explode(',',$row['components']);
408
+				$components = explode(',', $row['components']);
409 409
 			}
410 410
 			$calendar = [
411 411
 				'id' => $row['id'],
412 412
 				'uri' => $row['uri'],
413 413
 				'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
414
-				'{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'),
415
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
416
-				'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
417
-				'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'),
414
+				'{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'),
415
+				'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
416
+				'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
417
+				'{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'),
418 418
 			];
419
-			foreach($this->propertyMap as $xmlName=>$dbName) {
419
+			foreach ($this->propertyMap as $xmlName=>$dbName) {
420 420
 				$calendar[$xmlName] = $row[$dbName];
421 421
 			}
422 422
 
@@ -471,27 +471,27 @@  discard block
 block discarded – undo
471 471
 			->andWhere($query->expr()->eq('s.type', $query->createNamedParameter('calendar')))
472 472
 			->execute();
473 473
 
474
-		while($row = $result->fetch()) {
474
+		while ($row = $result->fetch()) {
475 475
 			list(, $name) = Uri\split($row['principaluri']);
476
-			$row['displayname'] = $row['displayname'] . "($name)";
476
+			$row['displayname'] = $row['displayname']."($name)";
477 477
 			$components = [];
478 478
 			if ($row['components']) {
479
-				$components = explode(',',$row['components']);
479
+				$components = explode(',', $row['components']);
480 480
 			}
481 481
 			$calendar = [
482 482
 				'id' => $row['id'],
483 483
 				'uri' => $row['publicuri'],
484 484
 				'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
485
-				'{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'),
486
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
487
-				'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
488
-				'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'),
489
-				'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $this->convertPrincipal($row['principaluri'], $this->legacyEndpoint),
490
-				'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only' => (int)$row['access'] === Backend::ACCESS_READ,
491
-				'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}public' => (int)$row['access'] === self::ACCESS_PUBLIC,
485
+				'{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'),
486
+				'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
487
+				'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
488
+				'{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'),
489
+				'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}owner-principal' => $this->convertPrincipal($row['principaluri'], $this->legacyEndpoint),
490
+				'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}read-only' => (int) $row['access'] === Backend::ACCESS_READ,
491
+				'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}public' => (int) $row['access'] === self::ACCESS_PUBLIC,
492 492
 			];
493 493
 
494
-			foreach($this->propertyMap as $xmlName=>$dbName) {
494
+			foreach ($this->propertyMap as $xmlName=>$dbName) {
495 495
 				$calendar[$xmlName] = $row[$dbName];
496 496
 			}
497 497
 
@@ -535,29 +535,29 @@  discard block
 block discarded – undo
535 535
 		$result->closeCursor();
536 536
 
537 537
 		if ($row === false) {
538
-			throw new NotFound('Node with name \'' . $uri . '\' could not be found');
538
+			throw new NotFound('Node with name \''.$uri.'\' could not be found');
539 539
 		}
540 540
 
541 541
 		list(, $name) = Uri\split($row['principaluri']);
542
-		$row['displayname'] = $row['displayname'] . ' ' . "($name)";
542
+		$row['displayname'] = $row['displayname'].' '."($name)";
543 543
 		$components = [];
544 544
 		if ($row['components']) {
545
-			$components = explode(',',$row['components']);
545
+			$components = explode(',', $row['components']);
546 546
 		}
547 547
 		$calendar = [
548 548
 			'id' => $row['id'],
549 549
 			'uri' => $row['publicuri'],
550 550
 			'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
551
-			'{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'),
552
-			'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
553
-			'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
554
-			'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'),
555
-			'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
556
-			'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only' => (int)$row['access'] === Backend::ACCESS_READ,
557
-			'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}public' => (int)$row['access'] === self::ACCESS_PUBLIC,
551
+			'{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'),
552
+			'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
553
+			'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
554
+			'{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'),
555
+			'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}owner-principal' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
556
+			'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}read-only' => (int) $row['access'] === Backend::ACCESS_READ,
557
+			'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}public' => (int) $row['access'] === self::ACCESS_PUBLIC,
558 558
 		];
559 559
 
560
-		foreach($this->propertyMap as $xmlName=>$dbName) {
560
+		foreach ($this->propertyMap as $xmlName=>$dbName) {
561 561
 			$calendar[$xmlName] = $row[$dbName];
562 562
 		}
563 563
 
@@ -597,20 +597,20 @@  discard block
 block discarded – undo
597 597
 
598 598
 		$components = [];
599 599
 		if ($row['components']) {
600
-			$components = explode(',',$row['components']);
600
+			$components = explode(',', $row['components']);
601 601
 		}
602 602
 
603 603
 		$calendar = [
604 604
 			'id' => $row['id'],
605 605
 			'uri' => $row['uri'],
606 606
 			'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
607
-			'{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'),
608
-			'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
609
-			'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
610
-			'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'),
607
+			'{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'),
608
+			'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
609
+			'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
610
+			'{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'),
611 611
 		];
612 612
 
613
-		foreach($this->propertyMap as $xmlName=>$dbName) {
613
+		foreach ($this->propertyMap as $xmlName=>$dbName) {
614 614
 			$calendar[$xmlName] = $row[$dbName];
615 615
 		}
616 616
 
@@ -647,20 +647,20 @@  discard block
 block discarded – undo
647 647
 
648 648
 		$components = [];
649 649
 		if ($row['components']) {
650
-			$components = explode(',',$row['components']);
650
+			$components = explode(',', $row['components']);
651 651
 		}
652 652
 
653 653
 		$calendar = [
654 654
 			'id' => $row['id'],
655 655
 			'uri' => $row['uri'],
656 656
 			'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
657
-			'{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'),
658
-			'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
659
-			'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
660
-			'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'),
657
+			'{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'),
658
+			'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
659
+			'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
660
+			'{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'),
661 661
 		];
662 662
 
663
-		foreach($this->propertyMap as $xmlName=>$dbName) {
663
+		foreach ($this->propertyMap as $xmlName=>$dbName) {
664 664
 			$calendar[$xmlName] = $row[$dbName];
665 665
 		}
666 666
 
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
 			->from('calendarsubscriptions')
687 687
 			->where($query->expr()->eq('id', $query->createNamedParameter($subscriptionId)))
688 688
 			->orderBy('calendarorder', 'asc');
689
-		$stmt =$query->execute();
689
+		$stmt = $query->execute();
690 690
 
691 691
 		$row = $stmt->fetch(\PDO::FETCH_ASSOC);
692 692
 		$stmt->closeCursor();
@@ -700,11 +700,11 @@  discard block
 block discarded – undo
700 700
 			'principaluri' => $row['principaluri'],
701 701
 			'source'       => $row['source'],
702 702
 			'lastmodified' => $row['lastmodified'],
703
-			'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet(['VTODO', 'VEVENT']),
704
-			'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
703
+			'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet(['VTODO', 'VEVENT']),
704
+			'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
705 705
 		];
706 706
 
707
-		foreach($this->subscriptionPropertyMap as $xmlName=>$dbName) {
707
+		foreach ($this->subscriptionPropertyMap as $xmlName=>$dbName) {
708 708
 			if (!is_null($row[$dbName])) {
709 709
 				$subscription[$xmlName] = $row[$dbName];
710 710
 			}
@@ -739,21 +739,21 @@  discard block
 block discarded – undo
739 739
 		$sccs = '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set';
740 740
 		if (isset($properties[$sccs])) {
741 741
 			if (!($properties[$sccs] instanceof SupportedCalendarComponentSet)) {
742
-				throw new DAV\Exception('The ' . $sccs . ' property must be of type: \Sabre\CalDAV\Property\SupportedCalendarComponentSet');
742
+				throw new DAV\Exception('The '.$sccs.' property must be of type: \Sabre\CalDAV\Property\SupportedCalendarComponentSet');
743 743
 			}
744
-			$values['components'] = implode(',',$properties[$sccs]->getValue());
744
+			$values['components'] = implode(',', $properties[$sccs]->getValue());
745 745
 		} else if (isset($properties['components'])) {
746 746
 			// Allow to provide components internally without having
747 747
 			// to create a SupportedCalendarComponentSet object
748 748
 			$values['components'] = $properties['components'];
749 749
 		}
750 750
 
751
-		$transp = '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp';
751
+		$transp = '{'.Plugin::NS_CALDAV.'}schedule-calendar-transp';
752 752
 		if (isset($properties[$transp])) {
753 753
 			$values['transparent'] = (int) ($properties[$transp]->getValue() === 'transparent');
754 754
 		}
755 755
 
756
-		foreach($this->propertyMap as $xmlName=>$dbName) {
756
+		foreach ($this->propertyMap as $xmlName=>$dbName) {
757 757
 			if (isset($properties[$xmlName])) {
758 758
 				$values[$dbName] = $properties[$xmlName];
759 759
 			}
@@ -761,7 +761,7 @@  discard block
 block discarded – undo
761 761
 
762 762
 		$query = $this->db->getQueryBuilder();
763 763
 		$query->insert('calendars');
764
-		foreach($values as $column => $value) {
764
+		foreach ($values as $column => $value) {
765 765
 			$query->setValue($column, $query->createNamedParameter($value));
766 766
 		}
767 767
 		$query->execute();
@@ -795,7 +795,7 @@  discard block
 block discarded – undo
795 795
 	 */
796 796
 	function updateCalendar($calendarId, PropPatch $propPatch) {
797 797
 		$supportedProperties = array_keys($this->propertyMap);
798
-		$supportedProperties[] = '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp';
798
+		$supportedProperties[] = '{'.Plugin::NS_CALDAV.'}schedule-calendar-transp';
799 799
 
800 800
 		/**
801 801
 		 * @suppress SqlInjectionChecker
@@ -805,7 +805,7 @@  discard block
 block discarded – undo
805 805
 			foreach ($mutations as $propertyName => $propertyValue) {
806 806
 
807 807
 				switch ($propertyName) {
808
-					case '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' :
808
+					case '{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' :
809 809
 						$fieldName = 'transparent';
810 810
 						$newValues[$fieldName] = (int) ($propertyValue->getValue() === 'transparent');
811 811
 						break;
@@ -914,7 +914,7 @@  discard block
 block discarded – undo
914 914
 	 * @param int $calendarType
915 915
 	 * @return array
916 916
 	 */
917
-	public function getCalendarObjects($id, $calendarType=self::CALENDAR_TYPE_CALENDAR):array {
917
+	public function getCalendarObjects($id, $calendarType = self::CALENDAR_TYPE_CALENDAR):array {
918 918
 		$query = $this->db->getQueryBuilder();
919 919
 		$query->select(['id', 'uri', 'lastmodified', 'etag', 'calendarid', 'size', 'componenttype', 'classification'])
920 920
 			->from('calendarobjects')
@@ -923,16 +923,16 @@  discard block
 block discarded – undo
923 923
 		$stmt = $query->execute();
924 924
 
925 925
 		$result = [];
926
-		foreach($stmt->fetchAll(\PDO::FETCH_ASSOC) as $row) {
926
+		foreach ($stmt->fetchAll(\PDO::FETCH_ASSOC) as $row) {
927 927
 			$result[] = [
928 928
 				'id'           => $row['id'],
929 929
 				'uri'          => $row['uri'],
930 930
 				'lastmodified' => $row['lastmodified'],
931
-				'etag'         => '"' . $row['etag'] . '"',
931
+				'etag'         => '"'.$row['etag'].'"',
932 932
 				'calendarid'   => $row['calendarid'],
933
-				'size'         => (int)$row['size'],
933
+				'size'         => (int) $row['size'],
934 934
 				'component'    => strtolower($row['componenttype']),
935
-				'classification'=> (int)$row['classification']
935
+				'classification'=> (int) $row['classification']
936 936
 			];
937 937
 		}
938 938
 
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
 	 * @param int $calendarType
957 957
 	 * @return array|null
958 958
 	 */
959
-	public function getCalendarObject($id, $objectUri, $calendarType=self::CALENDAR_TYPE_CALENDAR) {
959
+	public function getCalendarObject($id, $objectUri, $calendarType = self::CALENDAR_TYPE_CALENDAR) {
960 960
 		$query = $this->db->getQueryBuilder();
961 961
 		$query->select(['id', 'uri', 'lastmodified', 'etag', 'calendarid', 'size', 'calendardata', 'componenttype', 'classification'])
962 962
 			->from('calendarobjects')
@@ -966,7 +966,7 @@  discard block
 block discarded – undo
966 966
 		$stmt = $query->execute();
967 967
 		$row = $stmt->fetch(\PDO::FETCH_ASSOC);
968 968
 
969
-		if(!$row) {
969
+		if (!$row) {
970 970
 			return null;
971 971
 		}
972 972
 
@@ -974,12 +974,12 @@  discard block
 block discarded – undo
974 974
 			'id'            => $row['id'],
975 975
 			'uri'           => $row['uri'],
976 976
 			'lastmodified'  => $row['lastmodified'],
977
-			'etag'          => '"' . $row['etag'] . '"',
977
+			'etag'          => '"'.$row['etag'].'"',
978 978
 			'calendarid'    => $row['calendarid'],
979
-			'size'          => (int)$row['size'],
979
+			'size'          => (int) $row['size'],
980 980
 			'calendardata'  => $this->readBlob($row['calendardata']),
981 981
 			'component'     => strtolower($row['componenttype']),
982
-			'classification'=> (int)$row['classification']
982
+			'classification'=> (int) $row['classification']
983 983
 		];
984 984
 	}
985 985
 
@@ -996,7 +996,7 @@  discard block
 block discarded – undo
996 996
 	 * @param int $calendarType
997 997
 	 * @return array
998 998
 	 */
999
-	public function getMultipleCalendarObjects($id, array $uris, $calendarType=self::CALENDAR_TYPE_CALENDAR):array {
999
+	public function getMultipleCalendarObjects($id, array $uris, $calendarType = self::CALENDAR_TYPE_CALENDAR):array {
1000 1000
 		if (empty($uris)) {
1001 1001
 			return [];
1002 1002
 		}
@@ -1020,12 +1020,12 @@  discard block
 block discarded – undo
1020 1020
 					'id'           => $row['id'],
1021 1021
 					'uri'          => $row['uri'],
1022 1022
 					'lastmodified' => $row['lastmodified'],
1023
-					'etag'         => '"' . $row['etag'] . '"',
1023
+					'etag'         => '"'.$row['etag'].'"',
1024 1024
 					'calendarid'   => $row['calendarid'],
1025
-					'size'         => (int)$row['size'],
1025
+					'size'         => (int) $row['size'],
1026 1026
 					'calendardata' => $this->readBlob($row['calendardata']),
1027 1027
 					'component'    => strtolower($row['componenttype']),
1028
-					'classification' => (int)$row['classification']
1028
+					'classification' => (int) $row['classification']
1029 1029
 				];
1030 1030
 			}
1031 1031
 			$result->closeCursor();
@@ -1053,7 +1053,7 @@  discard block
 block discarded – undo
1053 1053
 	 * @param int $calendarType
1054 1054
 	 * @return string
1055 1055
 	 */
1056
-	function createCalendarObject($calendarId, $objectUri, $calendarData, $calendarType=self::CALENDAR_TYPE_CALENDAR) {
1056
+	function createCalendarObject($calendarId, $objectUri, $calendarData, $calendarType = self::CALENDAR_TYPE_CALENDAR) {
1057 1057
 		$extraData = $this->getDenormalizedData($calendarData);
1058 1058
 
1059 1059
 		$q = $this->db->getQueryBuilder();
@@ -1114,7 +1114,7 @@  discard block
 block discarded – undo
1114 1114
 		}
1115 1115
 		$this->addChange($calendarId, $objectUri, 1, $calendarType);
1116 1116
 
1117
-		return '"' . $extraData['etag'] . '"';
1117
+		return '"'.$extraData['etag'].'"';
1118 1118
 	}
1119 1119
 
1120 1120
 	/**
@@ -1136,7 +1136,7 @@  discard block
 block discarded – undo
1136 1136
 	 * @param int $calendarType
1137 1137
 	 * @return string
1138 1138
 	 */
1139
-	function updateCalendarObject($calendarId, $objectUri, $calendarData, $calendarType=self::CALENDAR_TYPE_CALENDAR) {
1139
+	function updateCalendarObject($calendarId, $objectUri, $calendarData, $calendarType = self::CALENDAR_TYPE_CALENDAR) {
1140 1140
 		$extraData = $this->getDenormalizedData($calendarData);
1141 1141
 		$query = $this->db->getQueryBuilder();
1142 1142
 		$query->update('calendarobjects')
@@ -1182,7 +1182,7 @@  discard block
 block discarded – undo
1182 1182
 		}
1183 1183
 		$this->addChange($calendarId, $objectUri, 2, $calendarType);
1184 1184
 
1185
-		return '"' . $extraData['etag'] . '"';
1185
+		return '"'.$extraData['etag'].'"';
1186 1186
 	}
1187 1187
 
1188 1188
 	/**
@@ -1212,7 +1212,7 @@  discard block
 block discarded – undo
1212 1212
 	 * @param int $calendarType
1213 1213
 	 * @return void
1214 1214
 	 */
1215
-	function deleteCalendarObject($calendarId, $objectUri, $calendarType=self::CALENDAR_TYPE_CALENDAR) {
1215
+	function deleteCalendarObject($calendarId, $objectUri, $calendarType = self::CALENDAR_TYPE_CALENDAR) {
1216 1216
 		$data = $this->getCalendarObject($calendarId, $objectUri, $calendarType);
1217 1217
 		if (is_array($data)) {
1218 1218
 			if ($calendarType === self::CALENDAR_TYPE_CALENDAR) {
@@ -1298,7 +1298,7 @@  discard block
 block discarded – undo
1298 1298
 	 * @param int $calendarType
1299 1299
 	 * @return array
1300 1300
 	 */
1301
-	public function calendarQuery($id, array $filters, $calendarType=self::CALENDAR_TYPE_CALENDAR):array {
1301
+	public function calendarQuery($id, array $filters, $calendarType = self::CALENDAR_TYPE_CALENDAR):array {
1302 1302
 		$componentType = null;
1303 1303
 		$requirePostFilter = true;
1304 1304
 		$timeRange = null;
@@ -1352,13 +1352,13 @@  discard block
 block discarded – undo
1352 1352
 		$stmt = $query->execute();
1353 1353
 
1354 1354
 		$result = [];
1355
-		while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
1355
+		while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
1356 1356
 			if ($requirePostFilter) {
1357 1357
 				// validateFilterForObject will parse the calendar data
1358 1358
 				// catch parsing errors
1359 1359
 				try {
1360 1360
 					$matches = $this->validateFilterForObject($row, $filters);
1361
-				} catch(ParseException $ex) {
1361
+				} catch (ParseException $ex) {
1362 1362
 					$this->logger->logException($ex, [
1363 1363
 						'app' => 'dav',
1364 1364
 						'message' => 'Caught parsing exception for calendar data. This usually indicates invalid calendar data. calendar-id:'.$id.' uri:'.$row['uri']
@@ -1393,14 +1393,14 @@  discard block
 block discarded – undo
1393 1393
 	 * @param integer|null $offset
1394 1394
 	 * @return array
1395 1395
 	 */
1396
-	public function calendarSearch($principalUri, array $filters, $limit=null, $offset=null) {
1396
+	public function calendarSearch($principalUri, array $filters, $limit = null, $offset = null) {
1397 1397
 		$calendars = $this->getCalendarsForUser($principalUri);
1398 1398
 		$ownCalendars = [];
1399 1399
 		$sharedCalendars = [];
1400 1400
 
1401 1401
 		$uriMapper = [];
1402 1402
 
1403
-		foreach($calendars as $calendar) {
1403
+		foreach ($calendars as $calendar) {
1404 1404
 			if ($calendar['{http://owncloud.org/ns}owner-principal'] === $principalUri) {
1405 1405
 				$ownCalendars[] = $calendar['id'];
1406 1406
 			} else {
@@ -1415,14 +1415,14 @@  discard block
 block discarded – undo
1415 1415
 		$query = $this->db->getQueryBuilder();
1416 1416
 		// Calendar id expressions
1417 1417
 		$calendarExpressions = [];
1418
-		foreach($ownCalendars as $id) {
1418
+		foreach ($ownCalendars as $id) {
1419 1419
 			$calendarExpressions[] = $query->expr()->andX(
1420 1420
 				$query->expr()->eq('c.calendarid',
1421 1421
 					$query->createNamedParameter($id)),
1422 1422
 				$query->expr()->eq('c.calendartype',
1423 1423
 						$query->createNamedParameter(self::CALENDAR_TYPE_CALENDAR)));
1424 1424
 		}
1425
-		foreach($sharedCalendars as $id) {
1425
+		foreach ($sharedCalendars as $id) {
1426 1426
 			$calendarExpressions[] = $query->expr()->andX(
1427 1427
 				$query->expr()->eq('c.calendarid',
1428 1428
 					$query->createNamedParameter($id)),
@@ -1440,7 +1440,7 @@  discard block
 block discarded – undo
1440 1440
 
1441 1441
 		// Component expressions
1442 1442
 		$compExpressions = [];
1443
-		foreach($filters['comps'] as $comp) {
1443
+		foreach ($filters['comps'] as $comp) {
1444 1444
 			$compExpressions[] = $query->expr()
1445 1445
 				->eq('c.componenttype', $query->createNamedParameter($comp));
1446 1446
 		}
@@ -1459,13 +1459,13 @@  discard block
 block discarded – undo
1459 1459
 		}
1460 1460
 
1461 1461
 		$propParamExpressions = [];
1462
-		foreach($filters['props'] as $prop) {
1462
+		foreach ($filters['props'] as $prop) {
1463 1463
 			$propParamExpressions[] = $query->expr()->andX(
1464 1464
 				$query->expr()->eq('i.name', $query->createNamedParameter($prop)),
1465 1465
 				$query->expr()->isNull('i.parameter')
1466 1466
 			);
1467 1467
 		}
1468
-		foreach($filters['params'] as $param) {
1468
+		foreach ($filters['params'] as $param) {
1469 1469
 			$propParamExpressions[] = $query->expr()->andX(
1470 1470
 				$query->expr()->eq('i.name', $query->createNamedParameter($param['property'])),
1471 1471
 				$query->expr()->eq('i.parameter', $query->createNamedParameter($param['parameter']))
@@ -1497,8 +1497,8 @@  discard block
 block discarded – undo
1497 1497
 		$stmt = $query->execute();
1498 1498
 
1499 1499
 		$result = [];
1500
-		while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
1501
-			$path = $uriMapper[$row['calendarid']] . '/' . $row['uri'];
1500
+		while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
1501
+			$path = $uriMapper[$row['calendarid']].'/'.$row['uri'];
1502 1502
 			if (!in_array($path, $result)) {
1503 1503
 				$result[] = $path;
1504 1504
 			}
@@ -1538,7 +1538,7 @@  discard block
 block discarded – undo
1538 1538
 		}
1539 1539
 
1540 1540
 		$or = $innerQuery->expr()->orX();
1541
-		foreach($searchProperties as $searchProperty) {
1541
+		foreach ($searchProperties as $searchProperty) {
1542 1542
 			$or->add($innerQuery->expr()->eq('op.name',
1543 1543
 				$outerQuery->createNamedParameter($searchProperty)));
1544 1544
 		}
@@ -1546,8 +1546,8 @@  discard block
 block discarded – undo
1546 1546
 
1547 1547
 		if ($pattern !== '') {
1548 1548
 			$innerQuery->andWhere($innerQuery->expr()->iLike('op.value',
1549
-				$outerQuery->createNamedParameter('%' .
1550
-					$this->db->escapeLikeParameter($pattern) . '%')));
1549
+				$outerQuery->createNamedParameter('%'.
1550
+					$this->db->escapeLikeParameter($pattern).'%')));
1551 1551
 		}
1552 1552
 
1553 1553
 		$outerQuery->select('c.id', 'c.calendardata', 'c.componenttype', 'c.uid', 'c.uri')
@@ -1567,7 +1567,7 @@  discard block
 block discarded – undo
1567 1567
 
1568 1568
 		if (isset($options['types'])) {
1569 1569
 			$or = $outerQuery->expr()->orX();
1570
-			foreach($options['types'] as $type) {
1570
+			foreach ($options['types'] as $type) {
1571 1571
 				$or->add($outerQuery->expr()->eq('componenttype',
1572 1572
 					$outerQuery->createNamedParameter($type)));
1573 1573
 			}
@@ -1592,7 +1592,7 @@  discard block
 block discarded – undo
1592 1592
 			$comps = $calendarData->getComponents();
1593 1593
 			$objects = [];
1594 1594
 			$timezones = [];
1595
-			foreach($comps as $comp) {
1595
+			foreach ($comps as $comp) {
1596 1596
 				if ($comp instanceof VTimeZone) {
1597 1597
 					$timezones[] = $comp;
1598 1598
 				} else {
@@ -1629,7 +1629,7 @@  discard block
 block discarded – undo
1629 1629
 		});
1630 1630
 		$validationRules = $comp->getValidationRules();
1631 1631
 
1632
-		foreach($subComponents as $subComponent) {
1632
+		foreach ($subComponents as $subComponent) {
1633 1633
 			$name = $subComponent->name;
1634 1634
 			if (!isset($data[$name])) {
1635 1635
 				$data[$name] = [];
@@ -1637,7 +1637,7 @@  discard block
 block discarded – undo
1637 1637
 			$data[$name][] = $this->transformSearchData($subComponent);
1638 1638
 		}
1639 1639
 
1640
-		foreach($properties as $property) {
1640
+		foreach ($properties as $property) {
1641 1641
 			$name = $property->name;
1642 1642
 			if (!isset($validationRules[$name])) {
1643 1643
 				$validationRules[$name] = '*';
@@ -1708,7 +1708,7 @@  discard block
 block discarded – undo
1708 1708
 		$stmt = $query->execute();
1709 1709
 
1710 1710
 		if ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
1711
-			return $row['calendaruri'] . '/' . $row['objecturi'];
1711
+			return $row['calendaruri'].'/'.$row['objecturi'];
1712 1712
 		}
1713 1713
 
1714 1714
 		return null;
@@ -1771,10 +1771,10 @@  discard block
 block discarded – undo
1771 1771
 	 * @param int $calendarType
1772 1772
 	 * @return array
1773 1773
 	 */
1774
-	function getChangesForCalendar($calendarId, $syncToken, $syncLevel, $limit = null, $calendarType=self::CALENDAR_TYPE_CALENDAR) {
1774
+	function getChangesForCalendar($calendarId, $syncToken, $syncLevel, $limit = null, $calendarType = self::CALENDAR_TYPE_CALENDAR) {
1775 1775
 		// Current synctoken
1776 1776
 		$stmt = $this->db->prepare('SELECT `synctoken` FROM `*PREFIX*calendars` WHERE `id` = ?');
1777
-		$stmt->execute([ $calendarId ]);
1777
+		$stmt->execute([$calendarId]);
1778 1778
 		$currentToken = $stmt->fetchColumn(0);
1779 1779
 
1780 1780
 		if (is_null($currentToken)) {
@@ -1791,8 +1791,8 @@  discard block
 block discarded – undo
1791 1791
 		if ($syncToken) {
1792 1792
 
1793 1793
 			$query = "SELECT `uri`, `operation` FROM `*PREFIX*calendarchanges` WHERE `synctoken` >= ? AND `synctoken` < ? AND `calendarid` = ? AND `calendartype` = ? ORDER BY `synctoken`";
1794
-			if ($limit>0) {
1795
-				$query.= " LIMIT " . (int)$limit;
1794
+			if ($limit > 0) {
1795
+				$query .= " LIMIT ".(int) $limit;
1796 1796
 			}
1797 1797
 
1798 1798
 			// Fetching all changes
@@ -1803,15 +1803,15 @@  discard block
 block discarded – undo
1803 1803
 
1804 1804
 			// This loop ensures that any duplicates are overwritten, only the
1805 1805
 			// last change on a node is relevant.
1806
-			while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
1806
+			while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
1807 1807
 
1808 1808
 				$changes[$row['uri']] = $row['operation'];
1809 1809
 
1810 1810
 			}
1811 1811
 
1812
-			foreach($changes as $uri => $operation) {
1812
+			foreach ($changes as $uri => $operation) {
1813 1813
 
1814
-				switch($operation) {
1814
+				switch ($operation) {
1815 1815
 					case 1 :
1816 1816
 						$result['added'][] = $uri;
1817 1817
 						break;
@@ -1882,10 +1882,10 @@  discard block
 block discarded – undo
1882 1882
 			->from('calendarsubscriptions')
1883 1883
 			->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri)))
1884 1884
 			->orderBy('calendarorder', 'asc');
1885
-		$stmt =$query->execute();
1885
+		$stmt = $query->execute();
1886 1886
 
1887 1887
 		$subscriptions = [];
1888
-		while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
1888
+		while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
1889 1889
 
1890 1890
 			$subscription = [
1891 1891
 				'id'           => $row['id'],
@@ -1894,11 +1894,11 @@  discard block
 block discarded – undo
1894 1894
 				'source'       => $row['source'],
1895 1895
 				'lastmodified' => $row['lastmodified'],
1896 1896
 
1897
-				'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet(['VTODO', 'VEVENT']),
1898
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
1897
+				'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet(['VTODO', 'VEVENT']),
1898
+				'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
1899 1899
 			];
1900 1900
 
1901
-			foreach($this->subscriptionPropertyMap as $xmlName=>$dbName) {
1901
+			foreach ($this->subscriptionPropertyMap as $xmlName=>$dbName) {
1902 1902
 				if (!is_null($row[$dbName])) {
1903 1903
 					$subscription[$xmlName] = $row[$dbName];
1904 1904
 				}
@@ -1937,7 +1937,7 @@  discard block
 block discarded – undo
1937 1937
 
1938 1938
 		$propertiesBoolean = ['striptodos', 'stripalarms', 'stripattachments'];
1939 1939
 
1940
-		foreach($this->subscriptionPropertyMap as $xmlName=>$dbName) {
1940
+		foreach ($this->subscriptionPropertyMap as $xmlName=>$dbName) {
1941 1941
 			if (array_key_exists($xmlName, $properties)) {
1942 1942
 					$values[$dbName] = $properties[$xmlName];
1943 1943
 					if (in_array($dbName, $propertiesBoolean)) {
@@ -1997,7 +1997,7 @@  discard block
 block discarded – undo
1997 1997
 
1998 1998
 			$newValues = [];
1999 1999
 
2000
-			foreach($mutations as $propertyName=>$propertyValue) {
2000
+			foreach ($mutations as $propertyName=>$propertyValue) {
2001 2001
 				if ($propertyName === '{http://calendarserver.org/ns/}source') {
2002 2002
 					$newValues['source'] = $propertyValue->getHref();
2003 2003
 				} else {
@@ -2009,7 +2009,7 @@  discard block
 block discarded – undo
2009 2009
 			$query = $this->db->getQueryBuilder();
2010 2010
 			$query->update('calendarsubscriptions')
2011 2011
 				->set('lastmodified', $query->createNamedParameter(time()));
2012
-			foreach($newValues as $fieldName=>$value) {
2012
+			foreach ($newValues as $fieldName=>$value) {
2013 2013
 				$query->set($fieldName, $query->createNamedParameter($value));
2014 2014
 			}
2015 2015
 			$query->where($query->expr()->eq('id', $query->createNamedParameter($subscriptionId)))
@@ -2090,7 +2090,7 @@  discard block
 block discarded – undo
2090 2090
 
2091 2091
 		$row = $stmt->fetch(\PDO::FETCH_ASSOC);
2092 2092
 
2093
-		if(!$row) {
2093
+		if (!$row) {
2094 2094
 			return null;
2095 2095
 		}
2096 2096
 
@@ -2098,8 +2098,8 @@  discard block
 block discarded – undo
2098 2098
 			'uri'          => $row['uri'],
2099 2099
 			'calendardata' => $row['calendardata'],
2100 2100
 			'lastmodified' => $row['lastmodified'],
2101
-			'etag'         => '"' . $row['etag'] . '"',
2102
-			'size'         => (int)$row['size'],
2101
+			'etag'         => '"'.$row['etag'].'"',
2102
+			'size'         => (int) $row['size'],
2103 2103
 		];
2104 2104
 	}
2105 2105
 
@@ -2122,13 +2122,13 @@  discard block
 block discarded – undo
2122 2122
 				->execute();
2123 2123
 
2124 2124
 		$result = [];
2125
-		foreach($stmt->fetchAll(\PDO::FETCH_ASSOC) as $row) {
2125
+		foreach ($stmt->fetchAll(\PDO::FETCH_ASSOC) as $row) {
2126 2126
 			$result[] = [
2127 2127
 				'calendardata' => $row['calendardata'],
2128 2128
 				'uri'          => $row['uri'],
2129 2129
 				'lastmodified' => $row['lastmodified'],
2130
-				'etag'         => '"' . $row['etag'] . '"',
2131
-				'size'         => (int)$row['size'],
2130
+				'etag'         => '"'.$row['etag'].'"',
2131
+				'size'         => (int) $row['size'],
2132 2132
 			];
2133 2133
 		}
2134 2134
 
@@ -2181,14 +2181,14 @@  discard block
 block discarded – undo
2181 2181
 	 * @param int $calendarType
2182 2182
 	 * @return void
2183 2183
 	 */
2184
-	protected function addChange($calendarId, $objectUri, $operation, $calendarType=self::CALENDAR_TYPE_CALENDAR) {
2185
-		$table = $calendarType === self::CALENDAR_TYPE_CALENDAR ? 'calendars': 'calendarsubscriptions';
2184
+	protected function addChange($calendarId, $objectUri, $operation, $calendarType = self::CALENDAR_TYPE_CALENDAR) {
2185
+		$table = $calendarType === self::CALENDAR_TYPE_CALENDAR ? 'calendars' : 'calendarsubscriptions';
2186 2186
 
2187 2187
 		$query = $this->db->getQueryBuilder();
2188 2188
 		$query->select('synctoken')
2189 2189
 			->from($table)
2190 2190
 			->where($query->expr()->eq('id', $query->createNamedParameter($calendarId)));
2191
-		$syncToken = (int)$query->execute()->fetchColumn();
2191
+		$syncToken = (int) $query->execute()->fetchColumn();
2192 2192
 
2193 2193
 		$query = $this->db->getQueryBuilder();
2194 2194
 		$query->insert('calendarchanges')
@@ -2232,10 +2232,10 @@  discard block
 block discarded – undo
2232 2232
 		$lastOccurrence = null;
2233 2233
 		$uid = null;
2234 2234
 		$classification = self::CLASSIFICATION_PUBLIC;
2235
-		foreach($vObject->getComponents() as $component) {
2236
-			if ($component->name!=='VTIMEZONE') {
2235
+		foreach ($vObject->getComponents() as $component) {
2236
+			if ($component->name !== 'VTIMEZONE') {
2237 2237
 				$componentType = $component->name;
2238
-				$uid = (string)$component->UID;
2238
+				$uid = (string) $component->UID;
2239 2239
 				break;
2240 2240
 			}
2241 2241
 		}
@@ -2260,13 +2260,13 @@  discard block
 block discarded – undo
2260 2260
 					$lastOccurrence = $firstOccurrence;
2261 2261
 				}
2262 2262
 			} else {
2263
-				$it = new EventIterator($vObject, (string)$component->UID);
2263
+				$it = new EventIterator($vObject, (string) $component->UID);
2264 2264
 				$maxDate = new DateTime(self::MAX_DATE);
2265 2265
 				if ($it->isInfinite()) {
2266 2266
 					$lastOccurrence = $maxDate->getTimestamp();
2267 2267
 				} else {
2268 2268
 					$end = $it->getDtEnd();
2269
-					while($it->valid() && $end < $maxDate) {
2269
+					while ($it->valid() && $end < $maxDate) {
2270 2270
 						$end = $it->getDtEnd();
2271 2271
 						$it->next();
2272 2272
 
@@ -2336,7 +2336,7 @@  discard block
 block discarded – undo
2336 2336
 	 * @param int $calendarType
2337 2337
 	 * @return array
2338 2338
 	 */
2339
-	public function getShares($resourceId, $calendarType=self::CALENDAR_TYPE_CALENDAR) {
2339
+	public function getShares($resourceId, $calendarType = self::CALENDAR_TYPE_CALENDAR) {
2340 2340
 		return $this->calendarSharingBackend->getShares($resourceId);
2341 2341
 	}
2342 2342
 
@@ -2413,7 +2413,7 @@  discard block
 block discarded – undo
2413 2413
 	 * @param string $calendarData
2414 2414
 	 * @param int $calendarType
2415 2415
 	 */
2416
-	public function updateProperties($calendarId, $objectUri, $calendarData, $calendarType=self::CALENDAR_TYPE_CALENDAR) {
2416
+	public function updateProperties($calendarId, $objectUri, $calendarData, $calendarType = self::CALENDAR_TYPE_CALENDAR) {
2417 2417
 		$objectId = $this->getCalendarObjectId($calendarId, $objectUri, $calendarType);
2418 2418
 
2419 2419
 		try {
@@ -2490,7 +2490,7 @@  discard block
 block discarded – undo
2490 2490
 			->execute();
2491 2491
 
2492 2492
 		$ids = $result->fetchAll();
2493
-		foreach($ids as $id) {
2493
+		foreach ($ids as $id) {
2494 2494
 			$this->deleteCalendar($id['id']);
2495 2495
 		}
2496 2496
 	}
@@ -2507,7 +2507,7 @@  discard block
 block discarded – undo
2507 2507
 		$stmt = $query->execute();
2508 2508
 
2509 2509
 		$uris = [];
2510
-		foreach($stmt->fetchAll(\PDO::FETCH_ASSOC) as $row) {
2510
+		foreach ($stmt->fetchAll(\PDO::FETCH_ASSOC) as $row) {
2511 2511
 			$uris[] = $row['uri'];
2512 2512
 		}
2513 2513
 		$stmt->closeCursor();
@@ -2528,7 +2528,7 @@  discard block
 block discarded – undo
2528 2528
 			->andWhere($query->expr()->eq('calendartype', $query->createNamedParameter(self::CALENDAR_TYPE_SUBSCRIPTION)))
2529 2529
 			->execute();
2530 2530
 
2531
-		foreach($uris as $uri) {
2531
+		foreach ($uris as $uri) {
2532 2532
 			$this->addChange($subscriptionId, $uri, 3, self::CALENDAR_TYPE_SUBSCRIPTION);
2533 2533
 		}
2534 2534
 	}
@@ -2595,10 +2595,10 @@  discard block
 block discarded – undo
2595 2595
 		$result->closeCursor();
2596 2596
 
2597 2597
 		if (!isset($objectIds['id'])) {
2598
-			throw new \InvalidArgumentException('Calendarobject does not exists: ' . $uri);
2598
+			throw new \InvalidArgumentException('Calendarobject does not exists: '.$uri);
2599 2599
 		}
2600 2600
 
2601
-		return (int)$objectIds['id'];
2601
+		return (int) $objectIds['id'];
2602 2602
 	}
2603 2603
 
2604 2604
 	/**
@@ -2625,8 +2625,8 @@  discard block
 block discarded – undo
2625 2625
 	 * @param $calendarInfo
2626 2626
 	 */
2627 2627
 	private function addOwnerPrincipal(&$calendarInfo) {
2628
-		$ownerPrincipalKey = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal';
2629
-		$displaynameKey = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_NEXTCLOUD . '}owner-displayname';
2628
+		$ownerPrincipalKey = '{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}owner-principal';
2629
+		$displaynameKey = '{'.\OCA\DAV\DAV\Sharing\Plugin::NS_NEXTCLOUD.'}owner-displayname';
2630 2630
 		if (isset($calendarInfo[$ownerPrincipalKey])) {
2631 2631
 			$uri = $calendarInfo[$ownerPrincipalKey];
2632 2632
 		} else {
Please login to merge, or discard this patch.
apps/dav/lib/CardDAV/AddressBook.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -104,12 +104,12 @@  discard block
 block discarded – undo
104 104
 	}
105 105
 
106 106
 	public function getACL() {
107
-		$acl =  [
107
+		$acl = [
108 108
 			[
109 109
 				'privilege' => '{DAV:}read',
110 110
 				'principal' => $this->getOwner(),
111 111
 				'protected' => true,
112
-			],[
112
+			], [
113 113
 				'privilege' => '{DAV:}write',
114 114
 				'principal' => $this->getOwner(),
115 115
 				'protected' => true,
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 		}
130 130
 
131 131
 		if ($this->getOwner() !== parent::getOwner()) {
132
-			$acl[] =  [
132
+			$acl[] = [
133 133
 				'privilege' => '{DAV:}read',
134 134
 				'principal' => parent::getOwner(),
135 135
 				'protected' => true,
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 
182 182
 	public function delete() {
183 183
 		if (isset($this->addressBookInfo['{http://owncloud.org/ns}owner-principal'])) {
184
-			$principal = 'principal:' . parent::getOwner();
184
+			$principal = 'principal:'.parent::getOwner();
185 185
 			$shares = $this->carddavBackend->getShares($this->getResourceId());
186 186
 			$shares = array_filter($shares, function($share) use ($principal){
187 187
 				return $share['href'] === $principal;
Please login to merge, or discard this patch.
core/templates/loginflow/grant.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
 	<h2><?php p($l->t('Account access')) ?></h2>
32 32
 	<p class="info">
33 33
 		<?php print_unescaped($l->t('You are about to grant %1$s access to your %2$s account.', [
34
-			'<strong>' . \OCP\Util::sanitizeHTML($_['client']) . '</strong>',
34
+			'<strong>'.\OCP\Util::sanitizeHTML($_['client']).'</strong>',
35 35
 			\OCP\Util::sanitizeHTML($_['instanceName'])
36 36
 		])) ?>
37 37
 	</p>
Please login to merge, or discard this patch.
core/templates/loginflow/authpicker.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 	<h2><?php p($l->t('Connect to your account')) ?></h2>
32 32
 	<p class="info">
33 33
 		<?php print_unescaped($l->t('Please log in before granting %1$s access to your %2$s account.', [
34
-			'<strong>' . \OCP\Util::sanitizeHTML($_['client']) . '</strong>',
34
+			'<strong>'.\OCP\Util::sanitizeHTML($_['client']).'</strong>',
35 35
 			\OCP\Util::sanitizeHTML($_['instanceName'])
36 36
 		])) ?>
37 37
 	</p>
@@ -59,6 +59,6 @@  discard block
 block discarded – undo
59 59
 	</form>
60 60
 </div>
61 61
 
62
-<?php if(empty($_['oauthState'])): ?>
62
+<?php if (empty($_['oauthState'])): ?>
63 63
 <a id="app-token-login" class="warning" href="#"><?php p($l->t('Alternative log in using app token')) ?></a>
64 64
 <?php endif; ?>
Please login to merge, or discard this patch.
core/templates/loginflowv2/grant.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
 	<h2><?php p($l->t('Account access')) ?></h2>
32 32
 	<p class="info">
33 33
 		<?php print_unescaped($l->t('You are about to grant %1$s access to your %2$s account.', [
34
-			'<strong>' . \OCP\Util::sanitizeHTML($_['client']) . '</strong>',
34
+			'<strong>'.\OCP\Util::sanitizeHTML($_['client']).'</strong>',
35 35
 			\OCP\Util::sanitizeHTML($_['instanceName'])
36 36
 		])) ?>
37 37
 	</p>
Please login to merge, or discard this patch.
core/templates/loginflowv2/authpicker.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
 	<h2><?php p($l->t('Connect to your account')) ?></h2>
31 31
 	<p class="info">
32 32
 		<?php print_unescaped($l->t('Please log in before granting %1$s access to your %2$s account.', [
33
-			'<strong>' . \OCP\Util::sanitizeHTML($_['client']) . '</strong>',
33
+			'<strong>'.\OCP\Util::sanitizeHTML($_['client']).'</strong>',
34 34
 			\OCP\Util::sanitizeHTML($_['instanceName'])
35 35
 		])) ?>
36 36
 	</p>
Please login to merge, or discard this patch.