Passed
Push — master ( bbb39c...5026d2 )
by Christoph
27:34 queued 12:27
created
apps/dav/lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -89,9 +89,9 @@  discard block
 block discarded – undo
89 89
 		$this->logger = $logger;
90 90
 		$this->proxyMapper = $proxyMapper;
91 91
 		$this->principalPrefix = $principalPrefix;
92
-		$this->dbTableName = 'calendar_' . $dbPrefix . 's';
93
-		$this->dbMetaDataTableName = $this->dbTableName . '_md';
94
-		$this->dbForeignKeyName = $dbPrefix . '_id';
92
+		$this->dbTableName = 'calendar_'.$dbPrefix.'s';
93
+		$this->dbMetaDataTableName = $this->dbTableName.'_md';
94
+		$this->dbForeignKeyName = $dbPrefix.'_id';
95 95
 		$this->cuType = $cuType;
96 96
 	}
97 97
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 		}
166 166
 		[, $name] = \Sabre\Uri\split($path);
167 167
 
168
-		[$backendId, $resourceId] = explode('-',  $name, 2);
168
+		[$backendId, $resourceId] = explode('-', $name, 2);
169 169
 
170 170
 		$query = $this->db->getQueryBuilder();
171 171
 		$query->select(['id', 'backend_id', 'resource_id', 'email', 'displayname'])
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 	 * @param int $id
199 199
 	 * @return array|null
200 200
 	 */
201
-	public function getPrincipalById($id):?array {
201
+	public function getPrincipalById($id): ?array {
202 202
 		$query = $this->db->getQueryBuilder();
203 203
 		$query->select(['id', 'backend_id', 'resource_id', 'email', 'displayname'])
204 204
 			->from($this->dbTableName)
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 					$query = $this->db->getQueryBuilder();
262 262
 					$query->select(['id', 'backend_id', 'resource_id', 'email', 'displayname', 'group_restrictions'])
263 263
 						->from($this->dbTableName)
264
-						->where($query->expr()->iLike('email', $query->createNamedParameter('%' . $this->db->escapeLikeParameter($value) . '%')));
264
+						->where($query->expr()->iLike('email', $query->createNamedParameter('%'.$this->db->escapeLikeParameter($value).'%')));
265 265
 
266 266
 					$stmt = $query->execute();
267 267
 					$principals = [];
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 					$query = $this->db->getQueryBuilder();
281 281
 					$query->select(['id', 'backend_id', 'resource_id', 'email', 'displayname', 'group_restrictions'])
282 282
 						->from($this->dbTableName)
283
-						->where($query->expr()->iLike('displayname', $query->createNamedParameter('%' . $this->db->escapeLikeParameter($value) . '%')));
283
+						->where($query->expr()->iLike('displayname', $query->createNamedParameter('%'.$this->db->escapeLikeParameter($value).'%')));
284 284
 
285 285
 					$stmt = $query->execute();
286 286
 					$principals = [];
@@ -305,11 +305,11 @@  discard block
 block discarded – undo
305 305
 
306 306
 				default:
307 307
 					$rowsByMetadata = $this->searchPrincipalsByMetadataKey($prop, $value);
308
-					$filteredRows = array_filter($rowsByMetadata, function ($row) use ($usersGroups) {
308
+					$filteredRows = array_filter($rowsByMetadata, function($row) use ($usersGroups) {
309 309
 						return $this->isAllowedToAccessResource($row, $usersGroups);
310 310
 					});
311 311
 
312
-					$results[] = array_map(function ($row): string {
312
+					$results[] = array_map(function($row): string {
313 313
 						return $row['uri'];
314 314
 					}, $filteredRows);
315 315
 
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 		$query->select([$this->dbForeignKeyName])
349 349
 			->from($this->dbMetaDataTableName)
350 350
 			->where($query->expr()->eq('key', $query->createNamedParameter($key)))
351
-			->andWhere($query->expr()->iLike('value', $query->createNamedParameter('%' . $this->db->escapeLikeParameter($value) . '%')));
351
+			->andWhere($query->expr()->iLike('value', $query->createNamedParameter('%'.$this->db->escapeLikeParameter($value).'%')));
352 352
 		$stmt = $query->execute();
353 353
 
354 354
 		$rows = [];
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
 			}
406 406
 
407 407
 			[, $name] = \Sabre\Uri\split($path);
408
-			[$backendId, $resourceId] = explode('-',  $name, 2);
408
+			[$backendId, $resourceId] = explode('-', $name, 2);
409 409
 
410 410
 			$query = $this->db->getQueryBuilder();
411 411
 			$query->select(['id', 'backend_id', 'resource_id', 'email', 'displayname', 'group_restrictions'])
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 	 */
438 438
 	private function rowToPrincipal(array $row, array $metadata = []):array {
439 439
 		return array_merge([
440
-			'uri' => $this->principalPrefix . '/' . $row['backend_id'] . '-' . $row['resource_id'],
440
+			'uri' => $this->principalPrefix.'/'.$row['backend_id'].'-'.$row['resource_id'],
441 441
 			'{DAV:}displayname' => $row['displayname'],
442 442
 			'{http://sabredav.org/ns}email-address' => $row['email'],
443 443
 			'{urn:ietf:params:xml:ns:caldav}calendar-user-type' => $this->cuType,
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
 		// group restrictions contains something, but not parsable, deny access and log warning
460 460
 		$json = json_decode($row['group_restrictions']);
461 461
 		if (!\is_array($json)) {
462
-			$this->logger->info('group_restrictions field could not be parsed for ' . $this->dbTableName . '::' . $row['id'] . ', denying access to resource');
462
+			$this->logger->info('group_restrictions field could not be parsed for '.$this->dbTableName.'::'.$row['id'].', denying access to resource');
463 463
 			return false;
464 464
 		}
465 465
 
Please login to merge, or discard this patch.
apps/dav/lib/CalDAV/Schedule/IMipPlugin.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -227,11 +227,11 @@  discard block
 block discarded – undo
227 227
 		}
228 228
 
229 229
 		$data = [
230
-			'attendee_name' => (string)$meetingAttendeeName ?: $defaultVal,
231
-			'invitee_name' => (string)$meetingInviteeName ?: $defaultVal,
232
-			'meeting_title' => (string)$meetingTitle ?: $defaultVal,
233
-			'meeting_description' => (string)$meetingDescription ?: $defaultVal,
234
-			'meeting_url' => (string)$meetingUrl ?: $defaultVal,
230
+			'attendee_name' => (string) $meetingAttendeeName ?: $defaultVal,
231
+			'invitee_name' => (string) $meetingInviteeName ?: $defaultVal,
232
+			'meeting_title' => (string) $meetingTitle ?: $defaultVal,
233
+			'meeting_description' => (string) $meetingDescription ?: $defaultVal,
234
+			'meeting_url' => (string) $meetingUrl ?: $defaultVal,
235 235
 		];
236 236
 
237 237
 		$fromEMail = Util::getDefaultEmailAddress('invitations-noreply');
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 			$message->setReplyTo([$sender => $senderName]);
246 246
 		}
247 247
 
248
-		$template = $this->mailer->createEMailTemplate('dav.calendarInvite.' . $method, $data);
248
+		$template = $this->mailer->createEMailTemplate('dav.calendarInvite.'.$method, $data);
249 249
 		$template->addHeader();
250 250
 
251 251
 		$summary = ((string) $summary !== '') ? (string) $summary : $l10n->t('Untitled event');
@@ -292,8 +292,8 @@  discard block
 block discarded – undo
292 292
 
293 293
 		$attachment = $this->mailer->createAttachment(
294 294
 			$iTipMessage->message->serialize(),
295
-			'event.ics',// TODO(leon): Make file name unique, e.g. add event id
296
-			'text/calendar; method=' . $iTipMessage->method
295
+			'event.ics', // TODO(leon): Make file name unique, e.g. add event id
296
+			'text/calendar; method='.$iTipMessage->method
297 297
 		);
298 298
 		$message->attach($attachment);
299 299
 
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 				$lastOccurrence = $firstOccurrence;
341 341
 			}
342 342
 		} else {
343
-			$it = new EventIterator($vObject, (string)$component->UID);
343
+			$it = new EventIterator($vObject, (string) $component->UID);
344 344
 			$maxDate = new \DateTime(self::MAX_DATE);
345 345
 			if ($it->isInfinite()) {
346 346
 				$lastOccurrence = $maxDate->getTimestamp();
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
 			$localeStart = $l10n->l('date', $dtstartDt, ['width' => 'medium']);
457 457
 			$localeEnd = $l10n->l('date', $dtendDt, ['width' => 'medium']);
458 458
 
459
-			return $localeStart . ' - ' . $localeEnd;
459
+			return $localeStart.' - '.$localeEnd;
460 460
 		}
461 461
 
462 462
 		/** @var Property\ICalendar\DateTime $dtstart */
@@ -475,26 +475,26 @@  discard block
 block discarded – undo
475 475
 			}
476 476
 		}
477 477
 
478
-		$localeStart = $l10n->l('weekdayName', $dtstartDt, ['width' => 'abbreviated']) . ', ' .
478
+		$localeStart = $l10n->l('weekdayName', $dtstartDt, ['width' => 'abbreviated']).', '.
479 479
 			$l10n->l('datetime', $dtstartDt, ['width' => 'medium|short']);
480 480
 
481 481
 		// always show full date with timezone if timezones are different
482 482
 		if ($startTimezone !== $endTimezone) {
483 483
 			$localeEnd = $l10n->l('datetime', $dtendDt, ['width' => 'medium|short']);
484 484
 
485
-			return $localeStart . ' (' . $startTimezone . ') - ' .
486
-				$localeEnd . ' (' . $endTimezone . ')';
485
+			return $localeStart.' ('.$startTimezone.') - '.
486
+				$localeEnd.' ('.$endTimezone.')';
487 487
 		}
488 488
 
489 489
 		// show only end time if date is the same
490 490
 		if ($this->isDayEqual($dtstartDt, $dtendDt)) {
491 491
 			$localeEnd = $l10n->l('time', $dtendDt, ['width' => 'short']);
492 492
 		} else {
493
-			$localeEnd = $l10n->l('weekdayName', $dtendDt, ['width' => 'abbreviated']) . ', ' .
493
+			$localeEnd = $l10n->l('weekdayName', $dtendDt, ['width' => 'abbreviated']).', '.
494 494
 				$l10n->l('datetime', $dtendDt, ['width' => 'medium|short']);
495 495
 		}
496 496
 
497
-		return  $localeStart . ' - ' . $localeEnd . ' (' . $startTimezone . ')';
497
+		return  $localeStart.' - '.$localeEnd.' ('.$startTimezone.')';
498 498
 	}
499 499
 
500 500
 	/**
@@ -515,13 +515,13 @@  discard block
 block discarded – undo
515 515
 	private function addSubjectAndHeading(IEMailTemplate $template, IL10N $l10n,
516 516
 										  $method, $summary) {
517 517
 		if ($method === self::METHOD_CANCEL) {
518
-			$template->setSubject('Canceled: ' . $summary);
518
+			$template->setSubject('Canceled: '.$summary);
519 519
 			$template->addHeading($l10n->t('Invitation canceled'));
520 520
 		} elseif ($method === self::METHOD_REPLY) {
521
-			$template->setSubject('Re: ' . $summary);
521
+			$template->setSubject('Re: '.$summary);
522 522
 			$template->addHeading($l10n->t('Invitation updated'));
523 523
 		} else {
524
-			$template->setSubject('Invitation: ' . $summary);
524
+			$template->setSubject('Invitation: '.$summary);
525 525
 			$template->addHeading($l10n->t('Invitation'));
526 526
 		}
527 527
 	}
@@ -534,16 +534,16 @@  discard block
 block discarded – undo
534 534
 	private function addBulletList(IEMailTemplate $template, IL10N $l10n, $vevent) {
535 535
 		if ($vevent->SUMMARY) {
536 536
 			$template->addBodyListItem($vevent->SUMMARY, $l10n->t('Title:'),
537
-				$this->getAbsoluteImagePath('caldav/title.svg'),'','',self::IMIP_INDENT);
537
+				$this->getAbsoluteImagePath('caldav/title.svg'), '', '', self::IMIP_INDENT);
538 538
 		}
539 539
 		$meetingWhen = $this->generateWhenString($l10n, $vevent);
540 540
 		if ($meetingWhen) {
541 541
 			$template->addBodyListItem($meetingWhen, $l10n->t('Time:'),
542
-				$this->getAbsoluteImagePath('caldav/time.svg'),'','',self::IMIP_INDENT);
542
+				$this->getAbsoluteImagePath('caldav/time.svg'), '', '', self::IMIP_INDENT);
543 543
 		}
544 544
 		if ($vevent->LOCATION) {
545 545
 			$template->addBodyListItem($vevent->LOCATION, $l10n->t('Location:'),
546
-				$this->getAbsoluteImagePath('caldav/location.svg'),'','',self::IMIP_INDENT);
546
+				$this->getAbsoluteImagePath('caldav/location.svg'), '', '', self::IMIP_INDENT);
547 547
 		}
548 548
 		if ($vevent->URL) {
549 549
 			$url = $vevent->URL->getValue();
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
 					htmlspecialchars($url)),
553 553
 				$l10n->t('Link:'),
554 554
 				$this->getAbsoluteImagePath('caldav/link.svg'),
555
-				$url,'',self::IMIP_INDENT);
555
+				$url, '', self::IMIP_INDENT);
556 556
 		}
557 557
 
558 558
 		$this->addAttendees($template, $l10n, $vevent);
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
 		/* Put description last, like an email body, since it can be arbitrarily long */
561 561
 		if ($vevent->DESCRIPTION) {
562 562
 			$template->addBodyListItem($vevent->DESCRIPTION->getValue(), $l10n->t('Description:'),
563
-				$this->getAbsoluteImagePath('caldav/description.svg'),'','',self::IMIP_INDENT);
563
+				$this->getAbsoluteImagePath('caldav/description.svg'), '', '', self::IMIP_INDENT);
564 564
 		}
565 565
 	}
566 566
 
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
 			/** @var Property\ICalendar\CalAddress $organizer */
591 591
 			$organizer = $vevent->ORGANIZER;
592 592
 			$organizerURI = $organizer->getNormalizedValue();
593
-			[$scheme,$organizerEmail] = explode(':',$organizerURI,2); # strip off scheme mailto:
593
+			[$scheme, $organizerEmail] = explode(':', $organizerURI, 2); # strip off scheme mailto:
594 594
 			/** @var string|null $organizerName */
595 595
 			$organizerName = isset($organizer['CN']) ? $organizer['CN'] : null;
596 596
 			$organizerHTML = sprintf('<a href="%s">%s</a>',
@@ -607,7 +607,7 @@  discard block
 block discarded – undo
607 607
 			}
608 608
 			$template->addBodyListItem($organizerHTML, $l10n->t('Organizer:'),
609 609
 				$this->getAbsoluteImagePath('caldav/organizer.svg'),
610
-				$organizerText,'',self::IMIP_INDENT);
610
+				$organizerText, '', self::IMIP_INDENT);
611 611
 		}
612 612
 
613 613
 		$attendees = $vevent->select('ATTENDEE');
@@ -619,7 +619,7 @@  discard block
 block discarded – undo
619 619
 		$attendeesText = [];
620 620
 		foreach ($attendees as $attendee) {
621 621
 			$attendeeURI = $attendee->getNormalizedValue();
622
-			[$scheme,$attendeeEmail] = explode(':',$attendeeURI,2); # strip off scheme mailto:
622
+			[$scheme, $attendeeEmail] = explode(':', $attendeeURI, 2); # strip off scheme mailto:
623 623
 			$attendeeName = isset($attendee['CN']) ? $attendee['CN'] : null;
624 624
 			$attendeeHTML = sprintf('<a href="%s">%s</a>',
625 625
 				htmlspecialchars($attendeeURI),
@@ -634,9 +634,9 @@  discard block
 block discarded – undo
634 634
 			array_push($attendeesText, $attendeeText);
635 635
 		}
636 636
 
637
-		$template->addBodyListItem(implode('<br/>',$attendeesHTML), $l10n->t('Attendees:'),
637
+		$template->addBodyListItem(implode('<br/>', $attendeesHTML), $l10n->t('Attendees:'),
638 638
 			$this->getAbsoluteImagePath('caldav/attendees.svg'),
639
-			implode("\n",$attendeesText),'',self::IMIP_INDENT);
639
+			implode("\n", $attendeesText), '', self::IMIP_INDENT);
640 640
 	}
641 641
 
642 642
 	/**
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
 	 * @return string
688 688
 	 */
689 689
 	private function createInvitationToken(Message $iTipMessage, $lastOccurrence):string {
690
-		$token = $this->random->generate(60, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS);
690
+		$token = $this->random->generate(60, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS);
691 691
 
692 692
 		/** @var VEvent $vevent */
693 693
 		$vevent = $iTipMessage->message->VEVENT;
Please login to merge, or discard this patch.
apps/dav/lib/CalDAV/CalDavBackend.php 1 patch
Spacing   +112 added lines, -112 removed lines patch added patch discarded remove patch
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 		}
257 257
 
258 258
 		$result = $query->execute();
259
-		$column = (int)$result->fetchOne();
259
+		$column = (int) $result->fetchOne();
260 260
 		$result->closeCursor();
261 261
 		return $column;
262 262
 	}
@@ -316,18 +316,18 @@  discard block
 block discarded – undo
316 316
 			$row['principaluri'] = (string) $row['principaluri'];
317 317
 			$components = [];
318 318
 			if ($row['components']) {
319
-				$components = explode(',',$row['components']);
319
+				$components = explode(',', $row['components']);
320 320
 			}
321 321
 
322 322
 			$calendar = [
323 323
 				'id' => $row['id'],
324 324
 				'uri' => $row['uri'],
325 325
 				'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
326
-				'{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'),
327
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
328
-				'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
329
-				'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'),
330
-				'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $this->convertPrincipal($principalUri, !$this->legacyEndpoint),
326
+				'{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'),
327
+				'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
328
+				'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
329
+				'{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'),
330
+				'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}owner-principal' => $this->convertPrincipal($principalUri, !$this->legacyEndpoint),
331 331
 			];
332 332
 
333 333
 			foreach ($this->propertyMap as $xmlName => $dbName) {
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
 
368 368
 		$result = $query->execute();
369 369
 
370
-		$readOnlyPropertyName = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only';
370
+		$readOnlyPropertyName = '{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}read-only';
371 371
 		while ($row = $result->fetch()) {
372 372
 			$row['principaluri'] = (string) $row['principaluri'];
373 373
 			if ($row['principaluri'] === $principalUri) {
@@ -388,21 +388,21 @@  discard block
 block discarded – undo
388 388
 			}
389 389
 
390 390
 			[, $name] = Uri\split($row['principaluri']);
391
-			$uri = $row['uri'] . '_shared_by_' . $name;
392
-			$row['displayname'] = $row['displayname'] . ' (' . $this->getUserDisplayName($name) . ')';
391
+			$uri = $row['uri'].'_shared_by_'.$name;
392
+			$row['displayname'] = $row['displayname'].' ('.$this->getUserDisplayName($name).')';
393 393
 			$components = [];
394 394
 			if ($row['components']) {
395
-				$components = explode(',',$row['components']);
395
+				$components = explode(',', $row['components']);
396 396
 			}
397 397
 			$calendar = [
398 398
 				'id' => $row['id'],
399 399
 				'uri' => $uri,
400 400
 				'principaluri' => $this->convertPrincipal($principalUri, !$this->legacyEndpoint),
401
-				'{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'),
402
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
403
-				'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
404
-				'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp('transparent'),
405
-				'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
401
+				'{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'),
402
+				'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
403
+				'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
404
+				'{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp('transparent'),
405
+				'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}owner-principal' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
406 406
 				$readOnlyPropertyName => $readOnly,
407 407
 			];
408 408
 
@@ -443,16 +443,16 @@  discard block
 block discarded – undo
443 443
 			$row['principaluri'] = (string) $row['principaluri'];
444 444
 			$components = [];
445 445
 			if ($row['components']) {
446
-				$components = explode(',',$row['components']);
446
+				$components = explode(',', $row['components']);
447 447
 			}
448 448
 			$calendar = [
449 449
 				'id' => $row['id'],
450 450
 				'uri' => $row['uri'],
451 451
 				'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
452
-				'{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'),
453
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
454
-				'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
455
-				'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'),
452
+				'{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'),
453
+				'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
454
+				'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
455
+				'{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'),
456 456
 			];
457 457
 			foreach ($this->propertyMap as $xmlName => $dbName) {
458 458
 				$calendar[$xmlName] = $row[$dbName];
@@ -512,22 +512,22 @@  discard block
 block discarded – undo
512 512
 		while ($row = $result->fetch()) {
513 513
 			$row['principaluri'] = (string) $row['principaluri'];
514 514
 			[, $name] = Uri\split($row['principaluri']);
515
-			$row['displayname'] = $row['displayname'] . "($name)";
515
+			$row['displayname'] = $row['displayname']."($name)";
516 516
 			$components = [];
517 517
 			if ($row['components']) {
518
-				$components = explode(',',$row['components']);
518
+				$components = explode(',', $row['components']);
519 519
 			}
520 520
 			$calendar = [
521 521
 				'id' => $row['id'],
522 522
 				'uri' => $row['publicuri'],
523 523
 				'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
524
-				'{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'),
525
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
526
-				'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
527
-				'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'),
528
-				'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $this->convertPrincipal($row['principaluri'], $this->legacyEndpoint),
529
-				'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only' => (int)$row['access'] === Backend::ACCESS_READ,
530
-				'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}public' => (int)$row['access'] === self::ACCESS_PUBLIC,
524
+				'{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'),
525
+				'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
526
+				'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
527
+				'{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'),
528
+				'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}owner-principal' => $this->convertPrincipal($row['principaluri'], $this->legacyEndpoint),
529
+				'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}read-only' => (int) $row['access'] === Backend::ACCESS_READ,
530
+				'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}public' => (int) $row['access'] === self::ACCESS_PUBLIC,
531 531
 			];
532 532
 
533 533
 			foreach ($this->propertyMap as $xmlName => $dbName) {
@@ -574,27 +574,27 @@  discard block
 block discarded – undo
574 574
 		$result->closeCursor();
575 575
 
576 576
 		if ($row === false) {
577
-			throw new NotFound('Node with name \'' . $uri . '\' could not be found');
577
+			throw new NotFound('Node with name \''.$uri.'\' could not be found');
578 578
 		}
579 579
 
580 580
 		$row['principaluri'] = (string) $row['principaluri'];
581 581
 		[, $name] = Uri\split($row['principaluri']);
582
-		$row['displayname'] = $row['displayname'] . ' ' . "($name)";
582
+		$row['displayname'] = $row['displayname'].' '."($name)";
583 583
 		$components = [];
584 584
 		if ($row['components']) {
585
-			$components = explode(',',$row['components']);
585
+			$components = explode(',', $row['components']);
586 586
 		}
587 587
 		$calendar = [
588 588
 			'id' => $row['id'],
589 589
 			'uri' => $row['publicuri'],
590 590
 			'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
591
-			'{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'),
592
-			'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
593
-			'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
594
-			'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'),
595
-			'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
596
-			'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only' => (int)$row['access'] === Backend::ACCESS_READ,
597
-			'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}public' => (int)$row['access'] === self::ACCESS_PUBLIC,
591
+			'{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'),
592
+			'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
593
+			'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
594
+			'{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'),
595
+			'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}owner-principal' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
596
+			'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}read-only' => (int) $row['access'] === Backend::ACCESS_READ,
597
+			'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}public' => (int) $row['access'] === self::ACCESS_PUBLIC,
598 598
 		];
599 599
 
600 600
 		foreach ($this->propertyMap as $xmlName => $dbName) {
@@ -637,17 +637,17 @@  discard block
 block discarded – undo
637 637
 		$row['principaluri'] = (string) $row['principaluri'];
638 638
 		$components = [];
639 639
 		if ($row['components']) {
640
-			$components = explode(',',$row['components']);
640
+			$components = explode(',', $row['components']);
641 641
 		}
642 642
 
643 643
 		$calendar = [
644 644
 			'id' => $row['id'],
645 645
 			'uri' => $row['uri'],
646 646
 			'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
647
-			'{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'),
648
-			'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
649
-			'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
650
-			'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'),
647
+			'{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'),
648
+			'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
649
+			'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
650
+			'{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'),
651 651
 		];
652 652
 
653 653
 		foreach ($this->propertyMap as $xmlName => $dbName) {
@@ -688,17 +688,17 @@  discard block
 block discarded – undo
688 688
 		$row['principaluri'] = (string) $row['principaluri'];
689 689
 		$components = [];
690 690
 		if ($row['components']) {
691
-			$components = explode(',',$row['components']);
691
+			$components = explode(',', $row['components']);
692 692
 		}
693 693
 
694 694
 		$calendar = [
695 695
 			'id' => $row['id'],
696 696
 			'uri' => $row['uri'],
697 697
 			'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
698
-			'{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'),
699
-			'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
700
-			'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
701
-			'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'),
698
+			'{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'),
699
+			'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
700
+			'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
701
+			'{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'),
702 702
 		];
703 703
 
704 704
 		foreach ($this->propertyMap as $xmlName => $dbName) {
@@ -742,8 +742,8 @@  discard block
 block discarded – undo
742 742
 			'principaluri' => $row['principaluri'],
743 743
 			'source' => $row['source'],
744 744
 			'lastmodified' => $row['lastmodified'],
745
-			'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet(['VTODO', 'VEVENT']),
746
-			'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
745
+			'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet(['VTODO', 'VEVENT']),
746
+			'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
747 747
 		];
748 748
 
749 749
 		foreach ($this->subscriptionPropertyMap as $xmlName => $dbName) {
@@ -780,16 +780,16 @@  discard block
 block discarded – undo
780 780
 		$sccs = '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set';
781 781
 		if (isset($properties[$sccs])) {
782 782
 			if (!($properties[$sccs] instanceof SupportedCalendarComponentSet)) {
783
-				throw new DAV\Exception('The ' . $sccs . ' property must be of type: \Sabre\CalDAV\Property\SupportedCalendarComponentSet');
783
+				throw new DAV\Exception('The '.$sccs.' property must be of type: \Sabre\CalDAV\Property\SupportedCalendarComponentSet');
784 784
 			}
785
-			$values['components'] = implode(',',$properties[$sccs]->getValue());
785
+			$values['components'] = implode(',', $properties[$sccs]->getValue());
786 786
 		} elseif (isset($properties['components'])) {
787 787
 			// Allow to provide components internally without having
788 788
 			// to create a SupportedCalendarComponentSet object
789 789
 			$values['components'] = $properties['components'];
790 790
 		}
791 791
 
792
-		$transp = '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp';
792
+		$transp = '{'.Plugin::NS_CALDAV.'}schedule-calendar-transp';
793 793
 		if (isset($properties[$transp])) {
794 794
 			$values['transparent'] = (int) ($properties[$transp]->getValue() === 'transparent');
795 795
 		}
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
 		$calendarId = $query->getLastInsertId();
810 810
 
811 811
 		$calendarData = $this->getCalendarById($calendarId);
812
-		$this->dispatcher->dispatchTyped(new CalendarCreatedEvent((int)$calendarId, $calendarData));
812
+		$this->dispatcher->dispatchTyped(new CalendarCreatedEvent((int) $calendarId, $calendarData));
813 813
 		$this->legacyDispatcher->dispatch('\OCA\DAV\CalDAV\CalDavBackend::createCalendar', new GenericEvent(
814 814
 			'\OCA\DAV\CalDAV\CalDavBackend::createCalendar',
815 815
 			[
@@ -838,13 +838,13 @@  discard block
 block discarded – undo
838 838
 	 */
839 839
 	public function updateCalendar($calendarId, PropPatch $propPatch) {
840 840
 		$supportedProperties = array_keys($this->propertyMap);
841
-		$supportedProperties[] = '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp';
841
+		$supportedProperties[] = '{'.Plugin::NS_CALDAV.'}schedule-calendar-transp';
842 842
 
843
-		$propPatch->handle($supportedProperties, function ($mutations) use ($calendarId) {
843
+		$propPatch->handle($supportedProperties, function($mutations) use ($calendarId) {
844 844
 			$newValues = [];
845 845
 			foreach ($mutations as $propertyName => $propertyValue) {
846 846
 				switch ($propertyName) {
847
-					case '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp':
847
+					case '{'.Plugin::NS_CALDAV.'}schedule-calendar-transp':
848 848
 						$fieldName = 'transparent';
849 849
 						$newValues[$fieldName] = (int) ($propertyValue->getValue() === 'transparent');
850 850
 						break;
@@ -866,7 +866,7 @@  discard block
 block discarded – undo
866 866
 
867 867
 			$calendarData = $this->getCalendarById($calendarId);
868 868
 			$shares = $this->getShares($calendarId);
869
-			$this->dispatcher->dispatchTyped(new CalendarUpdatedEvent((int)$calendarId, $calendarData, $shares, $mutations));
869
+			$this->dispatcher->dispatchTyped(new CalendarUpdatedEvent((int) $calendarId, $calendarData, $shares, $mutations));
870 870
 			$this->legacyDispatcher->dispatch('\OCA\DAV\CalDAV\CalDavBackend::updateCalendar', new GenericEvent(
871 871
 				'\OCA\DAV\CalDAV\CalDavBackend::updateCalendar',
872 872
 				[
@@ -916,7 +916,7 @@  discard block
 block discarded – undo
916 916
 			->execute();
917 917
 
918 918
 		if ($calendarData) {
919
-			$this->dispatcher->dispatchTyped(new CalendarDeletedEvent((int)$calendarId, $calendarData, $shares));
919
+			$this->dispatcher->dispatchTyped(new CalendarDeletedEvent((int) $calendarId, $calendarData, $shares));
920 920
 		}
921 921
 	}
922 922
 
@@ -976,11 +976,11 @@  discard block
 block discarded – undo
976 976
 				'id' => $row['id'],
977 977
 				'uri' => $row['uri'],
978 978
 				'lastmodified' => $row['lastmodified'],
979
-				'etag' => '"' . $row['etag'] . '"',
979
+				'etag' => '"'.$row['etag'].'"',
980 980
 				'calendarid' => $row['calendarid'],
981
-				'size' => (int)$row['size'],
981
+				'size' => (int) $row['size'],
982 982
 				'component' => strtolower($row['componenttype']),
983
-				'classification' => (int)$row['classification']
983
+				'classification' => (int) $row['classification']
984 984
 			];
985 985
 		}
986 986
 		$stmt->closeCursor();
@@ -1024,12 +1024,12 @@  discard block
 block discarded – undo
1024 1024
 			'id' => $row['id'],
1025 1025
 			'uri' => $row['uri'],
1026 1026
 			'lastmodified' => $row['lastmodified'],
1027
-			'etag' => '"' . $row['etag'] . '"',
1027
+			'etag' => '"'.$row['etag'].'"',
1028 1028
 			'calendarid' => $row['calendarid'],
1029
-			'size' => (int)$row['size'],
1029
+			'size' => (int) $row['size'],
1030 1030
 			'calendardata' => $this->readBlob($row['calendardata']),
1031 1031
 			'component' => strtolower($row['componenttype']),
1032
-			'classification' => (int)$row['classification']
1032
+			'classification' => (int) $row['classification']
1033 1033
 		];
1034 1034
 	}
1035 1035
 
@@ -1070,12 +1070,12 @@  discard block
 block discarded – undo
1070 1070
 					'id' => $row['id'],
1071 1071
 					'uri' => $row['uri'],
1072 1072
 					'lastmodified' => $row['lastmodified'],
1073
-					'etag' => '"' . $row['etag'] . '"',
1073
+					'etag' => '"'.$row['etag'].'"',
1074 1074
 					'calendarid' => $row['calendarid'],
1075
-					'size' => (int)$row['size'],
1075
+					'size' => (int) $row['size'],
1076 1076
 					'calendardata' => $this->readBlob($row['calendardata']),
1077 1077
 					'component' => strtolower($row['componenttype']),
1078
-					'classification' => (int)$row['classification']
1078
+					'classification' => (int) $row['classification']
1079 1079
 				];
1080 1080
 			}
1081 1081
 			$result->closeCursor();
@@ -1147,7 +1147,7 @@  discard block
 block discarded – undo
1147 1147
 			$calendarRow = $this->getCalendarById($calendarId);
1148 1148
 			$shares = $this->getShares($calendarId);
1149 1149
 
1150
-			$this->dispatcher->dispatchTyped(new CalendarObjectCreatedEvent((int)$calendarId, $calendarRow, $shares, $objectRow));
1150
+			$this->dispatcher->dispatchTyped(new CalendarObjectCreatedEvent((int) $calendarId, $calendarRow, $shares, $objectRow));
1151 1151
 			$this->legacyDispatcher->dispatch('\OCA\DAV\CalDAV\CalDavBackend::createCalendarObject', new GenericEvent(
1152 1152
 				'\OCA\DAV\CalDAV\CalDavBackend::createCalendarObject',
1153 1153
 				[
@@ -1160,7 +1160,7 @@  discard block
 block discarded – undo
1160 1160
 		} else {
1161 1161
 			$subscriptionRow = $this->getSubscriptionById($calendarId);
1162 1162
 
1163
-			$this->dispatcher->dispatchTyped(new CachedCalendarObjectCreatedEvent((int)$calendarId, $subscriptionRow, [], $objectRow));
1163
+			$this->dispatcher->dispatchTyped(new CachedCalendarObjectCreatedEvent((int) $calendarId, $subscriptionRow, [], $objectRow));
1164 1164
 			$this->legacyDispatcher->dispatch('\OCA\DAV\CalDAV\CalDavBackend::createCachedCalendarObject', new GenericEvent(
1165 1165
 				'\OCA\DAV\CalDAV\CalDavBackend::createCachedCalendarObject',
1166 1166
 				[
@@ -1172,7 +1172,7 @@  discard block
 block discarded – undo
1172 1172
 			));
1173 1173
 		}
1174 1174
 
1175
-		return '"' . $extraData['etag'] . '"';
1175
+		return '"'.$extraData['etag'].'"';
1176 1176
 	}
1177 1177
 
1178 1178
 	/**
@@ -1221,7 +1221,7 @@  discard block
 block discarded – undo
1221 1221
 				$calendarRow = $this->getCalendarById($calendarId);
1222 1222
 				$shares = $this->getShares($calendarId);
1223 1223
 
1224
-				$this->dispatcher->dispatchTyped(new CalendarObjectUpdatedEvent((int)$calendarId, $calendarRow, $shares, $objectRow));
1224
+				$this->dispatcher->dispatchTyped(new CalendarObjectUpdatedEvent((int) $calendarId, $calendarRow, $shares, $objectRow));
1225 1225
 				$this->legacyDispatcher->dispatch('\OCA\DAV\CalDAV\CalDavBackend::updateCalendarObject', new GenericEvent(
1226 1226
 					'\OCA\DAV\CalDAV\CalDavBackend::updateCalendarObject',
1227 1227
 					[
@@ -1234,7 +1234,7 @@  discard block
 block discarded – undo
1234 1234
 			} else {
1235 1235
 				$subscriptionRow = $this->getSubscriptionById($calendarId);
1236 1236
 
1237
-				$this->dispatcher->dispatchTyped(new CachedCalendarObjectUpdatedEvent((int)$calendarId, $subscriptionRow, [], $objectRow));
1237
+				$this->dispatcher->dispatchTyped(new CachedCalendarObjectUpdatedEvent((int) $calendarId, $subscriptionRow, [], $objectRow));
1238 1238
 				$this->legacyDispatcher->dispatch('\OCA\DAV\CalDAV\CalDavBackend::updateCachedCalendarObject', new GenericEvent(
1239 1239
 					'\OCA\DAV\CalDAV\CalDavBackend::updateCachedCalendarObject',
1240 1240
 					[
@@ -1247,7 +1247,7 @@  discard block
 block discarded – undo
1247 1247
 			}
1248 1248
 		}
1249 1249
 
1250
-		return '"' . $extraData['etag'] . '"';
1250
+		return '"'.$extraData['etag'].'"';
1251 1251
 	}
1252 1252
 
1253 1253
 	/**
@@ -1284,7 +1284,7 @@  discard block
 block discarded – undo
1284 1284
 				$calendarRow = $this->getCalendarById($calendarId);
1285 1285
 				$shares = $this->getShares($calendarId);
1286 1286
 
1287
-				$this->dispatcher->dispatchTyped(new CalendarObjectDeletedEvent((int)$calendarId, $calendarRow, $shares, $data));
1287
+				$this->dispatcher->dispatchTyped(new CalendarObjectDeletedEvent((int) $calendarId, $calendarRow, $shares, $data));
1288 1288
 				$this->legacyDispatcher->dispatch('\OCA\DAV\CalDAV\CalDavBackend::deleteCalendarObject', new GenericEvent(
1289 1289
 					'\OCA\DAV\CalDAV\CalDavBackend::deleteCalendarObject',
1290 1290
 					[
@@ -1297,7 +1297,7 @@  discard block
 block discarded – undo
1297 1297
 			} else {
1298 1298
 				$subscriptionRow = $this->getSubscriptionById($calendarId);
1299 1299
 
1300
-				$this->dispatcher->dispatchTyped(new CachedCalendarObjectDeletedEvent((int)$calendarId, $subscriptionRow, [], $data));
1300
+				$this->dispatcher->dispatchTyped(new CachedCalendarObjectDeletedEvent((int) $calendarId, $subscriptionRow, [], $data));
1301 1301
 				$this->legacyDispatcher->dispatch('\OCA\DAV\CalDAV\CalDavBackend::deleteCachedCalendarObject', new GenericEvent(
1302 1302
 					'\OCA\DAV\CalDAV\CalDavBackend::deleteCachedCalendarObject',
1303 1303
 					[
@@ -1569,7 +1569,7 @@  discard block
 block discarded – undo
1569 1569
 
1570 1570
 		$result = [];
1571 1571
 		while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
1572
-			$path = $uriMapper[$row['calendarid']] . '/' . $row['uri'];
1572
+			$path = $uriMapper[$row['calendarid']].'/'.$row['uri'];
1573 1573
 			if (!in_array($path, $result)) {
1574 1574
 				$result[] = $path;
1575 1575
 			}
@@ -1617,8 +1617,8 @@  discard block
 block discarded – undo
1617 1617
 
1618 1618
 		if ($pattern !== '') {
1619 1619
 			$innerQuery->andWhere($innerQuery->expr()->iLike('op.value',
1620
-				$outerQuery->createNamedParameter('%' .
1621
-					$this->db->escapeLikeParameter($pattern) . '%')));
1620
+				$outerQuery->createNamedParameter('%'.
1621
+					$this->db->escapeLikeParameter($pattern).'%')));
1622 1622
 		}
1623 1623
 
1624 1624
 		$outerQuery->select('c.id', 'c.calendardata', 'c.componenttype', 'c.uid', 'c.uri')
@@ -1657,7 +1657,7 @@  discard block
 block discarded – undo
1657 1657
 		$result = $outerQuery->execute();
1658 1658
 		$calendarObjects = $result->fetchAll();
1659 1659
 
1660
-		return array_map(function ($o) {
1660
+		return array_map(function($o) {
1661 1661
 			$calendarData = Reader::read($o['calendardata']);
1662 1662
 			$comps = $calendarData->getComponents();
1663 1663
 			$objects = [];
@@ -1675,10 +1675,10 @@  discard block
 block discarded – undo
1675 1675
 				'type' => $o['componenttype'],
1676 1676
 				'uid' => $o['uid'],
1677 1677
 				'uri' => $o['uri'],
1678
-				'objects' => array_map(function ($c) {
1678
+				'objects' => array_map(function($c) {
1679 1679
 					return $this->transformSearchData($c);
1680 1680
 				}, $objects),
1681
-				'timezones' => array_map(function ($c) {
1681
+				'timezones' => array_map(function($c) {
1682 1682
 					return $this->transformSearchData($c);
1683 1683
 				}, $timezones),
1684 1684
 			];
@@ -1694,7 +1694,7 @@  discard block
 block discarded – undo
1694 1694
 		/** @var Component[] $subComponents */
1695 1695
 		$subComponents = $comp->getComponents();
1696 1696
 		/** @var Property[] $properties */
1697
-		$properties = array_filter($comp->children(), function ($c) {
1697
+		$properties = array_filter($comp->children(), function($c) {
1698 1698
 			return $c instanceof Property;
1699 1699
 		});
1700 1700
 		$validationRules = $comp->getValidationRules();
@@ -1772,7 +1772,7 @@  discard block
 block discarded – undo
1772 1772
 		$subscriptions = $this->getSubscriptionsForUser($principalUri);
1773 1773
 		foreach ($calendars as $calendar) {
1774 1774
 			$calendarAnd = $calendarObjectIdQuery->expr()->andX();
1775
-			$calendarAnd->add($calendarObjectIdQuery->expr()->eq('cob.calendarid', $calendarObjectIdQuery->createNamedParameter((int)$calendar['id'])));
1775
+			$calendarAnd->add($calendarObjectIdQuery->expr()->eq('cob.calendarid', $calendarObjectIdQuery->createNamedParameter((int) $calendar['id'])));
1776 1776
 			$calendarAnd->add($calendarObjectIdQuery->expr()->eq('cob.calendartype', $calendarObjectIdQuery->createNamedParameter(self::CALENDAR_TYPE_CALENDAR)));
1777 1777
 
1778 1778
 			// If it's shared, limit search to public events
@@ -1785,7 +1785,7 @@  discard block
 block discarded – undo
1785 1785
 		}
1786 1786
 		foreach ($subscriptions as $subscription) {
1787 1787
 			$subscriptionAnd = $calendarObjectIdQuery->expr()->andX();
1788
-			$subscriptionAnd->add($calendarObjectIdQuery->expr()->eq('cob.calendarid', $calendarObjectIdQuery->createNamedParameter((int)$subscription['id'])));
1788
+			$subscriptionAnd->add($calendarObjectIdQuery->expr()->eq('cob.calendarid', $calendarObjectIdQuery->createNamedParameter((int) $subscription['id'])));
1789 1789
 			$subscriptionAnd->add($calendarObjectIdQuery->expr()->eq('cob.calendartype', $calendarObjectIdQuery->createNamedParameter(self::CALENDAR_TYPE_SUBSCRIPTION)));
1790 1790
 
1791 1791
 			// If it's shared, limit search to public events
@@ -1830,7 +1830,7 @@  discard block
 block discarded – undo
1830 1830
 			if (!$escapePattern) {
1831 1831
 				$calendarObjectIdQuery->andWhere($calendarObjectIdQuery->expr()->ilike('cob.value', $calendarObjectIdQuery->createNamedParameter($pattern)));
1832 1832
 			} else {
1833
-				$calendarObjectIdQuery->andWhere($calendarObjectIdQuery->expr()->ilike('cob.value', $calendarObjectIdQuery->createNamedParameter('%' . $this->db->escapeLikeParameter($pattern) . '%')));
1833
+				$calendarObjectIdQuery->andWhere($calendarObjectIdQuery->expr()->ilike('cob.value', $calendarObjectIdQuery->createNamedParameter('%'.$this->db->escapeLikeParameter($pattern).'%')));
1834 1834
 			}
1835 1835
 		}
1836 1836
 
@@ -1844,7 +1844,7 @@  discard block
 block discarded – undo
1844 1844
 		$result = $calendarObjectIdQuery->execute();
1845 1845
 		$matches = $result->fetchAll();
1846 1846
 		$result->closeCursor();
1847
-		$matches = array_map(static function (array $match):int {
1847
+		$matches = array_map(static function(array $match):int {
1848 1848
 			return (int) $match['objectid'];
1849 1849
 		}, $matches);
1850 1850
 
@@ -1857,9 +1857,9 @@  discard block
 block discarded – undo
1857 1857
 		$calendarObjects = $result->fetchAll();
1858 1858
 		$result->closeCursor();
1859 1859
 
1860
-		return array_map(function (array $array): array {
1861
-			$array['calendarid'] = (int)$array['calendarid'];
1862
-			$array['calendartype'] = (int)$array['calendartype'];
1860
+		return array_map(function(array $array): array {
1861
+			$array['calendarid'] = (int) $array['calendarid'];
1862
+			$array['calendartype'] = (int) $array['calendartype'];
1863 1863
 			$array['calendardata'] = $this->readBlob($array['calendardata']);
1864 1864
 
1865 1865
 			return $array;
@@ -1896,7 +1896,7 @@  discard block
 block discarded – undo
1896 1896
 		$stmt = $query->execute();
1897 1897
 
1898 1898
 		if ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
1899
-			return $row['calendaruri'] . '/' . $row['objecturi'];
1899
+			return $row['calendaruri'].'/'.$row['objecturi'];
1900 1900
 		}
1901 1901
 
1902 1902
 		return null;
@@ -2096,8 +2096,8 @@  discard block
 block discarded – undo
2096 2096
 				'source' => $row['source'],
2097 2097
 				'lastmodified' => $row['lastmodified'],
2098 2098
 
2099
-				'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet(['VTODO', 'VEVENT']),
2100
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
2099
+				'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet(['VTODO', 'VEVENT']),
2100
+				'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
2101 2101
 			];
2102 2102
 
2103 2103
 			foreach ($this->subscriptionPropertyMap as $xmlName => $dbName) {
@@ -2192,7 +2192,7 @@  discard block
 block discarded – undo
2192 2192
 		$supportedProperties = array_keys($this->subscriptionPropertyMap);
2193 2193
 		$supportedProperties[] = '{http://calendarserver.org/ns/}source';
2194 2194
 
2195
-		$propPatch->handle($supportedProperties, function ($mutations) use ($subscriptionId) {
2195
+		$propPatch->handle($supportedProperties, function($mutations) use ($subscriptionId) {
2196 2196
 			$newValues = [];
2197 2197
 
2198 2198
 			foreach ($mutations as $propertyName => $propertyValue) {
@@ -2214,7 +2214,7 @@  discard block
 block discarded – undo
2214 2214
 				->execute();
2215 2215
 
2216 2216
 			$subscriptionRow = $this->getSubscriptionById($subscriptionId);
2217
-			$this->dispatcher->dispatchTyped(new SubscriptionUpdatedEvent((int)$subscriptionId, $subscriptionRow, [], $mutations));
2217
+			$this->dispatcher->dispatchTyped(new SubscriptionUpdatedEvent((int) $subscriptionId, $subscriptionRow, [], $mutations));
2218 2218
 			$this->legacyDispatcher->dispatch('\OCA\DAV\CalDAV\CalDavBackend::updateSubscription', new GenericEvent(
2219 2219
 				'\OCA\DAV\CalDAV\CalDavBackend::updateSubscription',
2220 2220
 				[
@@ -2265,7 +2265,7 @@  discard block
 block discarded – undo
2265 2265
 			->execute();
2266 2266
 
2267 2267
 		if ($subscriptionRow) {
2268
-			$this->dispatcher->dispatchTyped(new SubscriptionDeletedEvent((int)$subscriptionId, $subscriptionRow, []));
2268
+			$this->dispatcher->dispatchTyped(new SubscriptionDeletedEvent((int) $subscriptionId, $subscriptionRow, []));
2269 2269
 		}
2270 2270
 	}
2271 2271
 
@@ -2303,8 +2303,8 @@  discard block
 block discarded – undo
2303 2303
 			'uri' => $row['uri'],
2304 2304
 			'calendardata' => $row['calendardata'],
2305 2305
 			'lastmodified' => $row['lastmodified'],
2306
-			'etag' => '"' . $row['etag'] . '"',
2307
-			'size' => (int)$row['size'],
2306
+			'etag' => '"'.$row['etag'].'"',
2307
+			'size' => (int) $row['size'],
2308 2308
 		];
2309 2309
 	}
2310 2310
 
@@ -2332,8 +2332,8 @@  discard block
 block discarded – undo
2332 2332
 				'calendardata' => $row['calendardata'],
2333 2333
 				'uri' => $row['uri'],
2334 2334
 				'lastmodified' => $row['lastmodified'],
2335
-				'etag' => '"' . $row['etag'] . '"',
2336
-				'size' => (int)$row['size'],
2335
+				'etag' => '"'.$row['etag'].'"',
2336
+				'size' => (int) $row['size'],
2337 2337
 			];
2338 2338
 		}
2339 2339
 
@@ -2387,14 +2387,14 @@  discard block
 block discarded – undo
2387 2387
 	 * @return void
2388 2388
 	 */
2389 2389
 	protected function addChange($calendarId, $objectUri, $operation, $calendarType = self::CALENDAR_TYPE_CALENDAR) {
2390
-		$table = $calendarType === self::CALENDAR_TYPE_CALENDAR ? 'calendars': 'calendarsubscriptions';
2390
+		$table = $calendarType === self::CALENDAR_TYPE_CALENDAR ? 'calendars' : 'calendarsubscriptions';
2391 2391
 
2392 2392
 		$query = $this->db->getQueryBuilder();
2393 2393
 		$query->select('synctoken')
2394 2394
 			->from($table)
2395 2395
 			->where($query->expr()->eq('id', $query->createNamedParameter($calendarId)));
2396 2396
 		$result = $query->execute();
2397
-		$syncToken = (int)$result->fetchOne();
2397
+		$syncToken = (int) $result->fetchOne();
2398 2398
 		$result->closeCursor();
2399 2399
 
2400 2400
 		$query = $this->db->getQueryBuilder();
@@ -2451,7 +2451,7 @@  discard block
 block discarded – undo
2451 2451
 				// Track first component type and uid
2452 2452
 				if ($uid === null) {
2453 2453
 					$componentType = $component->name;
2454
-					$uid = (string)$component->UID;
2454
+					$uid = (string) $component->UID;
2455 2455
 				}
2456 2456
 			}
2457 2457
 		}
@@ -2550,7 +2550,7 @@  discard block
 block discarded – undo
2550 2550
 			]));
2551 2551
 		$this->calendarSharingBackend->updateShares($shareable, $add, $remove);
2552 2552
 
2553
-		$this->dispatcher->dispatchTyped(new CalendarShareUpdatedEvent((int)$calendarId, $calendarRow, $oldShares, $add, $remove));
2553
+		$this->dispatcher->dispatchTyped(new CalendarShareUpdatedEvent((int) $calendarId, $calendarRow, $oldShares, $add, $remove));
2554 2554
 	}
2555 2555
 
2556 2556
 	/**
@@ -2591,7 +2591,7 @@  discard block
 block discarded – undo
2591 2591
 				]);
2592 2592
 			$query->execute();
2593 2593
 
2594
-			$this->dispatcher->dispatchTyped(new CalendarPublishedEvent((int)$calendarId, $calendarData, $publicUri));
2594
+			$this->dispatcher->dispatchTyped(new CalendarPublishedEvent((int) $calendarId, $calendarData, $publicUri));
2595 2595
 			return $publicUri;
2596 2596
 		}
2597 2597
 		$query->delete('dav_shares')
@@ -2599,7 +2599,7 @@  discard block
 block discarded – undo
2599 2599
 			->andWhere($query->expr()->eq('access', $query->createNamedParameter(self::ACCESS_PUBLIC)));
2600 2600
 		$query->execute();
2601 2601
 
2602
-		$this->dispatcher->dispatchTyped(new CalendarUnpublishedEvent((int)$calendarId, $calendarData));
2602
+		$this->dispatcher->dispatchTyped(new CalendarUnpublishedEvent((int) $calendarId, $calendarData));
2603 2603
 		return null;
2604 2604
 	}
2605 2605
 
@@ -2822,10 +2822,10 @@  discard block
 block discarded – undo
2822 2822
 		$result->closeCursor();
2823 2823
 
2824 2824
 		if (!isset($objectIds['id'])) {
2825
-			throw new \InvalidArgumentException('Calendarobject does not exists: ' . $uri);
2825
+			throw new \InvalidArgumentException('Calendarobject does not exists: '.$uri);
2826 2826
 		}
2827 2827
 
2828
-		return (int)$objectIds['id'];
2828
+		return (int) $objectIds['id'];
2829 2829
 	}
2830 2830
 
2831 2831
 	/**
@@ -2852,8 +2852,8 @@  discard block
 block discarded – undo
2852 2852
 	 * @param $calendarInfo
2853 2853
 	 */
2854 2854
 	private function addOwnerPrincipal(&$calendarInfo) {
2855
-		$ownerPrincipalKey = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal';
2856
-		$displaynameKey = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_NEXTCLOUD . '}owner-displayname';
2855
+		$ownerPrincipalKey = '{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}owner-principal';
2856
+		$displaynameKey = '{'.\OCA\DAV\DAV\Sharing\Plugin::NS_NEXTCLOUD.'}owner-displayname';
2857 2857
 		if (isset($calendarInfo[$ownerPrincipalKey])) {
2858 2858
 			$uri = $calendarInfo[$ownerPrincipalKey];
2859 2859
 		} else {
Please login to merge, or discard this patch.
apps/federatedfilesharing/lib/FederatedShareProvider.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 		if ($remoteShare) {
220 220
 			try {
221 221
 				$ownerCloudId = $this->cloudIdManager->getCloudId($remoteShare['owner'], $remoteShare['remote']);
222
-				$shareId = $this->addShareToDB($itemSource, $itemType, $shareWith, $sharedBy, $ownerCloudId->getId(), $permissions, 'tmp_token_' . time(), $shareType);
222
+				$shareId = $this->addShareToDB($itemSource, $itemType, $shareWith, $sharedBy, $ownerCloudId->getId(), $permissions, 'tmp_token_'.time(), $shareType);
223 223
 				$share->setId($shareId);
224 224
 				[$token, $remoteId] = $this->askOwnerToReShare($shareWith, $share, $shareId);
225 225
 				// remote share was create successfully if we get a valid token as return
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
 		$result = $qResult->fetchAll();
353 353
 		$qResult->closeCursor();
354 354
 
355
-		if (isset($result[0]) && (int)$result[0]['remote_id'] > 0) {
355
+		if (isset($result[0]) && (int) $result[0]['remote_id'] > 0) {
356 356
 			return $result[0];
357 357
 		}
358 358
 
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 		$qb->execute();
396 396
 		$id = $qb->getLastInsertId();
397 397
 
398
-		return (int)$id;
398
+		return (int) $id;
399 399
 	}
400 400
 
401 401
 	/**
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
 	public function getRemoteId(IShare $share): string {
486 486
 		$query = $this->dbConnection->getQueryBuilder();
487 487
 		$query->select('remote_id')->from('federated_reshares')
488
-			->where($query->expr()->eq('share_id', $query->createNamedParameter((int)$share->getId())));
488
+			->where($query->expr()->eq('share_id', $query->createNamedParameter((int) $share->getId())));
489 489
 		$result = $query->execute();
490 490
 		$data = $result->fetch();
491 491
 		$result->closeCursor();
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
 			throw new ShareNotFound();
495 495
 		}
496 496
 
497
-		return (string)$data['remote_id'];
497
+		return (string) $data['remote_id'];
498 498
 	}
499 499
 
500 500
 	/**
@@ -652,7 +652,7 @@  discard block
 block discarded – undo
652 652
 			);
653 653
 		}
654 654
 
655
-		$qb->innerJoin('s', 'filecache' ,'f', $qb->expr()->eq('s.file_source', 'f.fileid'));
655
+		$qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid'));
656 656
 		$qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId())));
657 657
 
658 658
 		$qb->orderBy('id');
@@ -739,7 +739,7 @@  discard block
 block discarded – undo
739 739
 		$cursor->closeCursor();
740 740
 
741 741
 		if ($data === false) {
742
-			throw new ShareNotFound('Can not find share with ID: ' . $id);
742
+			throw new ShareNotFound('Can not find share with ID: '.$id);
743 743
 		}
744 744
 
745 745
 		try {
@@ -883,15 +883,15 @@  discard block
 block discarded – undo
883 883
 	 */
884 884
 	private function createShareObject($data) {
885 885
 		$share = new Share($this->rootFolder, $this->userManager);
886
-		$share->setId((int)$data['id'])
887
-			->setShareType((int)$data['share_type'])
888
-			->setPermissions((int)$data['permissions'])
886
+		$share->setId((int) $data['id'])
887
+			->setShareType((int) $data['share_type'])
888
+			->setPermissions((int) $data['permissions'])
889 889
 			->setTarget($data['file_target'])
890
-			->setMailSend((bool)$data['mail_send'])
890
+			->setMailSend((bool) $data['mail_send'])
891 891
 			->setToken($data['token']);
892 892
 
893 893
 		$shareTime = new \DateTime();
894
-		$shareTime->setTimestamp((int)$data['stime']);
894
+		$shareTime->setTimestamp((int) $data['stime']);
895 895
 		$share->setShareTime($shareTime);
896 896
 		$share->setSharedWith($data['share_with']);
897 897
 
@@ -901,13 +901,13 @@  discard block
 block discarded – undo
901 901
 		} else {
902 902
 			//OLD SHARE
903 903
 			$share->setSharedBy($data['uid_owner']);
904
-			$path = $this->getNode($share->getSharedBy(), (int)$data['file_source']);
904
+			$path = $this->getNode($share->getSharedBy(), (int) $data['file_source']);
905 905
 
906 906
 			$owner = $path->getOwner();
907 907
 			$share->setShareOwner($owner->getUID());
908 908
 		}
909 909
 
910
-		$share->setNodeId((int)$data['file_source']);
910
+		$share->setNodeId((int) $data['file_source']);
911 911
 		$share->setNodeType($data['item_type']);
912 912
 
913 913
 		$share->setProviderId($this->identifier());
Please login to merge, or discard this patch.
apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 		// for backward compatibility make sure that the remote url stored in the
188 188
 		// database ends with a trailing slash
189 189
 		if (substr($remote, -1) !== '/') {
190
-			$remote = $remote . '/';
190
+			$remote = $remote.'/';
191 191
 		}
192 192
 
193 193
 		$token = $share->getShareSecret();
@@ -214,23 +214,23 @@  discard block
 block discarded – undo
214 214
 
215 215
 			// FIXME this should be a method in the user management instead
216 216
 			if ($shareType === IShare::TYPE_USER) {
217
-				$this->logger->debug('shareWith before, ' . $shareWith, ['app' => 'files_sharing']);
217
+				$this->logger->debug('shareWith before, '.$shareWith, ['app' => 'files_sharing']);
218 218
 				Util::emitHook(
219 219
 					'\OCA\Files_Sharing\API\Server2Server',
220 220
 					'preLoginNameUsedAsUserName',
221 221
 					['uid' => &$shareWith]
222 222
 				);
223
-				$this->logger->debug('shareWith after, ' . $shareWith, ['app' => 'files_sharing']);
223
+				$this->logger->debug('shareWith after, '.$shareWith, ['app' => 'files_sharing']);
224 224
 
225 225
 				if (!$this->userManager->userExists($shareWith)) {
226
-					throw new ProviderCouldNotAddShareException('User does not exists', '',Http::STATUS_BAD_REQUEST);
226
+					throw new ProviderCouldNotAddShareException('User does not exists', '', Http::STATUS_BAD_REQUEST);
227 227
 				}
228 228
 
229 229
 				\OC_Util::setupFS($shareWith);
230 230
 			}
231 231
 
232 232
 			if ($shareType === IShare::TYPE_GROUP && !$this->groupManager->groupExists($shareWith)) {
233
-				throw new ProviderCouldNotAddShareException('Group does not exists', '',Http::STATUS_BAD_REQUEST);
233
+				throw new ProviderCouldNotAddShareException('Group does not exists', '', Http::STATUS_BAD_REQUEST);
234 234
 			}
235 235
 
236 236
 			$externalManager = new \OCA\Files_Sharing\External\Manager(
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 			);
250 250
 
251 251
 			try {
252
-				$externalManager->addShare($remote, $token, '', $name, $owner, $shareType,false, $shareWith, $remoteId);
252
+				$externalManager->addShare($remote, $token, '', $name, $owner, $shareType, false, $shareWith, $remoteId);
253 253
 				$shareId = \OC::$server->getDatabaseConnection()->lastInsertId('*PREFIX*share_external');
254 254
 
255 255
 				if ($shareType === IShare::TYPE_USER) {
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 						->setType('remote_share')
259 259
 						->setSubject(RemoteShares::SUBJECT_REMOTE_SHARE_RECEIVED, [$ownerFederatedId, trim($name, '/')])
260 260
 						->setAffectedUser($shareWith)
261
-						->setObject('remote_share', (int)$shareId, $name);
261
+						->setObject('remote_share', (int) $shareId, $name);
262 262
 					\OC::$server->getActivityManager()->publish($event);
263 263
 					$this->notifyAboutNewShare($shareWith, $shareId, $ownerFederatedId, $sharedByFederatedId, $name);
264 264
 				} else {
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 							->setType('remote_share')
270 270
 							->setSubject(RemoteShares::SUBJECT_REMOTE_SHARE_RECEIVED, [$ownerFederatedId, trim($name, '/')])
271 271
 							->setAffectedUser($user->getUID())
272
-							->setObject('remote_share', (int)$shareId, $name);
272
+							->setObject('remote_share', (int) $shareId, $name);
273 273
 						\OC::$server->getActivityManager()->publish($event);
274 274
 						$this->notifyAboutNewShare($user->getUID(), $shareId, $ownerFederatedId, $sharedByFederatedId, $name);
275 275
 					}
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 					'level' => ILogger::ERROR,
282 282
 					'app' => 'files_sharing'
283 283
 				]);
284
-				throw new ProviderCouldNotAddShareException('internal server error, was not able to add share from ' . $remote, '', HTTP::STATUS_INTERNAL_SERVER_ERROR);
284
+				throw new ProviderCouldNotAddShareException('internal server error, was not able to add share from '.$remote, '', HTTP::STATUS_INTERNAL_SERVER_ERROR);
285 285
 			}
286 286
 		}
287 287
 
@@ -347,12 +347,12 @@  discard block
 block discarded – undo
347 347
 
348 348
 		$declineAction = $notification->createAction();
349 349
 		$declineAction->setLabel('decline')
350
-			->setLink($this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkTo('', 'ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/' . $shareId)), 'DELETE');
350
+			->setLink($this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkTo('', 'ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/'.$shareId)), 'DELETE');
351 351
 		$notification->addAction($declineAction);
352 352
 
353 353
 		$acceptAction = $notification->createAction();
354 354
 		$acceptAction->setLabel('accept')
355
-			->setLink($this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkTo('', 'ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/' . $shareId)), 'POST');
355
+			->setLink($this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkTo('', 'ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/'.$shareId)), 'POST');
356 356
 		$notification->addAction($acceptAction);
357 357
 
358 358
 		$this->notificationManager->notify($notification);
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 	 */
411 411
 	protected function executeAcceptShare(IShare $share) {
412 412
 		try {
413
-			$fileId = (int)$share->getNode()->getId();
413
+			$fileId = (int) $share->getNode()->getId();
414 414
 			[$file, $link] = $this->getFile($this->getCorrectUid($share), $fileId);
415 415
 		} catch (\Exception $e) {
416 416
 			throw new ShareNotFound();
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
 		$this->federatedShareProvider->removeShareFromTable($share);
487 487
 
488 488
 		try {
489
-			$fileId = (int)$share->getNode()->getId();
489
+			$fileId = (int) $share->getNode()->getId();
490 490
 			[$file, $link] = $this->getFile($this->getCorrectUid($share), $fileId);
491 491
 		} catch (\Exception $e) {
492 492
 			throw new ShareNotFound();
@@ -578,10 +578,10 @@  discard block
 block discarded – undo
578 578
 			// delete all child in case of a group share
579 579
 			$qb = $this->connection->getQueryBuilder();
580 580
 			$qb->delete('share_external')
581
-				->where($qb->expr()->eq('parent', $qb->createNamedParameter((int)$share['id'])));
581
+				->where($qb->expr()->eq('parent', $qb->createNamedParameter((int) $share['id'])));
582 582
 			$qb->execute();
583 583
 
584
-			if ((int)$share['share_type'] === IShare::TYPE_USER) {
584
+			if ((int) $share['share_type'] === IShare::TYPE_USER) {
585 585
 				if ($share['accepted']) {
586 586
 					$path = trim($mountpoint, '/');
587 587
 				} else {
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
 				$notification = $this->notificationManager->createNotification();
591 591
 				$notification->setApp('files_sharing')
592 592
 					->setUser($share['user'])
593
-					->setObject('remote_share', (int)$share['id']);
593
+					->setObject('remote_share', (int) $share['id']);
594 594
 				$this->notificationManager->markProcessed($notification);
595 595
 
596 596
 				$event = $this->activityManager->generateEvent();
@@ -598,7 +598,7 @@  discard block
 block discarded – undo
598 598
 					->setType('remote_share')
599 599
 					->setSubject(RemoteShares::SUBJECT_REMOTE_SHARE_UNSHARED, [$owner->getId(), $path])
600 600
 					->setAffectedUser($user)
601
-					->setObject('remote_share', (int)$share['id'], $path);
601
+					->setObject('remote_share', (int) $share['id'], $path);
602 602
 				\OC::$server->getActivityManager()->publish($event);
603 603
 			}
604 604
 		}
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
 			$owner = $share->getShareOwner();
647 647
 			$currentServer = $this->addressHandler->generateRemoteURL();
648 648
 			if ($this->addressHandler->compareAddresses($user, $remote, $owner, $currentServer)) {
649
-				throw new ProviderCouldNotAddShareException('Resharing back to the owner is not allowed: ' . $id);
649
+				throw new ProviderCouldNotAddShareException('Resharing back to the owner is not allowed: '.$id);
650 650
 			}
651 651
 		} catch (\Exception $e) {
652 652
 			throw new ProviderCouldNotAddShareException($e->getMessage());
@@ -660,10 +660,10 @@  discard block
 block discarded – undo
660 660
 			$share->setSharedBy($share->getSharedWith());
661 661
 			$share->setSharedWith($shareWith);
662 662
 			$result = $this->federatedShareProvider->create($share);
663
-			$this->federatedShareProvider->storeRemoteId((int)$result->getId(), $senderId);
663
+			$this->federatedShareProvider->storeRemoteId((int) $result->getId(), $senderId);
664 664
 			return ['token' => $result->getToken(), 'providerId' => $result->getId()];
665 665
 		} else {
666
-			throw new ProviderCouldNotAddShareException('resharing not allowed for share: ' . $id);
666
+			throw new ProviderCouldNotAddShareException('resharing not allowed for share: '.$id);
667 667
 		}
668 668
 	}
669 669
 
Please login to merge, or discard this patch.
apps/settings/lib/Controller/UsersController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 		[$adminGroup, $groups] = $groupsInfo->get();
193 193
 
194 194
 		if (!$isLDAPUsed && $this->appManager->isEnabledForUser('user_ldap')) {
195
-			$isLDAPUsed = (bool)array_reduce($this->userManager->getBackends(), function ($ldapFound, $backend) {
195
+			$isLDAPUsed = (bool) array_reduce($this->userManager->getBackends(), function($ldapFound, $backend) {
196 196
 				return $ldapFound || $backend instanceof User_Proxy;
197 197
 			});
198 198
 		}
@@ -203,8 +203,8 @@  discard block
 block discarded – undo
203 203
 		if (!$isLDAPUsed) {
204 204
 			if ($this->isAdmin) {
205 205
 				$disabledUsers = $this->userManager->countDisabledUsers();
206
-				$userCount = array_reduce($this->userManager->countUsers(), function ($v, $w) {
207
-					return $v + (int)$w;
206
+				$userCount = array_reduce($this->userManager->countUsers(), function($v, $w) {
207
+					return $v + (int) $w;
208 208
 				}, 0);
209 209
 			} else {
210 210
 				// User is subadmin !
@@ -498,11 +498,11 @@  discard block
 block discarded – undo
498 498
 
499 499
 		$accountData = $this->accountManager->getUser($user);
500 500
 		$cloudId = $user->getCloudId();
501
-		$message = 'Use my Federated Cloud ID to share with me: ' . $cloudId;
501
+		$message = 'Use my Federated Cloud ID to share with me: '.$cloudId;
502 502
 		$signature = $this->signMessage($user, $message);
503 503
 
504
-		$code = $message . ' ' . $signature;
505
-		$codeMd5 = $message . ' ' . md5($signature);
504
+		$code = $message.' '.$signature;
505
+		$codeMd5 = $message.' '.md5($signature);
506 506
 
507 507
 		switch ($account) {
508 508
 			case 'verify-twitter':
Please login to merge, or discard this patch.
apps/files_versions/lib/Storage.php 1 patch
Spacing   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -74,17 +74,17 @@  discard block
 block discarded – undo
74 74
 
75 75
 	private static $max_versions_per_interval = [
76 76
 		//first 10sec, one version every 2sec
77
-		1 => ['intervalEndsAfter' => 10,      'step' => 2],
77
+		1 => ['intervalEndsAfter' => 10, 'step' => 2],
78 78
 		//next minute, one version every 10sec
79
-		2 => ['intervalEndsAfter' => 60,      'step' => 10],
79
+		2 => ['intervalEndsAfter' => 60, 'step' => 10],
80 80
 		//next hour, one version every minute
81
-		3 => ['intervalEndsAfter' => 3600,    'step' => 60],
81
+		3 => ['intervalEndsAfter' => 3600, 'step' => 60],
82 82
 		//next 24h, one version every hour
83
-		4 => ['intervalEndsAfter' => 86400,   'step' => 3600],
83
+		4 => ['intervalEndsAfter' => 86400, 'step' => 3600],
84 84
 		//next 30days, one version per day
85 85
 		5 => ['intervalEndsAfter' => 2592000, 'step' => 86400],
86 86
 		//until the end one version per week
87
-		6 => ['intervalEndsAfter' => -1,      'step' => 604800],
87
+		6 => ['intervalEndsAfter' => -1, 'step' => 604800],
88 88
 	];
89 89
 
90 90
 	/** @var \OCA\Files_Versions\AppInfo\Application */
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 * @return int versions size
158 158
 	 */
159 159
 	private static function getVersionsSize($user) {
160
-		$view = new View('/' . $user);
160
+		$view = new View('/'.$user);
161 161
 		$fileInfo = $view->getFileInfo('/files_versions');
162 162
 		return isset($fileInfo['size']) ? $fileInfo['size'] : 0;
163 163
 	}
@@ -175,13 +175,13 @@  discard block
 block discarded – undo
175 175
 		}
176 176
 
177 177
 		// we only handle existing files
178
-		if (! Filesystem::file_exists($filename) || Filesystem::is_dir($filename)) {
178
+		if (!Filesystem::file_exists($filename) || Filesystem::is_dir($filename)) {
179 179
 			return false;
180 180
 		}
181 181
 
182 182
 		[$uid, $filename] = self::getUidAndFilename($filename);
183 183
 
184
-		$files_view = new View('/'.$uid .'/files');
184
+		$files_view = new View('/'.$uid.'/files');
185 185
 
186 186
 		$eventDispatcher = \OC::$server->getEventDispatcher();
187 187
 		$fileInfo = $files_view->getFileInfo($filename);
@@ -246,14 +246,14 @@  discard block
 block discarded – undo
246 246
 		$filename = $deletedFile['filename'];
247 247
 
248 248
 		if (!Filesystem::file_exists($path)) {
249
-			$view = new View('/' . $uid . '/files_versions');
249
+			$view = new View('/'.$uid.'/files_versions');
250 250
 
251 251
 			$versions = self::getVersions($uid, $filename);
252 252
 			if (!empty($versions)) {
253 253
 				foreach ($versions as $v) {
254
-					\OC_Hook::emit('\OCP\Versions', 'preDelete', ['path' => $path . $v['version'], 'trigger' => self::DELETE_TRIGGER_MASTER_REMOVED]);
255
-					self::deleteVersion($view, $filename . '.v' . $v['version']);
256
-					\OC_Hook::emit('\OCP\Versions', 'delete', ['path' => $path . $v['version'], 'trigger' => self::DELETE_TRIGGER_MASTER_REMOVED]);
254
+					\OC_Hook::emit('\OCP\Versions', 'preDelete', ['path' => $path.$v['version'], 'trigger' => self::DELETE_TRIGGER_MASTER_REMOVED]);
255
+					self::deleteVersion($view, $filename.'.v'.$v['version']);
256
+					\OC_Hook::emit('\OCP\Versions', 'delete', ['path' => $path.$v['version'], 'trigger' => self::DELETE_TRIGGER_MASTER_REMOVED]);
257 257
 				}
258 258
 			}
259 259
 		}
@@ -287,33 +287,33 @@  discard block
 block discarded – undo
287 287
 		$rootView = new View('');
288 288
 
289 289
 		// did we move a directory ?
290
-		if ($rootView->is_dir('/' . $targetOwner . '/files/' . $targetPath)) {
290
+		if ($rootView->is_dir('/'.$targetOwner.'/files/'.$targetPath)) {
291 291
 			// does the directory exists for versions too ?
292
-			if ($rootView->is_dir('/' . $sourceOwner . '/files_versions/' . $sourcePath)) {
292
+			if ($rootView->is_dir('/'.$sourceOwner.'/files_versions/'.$sourcePath)) {
293 293
 				// create missing dirs if necessary
294
-				self::createMissingDirectories($targetPath, new View('/'. $targetOwner));
294
+				self::createMissingDirectories($targetPath, new View('/'.$targetOwner));
295 295
 
296 296
 				// move the directory containing the versions
297 297
 				$rootView->$operation(
298
-					'/' . $sourceOwner . '/files_versions/' . $sourcePath,
299
-					'/' . $targetOwner . '/files_versions/' . $targetPath
298
+					'/'.$sourceOwner.'/files_versions/'.$sourcePath,
299
+					'/'.$targetOwner.'/files_versions/'.$targetPath
300 300
 				);
301 301
 			}
302
-		} elseif ($versions = Storage::getVersions($sourceOwner, '/' . $sourcePath)) {
302
+		} elseif ($versions = Storage::getVersions($sourceOwner, '/'.$sourcePath)) {
303 303
 			// create missing dirs if necessary
304
-			self::createMissingDirectories($targetPath, new View('/'. $targetOwner));
304
+			self::createMissingDirectories($targetPath, new View('/'.$targetOwner));
305 305
 
306 306
 			foreach ($versions as $v) {
307 307
 				// move each version one by one to the target directory
308 308
 				$rootView->$operation(
309
-					'/' . $sourceOwner . '/files_versions/' . $sourcePath.'.v' . $v['version'],
310
-					'/' . $targetOwner . '/files_versions/' . $targetPath.'.v'.$v['version']
309
+					'/'.$sourceOwner.'/files_versions/'.$sourcePath.'.v'.$v['version'],
310
+					'/'.$targetOwner.'/files_versions/'.$targetPath.'.v'.$v['version']
311 311
 				);
312 312
 			}
313 313
 		}
314 314
 
315 315
 		// if we moved versions directly for a file, schedule expiration check for that file
316
-		if (!$rootView->is_dir('/' . $targetOwner . '/files/' . $targetPath)) {
316
+		if (!$rootView->is_dir('/'.$targetOwner.'/files/'.$targetPath)) {
317 317
 			self::scheduleExpire($targetOwner, $targetPath);
318 318
 		}
319 319
 	}
@@ -328,13 +328,13 @@  discard block
 block discarded – undo
328 328
 	public static function rollback(string $file, int $revision, IUser $user) {
329 329
 
330 330
 		// add expected leading slash
331
-		$filename = '/' . ltrim($file, '/');
331
+		$filename = '/'.ltrim($file, '/');
332 332
 
333 333
 		// Fetch the userfolder to trigger view hooks
334 334
 		$userFolder = \OC::$server->getUserFolder($user->getUID());
335 335
 
336 336
 		$users_view = new View('/'.$user->getUID());
337
-		$files_view = new View('/'. $user->getUID().'/files');
337
+		$files_view = new View('/'.$user->getUID().'/files');
338 338
 
339 339
 		$versionCreated = false;
340 340
 
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
 			$versionCreated = true;
353 353
 		}
354 354
 
355
-		$fileToRestore = 'files_versions' . $filename . '.v' . $revision;
355
+		$fileToRestore = 'files_versions'.$filename.'.v'.$revision;
356 356
 
357 357
 		// Restore encrypted version of the old file for the newly restored file
358 358
 		// This has to happen manually here since the file is manually copied below
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
 		);
369 369
 
370 370
 		// rollback
371
-		if (self::copyFileContents($users_view, $fileToRestore, 'files' . $filename)) {
371
+		if (self::copyFileContents($users_view, $fileToRestore, 'files'.$filename)) {
372 372
 			$files_view->touch($file, $revision);
373 373
 			Storage::scheduleExpire($user->getUID(), $file);
374 374
 
@@ -440,12 +440,12 @@  discard block
 block discarded – undo
440 440
 			return $versions;
441 441
 		}
442 442
 		// fetch for old versions
443
-		$view = new View('/' . $uid . '/');
443
+		$view = new View('/'.$uid.'/');
444 444
 
445 445
 		$pathinfo = pathinfo($filename);
446 446
 		$versionedFile = $pathinfo['basename'];
447 447
 
448
-		$dir = Filesystem::normalizePath(self::VERSIONS_ROOT . '/' . $pathinfo['dirname']);
448
+		$dir = Filesystem::normalizePath(self::VERSIONS_ROOT.'/'.$pathinfo['dirname']);
449 449
 
450 450
 		$dirContent = false;
451 451
 		if ($view->is_dir($dir)) {
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
 						$pathparts = pathinfo($entryName);
466 466
 						$timestamp = substr($pathparts['extension'], 1);
467 467
 						$filename = $pathparts['filename'];
468
-						$key = $timestamp . '#' . $filename;
468
+						$key = $timestamp.'#'.$filename;
469 469
 						$versions[$key]['version'] = $timestamp;
470 470
 						$versions[$key]['humanReadableTimestamp'] = self::getHumanReadableTimestamp($timestamp);
471 471
 						if (empty($userFullPath)) {
@@ -473,9 +473,9 @@  discard block
 block discarded – undo
473 473
 						} else {
474 474
 							$versions[$key]['preview'] = \OC::$server->getURLGenerator('files_version.Preview.getPreview', ['file' => $userFullPath, 'version' => $timestamp]);
475 475
 						}
476
-						$versions[$key]['path'] = Filesystem::normalizePath($pathinfo['dirname'] . '/' . $filename);
476
+						$versions[$key]['path'] = Filesystem::normalizePath($pathinfo['dirname'].'/'.$filename);
477 477
 						$versions[$key]['name'] = $versionedFile;
478
-						$versions[$key]['size'] = $view->filesize($dir . '/' . $entryName);
478
+						$versions[$key]['size'] = $view->filesize($dir.'/'.$entryName);
479 479
 						$versions[$key]['mimetype'] = \OC::$server->getMimeTypeDetector()->detectPath($versionedFile);
480 480
 					}
481 481
 				}
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
 
504 504
 		$toDelete = [];
505 505
 		foreach (array_reverse($versions['all']) as $key => $version) {
506
-			if ((int)$version['version'] < $threshold) {
506
+			if ((int) $version['version'] < $threshold) {
507 507
 				$toDelete[$key] = $version;
508 508
 			} else {
509 509
 				//Versions are sorted by time - nothing mo to iterate.
@@ -511,11 +511,11 @@  discard block
 block discarded – undo
511 511
 			}
512 512
 		}
513 513
 
514
-		$view = new View('/' . $uid . '/files_versions');
514
+		$view = new View('/'.$uid.'/files_versions');
515 515
 		if (!empty($toDelete)) {
516 516
 			foreach ($toDelete as $version) {
517 517
 				\OC_Hook::emit('\OCP\Versions', 'preDelete', ['path' => $version['path'].'.v'.$version['version'], 'trigger' => self::DELETE_TRIGGER_RETENTION_CONSTRAINT]);
518
-				self::deleteVersion($view, $version['path'] . '.v' . $version['version']);
518
+				self::deleteVersion($view, $version['path'].'.v'.$version['version']);
519 519
 				\OC_Hook::emit('\OCP\Versions', 'delete', ['path' => $version['path'].'.v'.$version['version'], 'trigger' => self::DELETE_TRIGGER_RETENTION_CONSTRAINT]);
520 520
 			}
521 521
 		}
@@ -530,19 +530,19 @@  discard block
 block discarded – undo
530 530
 		$diff = time() - $timestamp;
531 531
 
532 532
 		if ($diff < 60) { // first minute
533
-			return  $diff . " seconds ago";
533
+			return  $diff." seconds ago";
534 534
 		} elseif ($diff < 3600) { //first hour
535
-			return round($diff / 60) . " minutes ago";
535
+			return round($diff / 60)." minutes ago";
536 536
 		} elseif ($diff < 86400) { // first day
537
-			return round($diff / 3600) . " hours ago";
537
+			return round($diff / 3600)." hours ago";
538 538
 		} elseif ($diff < 604800) { //first week
539
-			return round($diff / 86400) . " days ago";
539
+			return round($diff / 86400)." days ago";
540 540
 		} elseif ($diff < 2419200) { //first month
541
-			return round($diff / 604800) . " weeks ago";
541
+			return round($diff / 604800)." weeks ago";
542 542
 		} elseif ($diff < 29030400) { // first year
543
-			return round($diff / 2419200) . " months ago";
543
+			return round($diff / 2419200)." months ago";
544 544
 		} else {
545
-			return round($diff / 29030400) . " years ago";
545
+			return round($diff / 29030400)." years ago";
546 546
 		}
547 547
 	}
548 548
 
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
 	 * @return array with contains two arrays 'all' which contains all versions sorted by age and 'by_file' which contains all versions sorted by filename
553 553
 	 */
554 554
 	private static function getAllVersions($uid) {
555
-		$view = new View('/' . $uid . '/');
555
+		$view = new View('/'.$uid.'/');
556 556
 		$dirs = [self::VERSIONS_ROOT];
557 557
 		$versions = [];
558 558
 
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
 
563 563
 			foreach ($files as $file) {
564 564
 				$fileData = $file->getData();
565
-				$filePath = $dir . '/' . $fileData['name'];
565
+				$filePath = $dir.'/'.$fileData['name'];
566 566
 				if ($file['type'] === 'dir') {
567 567
 					$dirs[] = $filePath;
568 568
 				} else {
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
 					$relPathStart = strlen(self::VERSIONS_ROOT);
571 571
 					$version = substr($filePath, $versionsBegin + 2);
572 572
 					$relpath = substr($filePath, $relPathStart, $versionsBegin - $relPathStart);
573
-					$key = $version . '#' . $relpath;
573
+					$key = $version.'#'.$relpath;
574 574
 					$versions[$key] = ['path' => $relpath, 'timestamp' => $version];
575 575
 				}
576 576
 			}
@@ -614,13 +614,13 @@  discard block
 block discarded – undo
614 614
 			[$toDelete, $size] = self::getAutoExpireList($time, $versions);
615 615
 		} else {
616 616
 			$size = 0;
617
-			$toDelete = [];  // versions we want to delete
617
+			$toDelete = []; // versions we want to delete
618 618
 		}
619 619
 
620 620
 		foreach ($versions as $key => $version) {
621 621
 			if ($expiration->isExpired($version['version'], $quotaExceeded) && !isset($toDelete[$key])) {
622 622
 				$size += $version['size'];
623
-				$toDelete[$key] = $version['path'] . '.v' . $version['version'];
623
+				$toDelete[$key] = $version['path'].'.v'.$version['version'];
624 624
 			}
625 625
 		}
626 626
 
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
 	 */
636 636
 	protected static function getAutoExpireList($time, $versions) {
637 637
 		$size = 0;
638
-		$toDelete = [];  // versions we want to delete
638
+		$toDelete = []; // versions we want to delete
639 639
 
640 640
 		$interval = 1;
641 641
 		$step = Storage::$max_versions_per_interval[$interval]['step'];
@@ -662,9 +662,9 @@  discard block
 block discarded – undo
662 662
 				if ($nextInterval === -1 || $prevTimestamp > $nextInterval) {
663 663
 					if ($version['version'] > $nextVersion) {
664 664
 						//distance between two version too small, mark to delete
665
-						$toDelete[$key] = $version['path'] . '.v' . $version['version'];
665
+						$toDelete[$key] = $version['path'].'.v'.$version['version'];
666 666
 						$size += $version['size'];
667
-						\OC::$server->getLogger()->info('Mark to expire '. $version['path'] .' next version should be ' . $nextVersion . " or smaller. (prevTimestamp: " . $prevTimestamp . "; step: " . $step, ['app' => 'files_versions']);
667
+						\OC::$server->getLogger()->info('Mark to expire '.$version['path'].' next version should be '.$nextVersion." or smaller. (prevTimestamp: ".$prevTimestamp."; step: ".$step, ['app' => 'files_versions']);
668 668
 					} else {
669 669
 						$nextVersion = $version['version'] - $step;
670 670
 						$prevTimestamp = $version['version'];
@@ -719,8 +719,8 @@  discard block
 block discarded – undo
719 719
 			// get available disk space for user
720 720
 			$user = \OC::$server->getUserManager()->get($uid);
721 721
 			if (is_null($user)) {
722
-				\OC::$server->getLogger()->error('Backends provided no user object for ' . $uid, ['app' => 'files_versions']);
723
-				throw new \OC\User\NoUserException('Backends provided no user object for ' . $uid);
722
+				\OC::$server->getLogger()->error('Backends provided no user object for '.$uid, ['app' => 'files_versions']);
723
+				throw new \OC\User\NoUserException('Backends provided no user object for '.$uid);
724 724
 			}
725 725
 
726 726
 			\OC_Util::setupFS($uid);
@@ -803,13 +803,13 @@  discard block
 block discarded – undo
803 803
 				self::deleteVersion($versionsFileview, $path);
804 804
 				\OC_Hook::emit('\OCP\Versions', 'delete', ['path' => $path, 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED]);
805 805
 				unset($allVersions[$key]); // update array with the versions we keep
806
-				$logger->info('Expire: ' . $path, ['app' => 'files_versions']);
806
+				$logger->info('Expire: '.$path, ['app' => 'files_versions']);
807 807
 			}
808 808
 
809 809
 			// Check if enough space is available after versions are rearranged.
810 810
 			// If not we delete the oldest versions until we meet the size limit for versions,
811 811
 			// but always keep the two latest versions
812
-			$numOfVersions = count($allVersions) - 2 ;
812
+			$numOfVersions = count($allVersions) - 2;
813 813
 			$i = 0;
814 814
 			// sort oldest first and make sure that we start at the first element
815 815
 			ksort($allVersions);
@@ -817,9 +817,9 @@  discard block
 block discarded – undo
817 817
 			while ($availableSpace < 0 && $i < $numOfVersions) {
818 818
 				$version = current($allVersions);
819 819
 				\OC_Hook::emit('\OCP\Versions', 'preDelete', ['path' => $version['path'].'.v'.$version['version'], 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED]);
820
-				self::deleteVersion($versionsFileview, $version['path'] . '.v' . $version['version']);
820
+				self::deleteVersion($versionsFileview, $version['path'].'.v'.$version['version']);
821 821
 				\OC_Hook::emit('\OCP\Versions', 'delete', ['path' => $version['path'].'.v'.$version['version'], 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED]);
822
-				\OC::$server->getLogger()->info('running out of space! Delete oldest version: ' . $version['path'].'.v'.$version['version'], ['app' => 'files_versions']);
822
+				\OC::$server->getLogger()->info('running out of space! Delete oldest version: '.$version['path'].'.v'.$version['version'], ['app' => 'files_versions']);
823 823
 				$versionsSize -= $version['size'];
824 824
 				$availableSpace += $version['size'];
825 825
 				next($allVersions);
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
 		$dirParts = explode('/', $dirname);
846 846
 		$dir = "/files_versions";
847 847
 		foreach ($dirParts as $part) {
848
-			$dir = $dir . '/' . $part;
848
+			$dir = $dir.'/'.$part;
849 849
 			if (!$view->file_exists($dir)) {
850 850
 				$view->mkdir($dir);
851 851
 			}
Please login to merge, or discard this patch.