Passed
Push — master ( d3d534...5f2afa )
by Christoph
14:45 queued 25s
created
apps/dav/lib/CalDAV/CalDavBackend.php 1 patch
Spacing   +126 added lines, -126 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 		'{urn:ietf:params:xml:ns:caldav}calendar-timezone' => ['timezone', 'string'],
157 157
 		'{http://apple.com/ns/ical/}calendar-order' => ['calendarorder', 'int'],
158 158
 		'{http://apple.com/ns/ical/}calendar-color' => ['calendarcolor', 'string'],
159
-		'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_NEXTCLOUD . '}deleted-at' => ['deleted_at', 'int'],
159
+		'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_NEXTCLOUD.'}deleted-at' => ['deleted_at', 'int'],
160 160
 	];
161 161
 
162 162
 	/**
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 		}
300 300
 
301 301
 		$result = $query->executeQuery();
302
-		$column = (int)$result->fetchOne();
302
+		$column = (int) $result->fetchOne();
303 303
 		$result->closeCursor();
304 304
 		return $column;
305 305
 	}
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 		$result = $qb->executeQuery();
317 317
 		$raw = $result->fetchAll();
318 318
 		$result->closeCursor();
319
-		return array_map(function ($row) {
319
+		return array_map(function($row) {
320 320
 			return [
321 321
 				'id' => (int) $row['id'],
322 322
 				'deleted_at' => (int) $row['deleted_at'],
@@ -379,18 +379,18 @@  discard block
 block discarded – undo
379 379
 			$row['principaluri'] = (string) $row['principaluri'];
380 380
 			$components = [];
381 381
 			if ($row['components']) {
382
-				$components = explode(',',$row['components']);
382
+				$components = explode(',', $row['components']);
383 383
 			}
384 384
 
385 385
 			$calendar = [
386 386
 				'id' => $row['id'],
387 387
 				'uri' => $row['uri'],
388 388
 				'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
389
-				'{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'),
390
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
391
-				'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
392
-				'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'),
393
-				'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $this->convertPrincipal($principalUri, !$this->legacyEndpoint),
389
+				'{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'),
390
+				'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
391
+				'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
392
+				'{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'),
393
+				'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}owner-principal' => $this->convertPrincipal($principalUri, !$this->legacyEndpoint),
394 394
 			];
395 395
 
396 396
 			$calendar = $this->rowToCalendar($row, $calendar);
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 
429 429
 		$result = $query->executeQuery();
430 430
 
431
-		$readOnlyPropertyName = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only';
431
+		$readOnlyPropertyName = '{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}read-only';
432 432
 		while ($row = $result->fetch()) {
433 433
 			$row['principaluri'] = (string) $row['principaluri'];
434 434
 			if ($row['principaluri'] === $principalUri) {
@@ -449,21 +449,21 @@  discard block
 block discarded – undo
449 449
 			}
450 450
 
451 451
 			[, $name] = Uri\split($row['principaluri']);
452
-			$uri = $row['uri'] . '_shared_by_' . $name;
453
-			$row['displayname'] = $row['displayname'] . ' (' . $this->getUserDisplayName($name) . ')';
452
+			$uri = $row['uri'].'_shared_by_'.$name;
453
+			$row['displayname'] = $row['displayname'].' ('.$this->getUserDisplayName($name).')';
454 454
 			$components = [];
455 455
 			if ($row['components']) {
456
-				$components = explode(',',$row['components']);
456
+				$components = explode(',', $row['components']);
457 457
 			}
458 458
 			$calendar = [
459 459
 				'id' => $row['id'],
460 460
 				'uri' => $uri,
461 461
 				'principaluri' => $this->convertPrincipal($principalUri, !$this->legacyEndpoint),
462
-				'{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'),
463
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
464
-				'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
465
-				'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp('transparent'),
466
-				'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
462
+				'{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'),
463
+				'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
464
+				'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
465
+				'{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp('transparent'),
466
+				'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}owner-principal' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
467 467
 				$readOnlyPropertyName => $readOnly,
468 468
 			];
469 469
 
@@ -502,16 +502,16 @@  discard block
 block discarded – undo
502 502
 			$row['principaluri'] = (string) $row['principaluri'];
503 503
 			$components = [];
504 504
 			if ($row['components']) {
505
-				$components = explode(',',$row['components']);
505
+				$components = explode(',', $row['components']);
506 506
 			}
507 507
 			$calendar = [
508 508
 				'id' => $row['id'],
509 509
 				'uri' => $row['uri'],
510 510
 				'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
511
-				'{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'),
512
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
513
-				'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
514
-				'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'),
511
+				'{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'),
512
+				'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
513
+				'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
514
+				'{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'),
515 515
 			];
516 516
 
517 517
 			$calendar = $this->rowToCalendar($row, $calendar);
@@ -570,22 +570,22 @@  discard block
 block discarded – undo
570 570
 		while ($row = $result->fetch()) {
571 571
 			$row['principaluri'] = (string) $row['principaluri'];
572 572
 			[, $name] = Uri\split($row['principaluri']);
573
-			$row['displayname'] = $row['displayname'] . "($name)";
573
+			$row['displayname'] = $row['displayname']."($name)";
574 574
 			$components = [];
575 575
 			if ($row['components']) {
576
-				$components = explode(',',$row['components']);
576
+				$components = explode(',', $row['components']);
577 577
 			}
578 578
 			$calendar = [
579 579
 				'id' => $row['id'],
580 580
 				'uri' => $row['publicuri'],
581 581
 				'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
582
-				'{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'),
583
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
584
-				'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
585
-				'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'),
586
-				'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $this->convertPrincipal($row['principaluri'], $this->legacyEndpoint),
587
-				'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only' => (int)$row['access'] === Backend::ACCESS_READ,
588
-				'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}public' => (int)$row['access'] === self::ACCESS_PUBLIC,
582
+				'{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'),
583
+				'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
584
+				'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
585
+				'{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'),
586
+				'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}owner-principal' => $this->convertPrincipal($row['principaluri'], $this->legacyEndpoint),
587
+				'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}read-only' => (int) $row['access'] === Backend::ACCESS_READ,
588
+				'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}public' => (int) $row['access'] === self::ACCESS_PUBLIC,
589 589
 			];
590 590
 
591 591
 			$calendar = $this->rowToCalendar($row, $calendar);
@@ -630,27 +630,27 @@  discard block
 block discarded – undo
630 630
 		$result->closeCursor();
631 631
 
632 632
 		if ($row === false) {
633
-			throw new NotFound('Node with name \'' . $uri . '\' could not be found');
633
+			throw new NotFound('Node with name \''.$uri.'\' could not be found');
634 634
 		}
635 635
 
636 636
 		$row['principaluri'] = (string) $row['principaluri'];
637 637
 		[, $name] = Uri\split($row['principaluri']);
638
-		$row['displayname'] = $row['displayname'] . ' ' . "($name)";
638
+		$row['displayname'] = $row['displayname'].' '."($name)";
639 639
 		$components = [];
640 640
 		if ($row['components']) {
641
-			$components = explode(',',$row['components']);
641
+			$components = explode(',', $row['components']);
642 642
 		}
643 643
 		$calendar = [
644 644
 			'id' => $row['id'],
645 645
 			'uri' => $row['publicuri'],
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'),
651
-			'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
652
-			'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only' => (int)$row['access'] === Backend::ACCESS_READ,
653
-			'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}public' => (int)$row['access'] === self::ACCESS_PUBLIC,
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
+			'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}owner-principal' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
652
+			'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}read-only' => (int) $row['access'] === Backend::ACCESS_READ,
653
+			'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}public' => (int) $row['access'] === self::ACCESS_PUBLIC,
654 654
 		];
655 655
 
656 656
 		$calendar = $this->rowToCalendar($row, $calendar);
@@ -691,17 +691,17 @@  discard block
 block discarded – undo
691 691
 		$row['principaluri'] = (string) $row['principaluri'];
692 692
 		$components = [];
693 693
 		if ($row['components']) {
694
-			$components = explode(',',$row['components']);
694
+			$components = explode(',', $row['components']);
695 695
 		}
696 696
 
697 697
 		$calendar = [
698 698
 			'id' => $row['id'],
699 699
 			'uri' => $row['uri'],
700 700
 			'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
701
-			'{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'),
702
-			'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
703
-			'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
704
-			'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'),
701
+			'{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'),
702
+			'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
703
+			'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
704
+			'{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'),
705 705
 		];
706 706
 
707 707
 		$calendar = $this->rowToCalendar($row, $calendar);
@@ -740,17 +740,17 @@  discard block
 block discarded – undo
740 740
 		$row['principaluri'] = (string) $row['principaluri'];
741 741
 		$components = [];
742 742
 		if ($row['components']) {
743
-			$components = explode(',',$row['components']);
743
+			$components = explode(',', $row['components']);
744 744
 		}
745 745
 
746 746
 		$calendar = [
747 747
 			'id' => $row['id'],
748 748
 			'uri' => $row['uri'],
749 749
 			'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
750
-			'{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'),
751
-			'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
752
-			'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
753
-			'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'),
750
+			'{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'),
751
+			'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
752
+			'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
753
+			'{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'),
754 754
 		];
755 755
 
756 756
 		$calendar = $this->rowToCalendar($row, $calendar);
@@ -792,8 +792,8 @@  discard block
 block discarded – undo
792 792
 			'principaluri' => $row['principaluri'],
793 793
 			'source' => $row['source'],
794 794
 			'lastmodified' => $row['lastmodified'],
795
-			'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet(['VTODO', 'VEVENT']),
796
-			'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
795
+			'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet(['VTODO', 'VEVENT']),
796
+			'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
797 797
 		];
798 798
 
799 799
 		return $this->rowToSubscription($row, $subscription);
@@ -824,16 +824,16 @@  discard block
 block discarded – undo
824 824
 		$sccs = '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set';
825 825
 		if (isset($properties[$sccs])) {
826 826
 			if (!($properties[$sccs] instanceof SupportedCalendarComponentSet)) {
827
-				throw new DAV\Exception('The ' . $sccs . ' property must be of type: \Sabre\CalDAV\Property\SupportedCalendarComponentSet');
827
+				throw new DAV\Exception('The '.$sccs.' property must be of type: \Sabre\CalDAV\Property\SupportedCalendarComponentSet');
828 828
 			}
829
-			$values['components'] = implode(',',$properties[$sccs]->getValue());
829
+			$values['components'] = implode(',', $properties[$sccs]->getValue());
830 830
 		} elseif (isset($properties['components'])) {
831 831
 			// Allow to provide components internally without having
832 832
 			// to create a SupportedCalendarComponentSet object
833 833
 			$values['components'] = $properties['components'];
834 834
 		}
835 835
 
836
-		$transp = '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp';
836
+		$transp = '{'.Plugin::NS_CALDAV.'}schedule-calendar-transp';
837 837
 		if (isset($properties[$transp])) {
838 838
 			$values['transparent'] = (int) ($properties[$transp]->getValue() === 'transparent');
839 839
 		}
@@ -853,7 +853,7 @@  discard block
 block discarded – undo
853 853
 		$calendarId = $query->getLastInsertId();
854 854
 
855 855
 		$calendarData = $this->getCalendarById($calendarId);
856
-		$this->dispatcher->dispatchTyped(new CalendarCreatedEvent((int)$calendarId, $calendarData));
856
+		$this->dispatcher->dispatchTyped(new CalendarCreatedEvent((int) $calendarId, $calendarData));
857 857
 
858 858
 		return $calendarId;
859 859
 	}
@@ -876,13 +876,13 @@  discard block
 block discarded – undo
876 876
 	 */
877 877
 	public function updateCalendar($calendarId, PropPatch $propPatch) {
878 878
 		$supportedProperties = array_keys($this->propertyMap);
879
-		$supportedProperties[] = '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp';
879
+		$supportedProperties[] = '{'.Plugin::NS_CALDAV.'}schedule-calendar-transp';
880 880
 
881
-		$propPatch->handle($supportedProperties, function ($mutations) use ($calendarId) {
881
+		$propPatch->handle($supportedProperties, function($mutations) use ($calendarId) {
882 882
 			$newValues = [];
883 883
 			foreach ($mutations as $propertyName => $propertyValue) {
884 884
 				switch ($propertyName) {
885
-					case '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp':
885
+					case '{'.Plugin::NS_CALDAV.'}schedule-calendar-transp':
886 886
 						$fieldName = 'transparent';
887 887
 						$newValues[$fieldName] = (int) ($propertyValue->getValue() === 'transparent');
888 888
 						break;
@@ -904,7 +904,7 @@  discard block
 block discarded – undo
904 904
 
905 905
 			$calendarData = $this->getCalendarById($calendarId);
906 906
 			$shares = $this->getShares($calendarId);
907
-			$this->dispatcher->dispatchTyped(new CalendarUpdatedEvent((int)$calendarId, $calendarData, $shares, $mutations));
907
+			$this->dispatcher->dispatchTyped(new CalendarUpdatedEvent((int) $calendarId, $calendarData, $shares, $mutations));
908 908
 
909 909
 			return true;
910 910
 		});
@@ -954,7 +954,7 @@  discard block
 block discarded – undo
954 954
 
955 955
 			// Only dispatch if we actually deleted anything
956 956
 			if ($calendarData) {
957
-				$this->dispatcher->dispatchTyped(new CalendarDeletedEvent((int)$calendarId, $calendarData, $shares));
957
+				$this->dispatcher->dispatchTyped(new CalendarDeletedEvent((int) $calendarId, $calendarData, $shares));
958 958
 			}
959 959
 		} else {
960 960
 			$qbMarkCalendarDeleted = $this->db->getQueryBuilder();
@@ -967,7 +967,7 @@  discard block
 block discarded – undo
967 967
 			$shares = $this->getShares($calendarId);
968 968
 			if ($calendarData) {
969 969
 				$this->dispatcher->dispatchTyped(new CalendarMovedToTrashEvent(
970
-					(int)$calendarId,
970
+					(int) $calendarId,
971 971
 					$calendarData,
972 972
 					$shares
973 973
 				));
@@ -1051,11 +1051,11 @@  discard block
 block discarded – undo
1051 1051
 				'id' => $row['id'],
1052 1052
 				'uri' => $row['uri'],
1053 1053
 				'lastmodified' => $row['lastmodified'],
1054
-				'etag' => '"' . $row['etag'] . '"',
1054
+				'etag' => '"'.$row['etag'].'"',
1055 1055
 				'calendarid' => $row['calendarid'],
1056
-				'size' => (int)$row['size'],
1056
+				'size' => (int) $row['size'],
1057 1057
 				'component' => strtolower($row['componenttype']),
1058
-				'classification' => (int)$row['classification']
1058
+				'classification' => (int) $row['classification']
1059 1059
 			];
1060 1060
 		}
1061 1061
 		$stmt->closeCursor();
@@ -1078,13 +1078,13 @@  discard block
 block discarded – undo
1078 1078
 				'id' => $row['id'],
1079 1079
 				'uri' => $row['uri'],
1080 1080
 				'lastmodified' => $row['lastmodified'],
1081
-				'etag' => '"' . $row['etag'] . '"',
1081
+				'etag' => '"'.$row['etag'].'"',
1082 1082
 				'calendarid' => (int) $row['calendarid'],
1083 1083
 				'calendartype' => (int) $row['calendartype'],
1084 1084
 				'size' => (int) $row['size'],
1085 1085
 				'component' => strtolower($row['componenttype']),
1086 1086
 				'classification' => (int) $row['classification'],
1087
-				'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_NEXTCLOUD . '}deleted-at' => $row['deleted_at'] === null ? $row['deleted_at'] : (int) $row['deleted_at'],
1087
+				'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_NEXTCLOUD.'}deleted-at' => $row['deleted_at'] === null ? $row['deleted_at'] : (int) $row['deleted_at'],
1088 1088
 			];
1089 1089
 		}
1090 1090
 		$stmt->closeCursor();
@@ -1117,13 +1117,13 @@  discard block
 block discarded – undo
1117 1117
 				'id' => $row['id'],
1118 1118
 				'uri' => $row['uri'],
1119 1119
 				'lastmodified' => $row['lastmodified'],
1120
-				'etag' => '"' . $row['etag'] . '"',
1120
+				'etag' => '"'.$row['etag'].'"',
1121 1121
 				'calendarid' => $row['calendarid'],
1122 1122
 				'calendaruri' => $row['calendaruri'],
1123
-				'size' => (int)$row['size'],
1123
+				'size' => (int) $row['size'],
1124 1124
 				'component' => strtolower($row['componenttype']),
1125
-				'classification' => (int)$row['classification'],
1126
-				'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_NEXTCLOUD . '}deleted-at' => $row['deleted_at'] === null ? $row['deleted_at'] : (int) $row['deleted_at'],
1125
+				'classification' => (int) $row['classification'],
1126
+				'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_NEXTCLOUD.'}deleted-at' => $row['deleted_at'] === null ? $row['deleted_at'] : (int) $row['deleted_at'],
1127 1127
 			];
1128 1128
 		}
1129 1129
 		$stmt->closeCursor();
@@ -1167,12 +1167,12 @@  discard block
 block discarded – undo
1167 1167
 			'id' => $row['id'],
1168 1168
 			'uri' => $row['uri'],
1169 1169
 			'lastmodified' => $row['lastmodified'],
1170
-			'etag' => '"' . $row['etag'] . '"',
1170
+			'etag' => '"'.$row['etag'].'"',
1171 1171
 			'calendarid' => $row['calendarid'],
1172
-			'size' => (int)$row['size'],
1172
+			'size' => (int) $row['size'],
1173 1173
 			'calendardata' => $this->readBlob($row['calendardata']),
1174 1174
 			'component' => strtolower($row['componenttype']),
1175
-			'classification' => (int)$row['classification']
1175
+			'classification' => (int) $row['classification']
1176 1176
 		];
1177 1177
 	}
1178 1178
 
@@ -1214,12 +1214,12 @@  discard block
 block discarded – undo
1214 1214
 					'id' => $row['id'],
1215 1215
 					'uri' => $row['uri'],
1216 1216
 					'lastmodified' => $row['lastmodified'],
1217
-					'etag' => '"' . $row['etag'] . '"',
1217
+					'etag' => '"'.$row['etag'].'"',
1218 1218
 					'calendarid' => $row['calendarid'],
1219
-					'size' => (int)$row['size'],
1219
+					'size' => (int) $row['size'],
1220 1220
 					'calendardata' => $this->readBlob($row['calendardata']),
1221 1221
 					'component' => strtolower($row['componenttype']),
1222
-					'classification' => (int)$row['classification']
1222
+					'classification' => (int) $row['classification']
1223 1223
 				];
1224 1224
 			}
1225 1225
 			$result->closeCursor();
@@ -1306,11 +1306,11 @@  discard block
 block discarded – undo
1306 1306
 			$calendarRow = $this->getCalendarById($calendarId);
1307 1307
 			$shares = $this->getShares($calendarId);
1308 1308
 
1309
-			$this->dispatcher->dispatchTyped(new CalendarObjectCreatedEvent((int)$calendarId, $calendarRow, $shares, $objectRow));
1309
+			$this->dispatcher->dispatchTyped(new CalendarObjectCreatedEvent((int) $calendarId, $calendarRow, $shares, $objectRow));
1310 1310
 		} else {
1311 1311
 			$subscriptionRow = $this->getSubscriptionById($calendarId);
1312 1312
 
1313
-			$this->dispatcher->dispatchTyped(new CachedCalendarObjectCreatedEvent((int)$calendarId, $subscriptionRow, [], $objectRow));
1313
+			$this->dispatcher->dispatchTyped(new CachedCalendarObjectCreatedEvent((int) $calendarId, $subscriptionRow, [], $objectRow));
1314 1314
 			$this->legacyDispatcher->dispatch('\OCA\DAV\CalDAV\CalDavBackend::createCachedCalendarObject', new GenericEvent(
1315 1315
 				'\OCA\DAV\CalDAV\CalDavBackend::createCachedCalendarObject',
1316 1316
 				[
@@ -1322,7 +1322,7 @@  discard block
 block discarded – undo
1322 1322
 			));
1323 1323
 		}
1324 1324
 
1325
-		return '"' . $extraData['etag'] . '"';
1325
+		return '"'.$extraData['etag'].'"';
1326 1326
 	}
1327 1327
 
1328 1328
 	/**
@@ -1371,11 +1371,11 @@  discard block
 block discarded – undo
1371 1371
 				$calendarRow = $this->getCalendarById($calendarId);
1372 1372
 				$shares = $this->getShares($calendarId);
1373 1373
 
1374
-				$this->dispatcher->dispatchTyped(new CalendarObjectUpdatedEvent((int)$calendarId, $calendarRow, $shares, $objectRow));
1374
+				$this->dispatcher->dispatchTyped(new CalendarObjectUpdatedEvent((int) $calendarId, $calendarRow, $shares, $objectRow));
1375 1375
 			} else {
1376 1376
 				$subscriptionRow = $this->getSubscriptionById($calendarId);
1377 1377
 
1378
-				$this->dispatcher->dispatchTyped(new CachedCalendarObjectUpdatedEvent((int)$calendarId, $subscriptionRow, [], $objectRow));
1378
+				$this->dispatcher->dispatchTyped(new CachedCalendarObjectUpdatedEvent((int) $calendarId, $subscriptionRow, [], $objectRow));
1379 1379
 				$this->legacyDispatcher->dispatch('\OCA\DAV\CalDAV\CalDavBackend::updateCachedCalendarObject', new GenericEvent(
1380 1380
 					'\OCA\DAV\CalDAV\CalDavBackend::updateCachedCalendarObject',
1381 1381
 					[
@@ -1388,7 +1388,7 @@  discard block
 block discarded – undo
1388 1388
 			}
1389 1389
 		}
1390 1390
 
1391
-		return '"' . $extraData['etag'] . '"';
1391
+		return '"'.$extraData['etag'].'"';
1392 1392
 	}
1393 1393
 
1394 1394
 	/**
@@ -1487,11 +1487,11 @@  discard block
 block discarded – undo
1487 1487
 				$calendarRow = $this->getCalendarById($calendarId);
1488 1488
 				$shares = $this->getShares($calendarId);
1489 1489
 
1490
-				$this->dispatcher->dispatchTyped(new CalendarObjectDeletedEvent((int)$calendarId, $calendarRow, $shares, $data));
1490
+				$this->dispatcher->dispatchTyped(new CalendarObjectDeletedEvent((int) $calendarId, $calendarRow, $shares, $data));
1491 1491
 			} else {
1492 1492
 				$subscriptionRow = $this->getSubscriptionById($calendarId);
1493 1493
 
1494
-				$this->dispatcher->dispatchTyped(new CachedCalendarObjectDeletedEvent((int)$calendarId, $subscriptionRow, [], $data));
1494
+				$this->dispatcher->dispatchTyped(new CachedCalendarObjectDeletedEvent((int) $calendarId, $subscriptionRow, [], $data));
1495 1495
 				$this->legacyDispatcher->dispatch('\OCA\DAV\CalDAV\CalDavBackend::deleteCachedCalendarObject', new GenericEvent(
1496 1496
 					'\OCA\DAV\CalDAV\CalDavBackend::deleteCachedCalendarObject',
1497 1497
 					[
@@ -1540,7 +1540,7 @@  discard block
 block discarded – undo
1540 1540
 			if ($calendarData !== null) {
1541 1541
 				$this->dispatcher->dispatchTyped(
1542 1542
 					new CalendarObjectMovedToTrashEvent(
1543
-						(int)$calendarId,
1543
+						(int) $calendarId,
1544 1544
 						$calendarData,
1545 1545
 						$this->getShares($calendarId),
1546 1546
 						$data
@@ -1855,7 +1855,7 @@  discard block
 block discarded – undo
1855 1855
 
1856 1856
 		$result = [];
1857 1857
 		while ($row = $stmt->fetch()) {
1858
-			$path = $uriMapper[$row['calendarid']] . '/' . $row['uri'];
1858
+			$path = $uriMapper[$row['calendarid']].'/'.$row['uri'];
1859 1859
 			if (!in_array($path, $result)) {
1860 1860
 				$result[] = $path;
1861 1861
 			}
@@ -1905,8 +1905,8 @@  discard block
 block discarded – undo
1905 1905
 
1906 1906
 		if ($pattern !== '') {
1907 1907
 			$innerQuery->andWhere($innerQuery->expr()->iLike('op.value',
1908
-				$outerQuery->createNamedParameter('%' .
1909
-					$this->db->escapeLikeParameter($pattern) . '%')));
1908
+				$outerQuery->createNamedParameter('%'.
1909
+					$this->db->escapeLikeParameter($pattern).'%')));
1910 1910
 		}
1911 1911
 
1912 1912
 		$outerQuery->select('c.id', 'c.calendardata', 'c.componenttype', 'c.uid', 'c.uri')
@@ -1943,7 +1943,7 @@  discard block
 block discarded – undo
1943 1943
 		}
1944 1944
 
1945 1945
 		$result = $outerQuery->executeQuery();
1946
-		$calendarObjects = array_filter($result->fetchAll(), function (array $row) use ($options) {
1946
+		$calendarObjects = array_filter($result->fetchAll(), function(array $row) use ($options) {
1947 1947
 			$start = $options['timerange']['start'] ?? null;
1948 1948
 			$end = $options['timerange']['end'] ?? null;
1949 1949
 
@@ -1978,7 +1978,7 @@  discard block
 block discarded – undo
1978 1978
 		});
1979 1979
 		$result->closeCursor();
1980 1980
 
1981
-		return array_map(function ($o) {
1981
+		return array_map(function($o) {
1982 1982
 			$calendarData = Reader::read($o['calendardata']);
1983 1983
 			$comps = $calendarData->getComponents();
1984 1984
 			$objects = [];
@@ -1996,10 +1996,10 @@  discard block
 block discarded – undo
1996 1996
 				'type' => $o['componenttype'],
1997 1997
 				'uid' => $o['uid'],
1998 1998
 				'uri' => $o['uri'],
1999
-				'objects' => array_map(function ($c) {
1999
+				'objects' => array_map(function($c) {
2000 2000
 					return $this->transformSearchData($c);
2001 2001
 				}, $objects),
2002
-				'timezones' => array_map(function ($c) {
2002
+				'timezones' => array_map(function($c) {
2003 2003
 					return $this->transformSearchData($c);
2004 2004
 				}, $timezones),
2005 2005
 			];
@@ -2015,7 +2015,7 @@  discard block
 block discarded – undo
2015 2015
 		/** @var Component[] $subComponents */
2016 2016
 		$subComponents = $comp->getComponents();
2017 2017
 		/** @var Property[] $properties */
2018
-		$properties = array_filter($comp->children(), function ($c) {
2018
+		$properties = array_filter($comp->children(), function($c) {
2019 2019
 			return $c instanceof Property;
2020 2020
 		});
2021 2021
 		$validationRules = $comp->getValidationRules();
@@ -2093,7 +2093,7 @@  discard block
 block discarded – undo
2093 2093
 		$subscriptions = $this->getSubscriptionsForUser($principalUri);
2094 2094
 		foreach ($calendars as $calendar) {
2095 2095
 			$calendarAnd = $calendarObjectIdQuery->expr()->andX();
2096
-			$calendarAnd->add($calendarObjectIdQuery->expr()->eq('cob.calendarid', $calendarObjectIdQuery->createNamedParameter((int)$calendar['id'])));
2096
+			$calendarAnd->add($calendarObjectIdQuery->expr()->eq('cob.calendarid', $calendarObjectIdQuery->createNamedParameter((int) $calendar['id'])));
2097 2097
 			$calendarAnd->add($calendarObjectIdQuery->expr()->eq('cob.calendartype', $calendarObjectIdQuery->createNamedParameter(self::CALENDAR_TYPE_CALENDAR)));
2098 2098
 
2099 2099
 			// If it's shared, limit search to public events
@@ -2106,7 +2106,7 @@  discard block
 block discarded – undo
2106 2106
 		}
2107 2107
 		foreach ($subscriptions as $subscription) {
2108 2108
 			$subscriptionAnd = $calendarObjectIdQuery->expr()->andX();
2109
-			$subscriptionAnd->add($calendarObjectIdQuery->expr()->eq('cob.calendarid', $calendarObjectIdQuery->createNamedParameter((int)$subscription['id'])));
2109
+			$subscriptionAnd->add($calendarObjectIdQuery->expr()->eq('cob.calendarid', $calendarObjectIdQuery->createNamedParameter((int) $subscription['id'])));
2110 2110
 			$subscriptionAnd->add($calendarObjectIdQuery->expr()->eq('cob.calendartype', $calendarObjectIdQuery->createNamedParameter(self::CALENDAR_TYPE_SUBSCRIPTION)));
2111 2111
 
2112 2112
 			// If it's shared, limit search to public events
@@ -2152,7 +2152,7 @@  discard block
 block discarded – undo
2152 2152
 			if (!$escapePattern) {
2153 2153
 				$calendarObjectIdQuery->andWhere($calendarObjectIdQuery->expr()->ilike('cob.value', $calendarObjectIdQuery->createNamedParameter($pattern)));
2154 2154
 			} else {
2155
-				$calendarObjectIdQuery->andWhere($calendarObjectIdQuery->expr()->ilike('cob.value', $calendarObjectIdQuery->createNamedParameter('%' . $this->db->escapeLikeParameter($pattern) . '%')));
2155
+				$calendarObjectIdQuery->andWhere($calendarObjectIdQuery->expr()->ilike('cob.value', $calendarObjectIdQuery->createNamedParameter('%'.$this->db->escapeLikeParameter($pattern).'%')));
2156 2156
 			}
2157 2157
 		}
2158 2158
 
@@ -2166,7 +2166,7 @@  discard block
 block discarded – undo
2166 2166
 		$result = $calendarObjectIdQuery->executeQuery();
2167 2167
 		$matches = $result->fetchAll();
2168 2168
 		$result->closeCursor();
2169
-		$matches = array_map(static function (array $match):int {
2169
+		$matches = array_map(static function(array $match):int {
2170 2170
 			return (int) $match['objectid'];
2171 2171
 		}, $matches);
2172 2172
 
@@ -2179,9 +2179,9 @@  discard block
 block discarded – undo
2179 2179
 		$calendarObjects = $result->fetchAll();
2180 2180
 		$result->closeCursor();
2181 2181
 
2182
-		return array_map(function (array $array): array {
2183
-			$array['calendarid'] = (int)$array['calendarid'];
2184
-			$array['calendartype'] = (int)$array['calendartype'];
2182
+		return array_map(function(array $array): array {
2183
+			$array['calendarid'] = (int) $array['calendarid'];
2184
+			$array['calendartype'] = (int) $array['calendartype'];
2185 2185
 			$array['calendardata'] = $this->readBlob($array['calendardata']);
2186 2186
 
2187 2187
 			return $array;
@@ -2219,7 +2219,7 @@  discard block
 block discarded – undo
2219 2219
 		$row = $stmt->fetch();
2220 2220
 		$stmt->closeCursor();
2221 2221
 		if ($row) {
2222
-			return $row['calendaruri'] . '/' . $row['objecturi'];
2222
+			return $row['calendaruri'].'/'.$row['objecturi'];
2223 2223
 		}
2224 2224
 
2225 2225
 		return null;
@@ -2245,13 +2245,13 @@  discard block
 block discarded – undo
2245 2245
 			'id' => $row['id'],
2246 2246
 			'uri' => $row['uri'],
2247 2247
 			'lastmodified' => $row['lastmodified'],
2248
-			'etag' => '"' . $row['etag'] . '"',
2248
+			'etag' => '"'.$row['etag'].'"',
2249 2249
 			'calendarid' => $row['calendarid'],
2250 2250
 			'calendaruri' => $row['calendaruri'],
2251
-			'size' => (int)$row['size'],
2251
+			'size' => (int) $row['size'],
2252 2252
 			'calendardata' => $this->readBlob($row['calendardata']),
2253 2253
 			'component' => strtolower($row['componenttype']),
2254
-			'classification' => (int)$row['classification'],
2254
+			'classification' => (int) $row['classification'],
2255 2255
 			'deleted_at' => isset($row['deleted_at']) ? ((int) $row['deleted_at']) : null,
2256 2256
 		];
2257 2257
 	}
@@ -2451,8 +2451,8 @@  discard block
 block discarded – undo
2451 2451
 				'source' => $row['source'],
2452 2452
 				'lastmodified' => $row['lastmodified'],
2453 2453
 
2454
-				'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet(['VTODO', 'VEVENT']),
2455
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
2454
+				'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet(['VTODO', 'VEVENT']),
2455
+				'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
2456 2456
 			];
2457 2457
 
2458 2458
 			$subscriptions[] = $this->rowToSubscription($row, $subscription);
@@ -2541,7 +2541,7 @@  discard block
 block discarded – undo
2541 2541
 		$supportedProperties = array_keys($this->subscriptionPropertyMap);
2542 2542
 		$supportedProperties[] = '{http://calendarserver.org/ns/}source';
2543 2543
 
2544
-		$propPatch->handle($supportedProperties, function ($mutations) use ($subscriptionId) {
2544
+		$propPatch->handle($supportedProperties, function($mutations) use ($subscriptionId) {
2545 2545
 			$newValues = [];
2546 2546
 
2547 2547
 			foreach ($mutations as $propertyName => $propertyValue) {
@@ -2563,7 +2563,7 @@  discard block
 block discarded – undo
2563 2563
 				->executeStatement();
2564 2564
 
2565 2565
 			$subscriptionRow = $this->getSubscriptionById($subscriptionId);
2566
-			$this->dispatcher->dispatchTyped(new SubscriptionUpdatedEvent((int)$subscriptionId, $subscriptionRow, [], $mutations));
2566
+			$this->dispatcher->dispatchTyped(new SubscriptionUpdatedEvent((int) $subscriptionId, $subscriptionRow, [], $mutations));
2567 2567
 			$this->legacyDispatcher->dispatch('\OCA\DAV\CalDAV\CalDavBackend::updateSubscription', new GenericEvent(
2568 2568
 				'\OCA\DAV\CalDAV\CalDavBackend::updateSubscription',
2569 2569
 				[
@@ -2614,7 +2614,7 @@  discard block
 block discarded – undo
2614 2614
 			->executeStatement();
2615 2615
 
2616 2616
 		if ($subscriptionRow) {
2617
-			$this->dispatcher->dispatchTyped(new SubscriptionDeletedEvent((int)$subscriptionId, $subscriptionRow, []));
2617
+			$this->dispatcher->dispatchTyped(new SubscriptionDeletedEvent((int) $subscriptionId, $subscriptionRow, []));
2618 2618
 		}
2619 2619
 	}
2620 2620
 
@@ -2652,8 +2652,8 @@  discard block
 block discarded – undo
2652 2652
 			'uri' => $row['uri'],
2653 2653
 			'calendardata' => $row['calendardata'],
2654 2654
 			'lastmodified' => $row['lastmodified'],
2655
-			'etag' => '"' . $row['etag'] . '"',
2656
-			'size' => (int)$row['size'],
2655
+			'etag' => '"'.$row['etag'].'"',
2656
+			'size' => (int) $row['size'],
2657 2657
 		];
2658 2658
 	}
2659 2659
 
@@ -2681,8 +2681,8 @@  discard block
 block discarded – undo
2681 2681
 				'calendardata' => $row['calendardata'],
2682 2682
 				'uri' => $row['uri'],
2683 2683
 				'lastmodified' => $row['lastmodified'],
2684
-				'etag' => '"' . $row['etag'] . '"',
2685
-				'size' => (int)$row['size'],
2684
+				'etag' => '"'.$row['etag'].'"',
2685
+				'size' => (int) $row['size'],
2686 2686
 			];
2687 2687
 		}
2688 2688
 		$stmt->closeCursor();
@@ -2737,14 +2737,14 @@  discard block
 block discarded – undo
2737 2737
 	 * @return void
2738 2738
 	 */
2739 2739
 	protected function addChange($calendarId, $objectUri, $operation, $calendarType = self::CALENDAR_TYPE_CALENDAR) {
2740
-		$table = $calendarType === self::CALENDAR_TYPE_CALENDAR ? 'calendars': 'calendarsubscriptions';
2740
+		$table = $calendarType === self::CALENDAR_TYPE_CALENDAR ? 'calendars' : 'calendarsubscriptions';
2741 2741
 
2742 2742
 		$query = $this->db->getQueryBuilder();
2743 2743
 		$query->select('synctoken')
2744 2744
 			->from($table)
2745 2745
 			->where($query->expr()->eq('id', $query->createNamedParameter($calendarId)));
2746 2746
 		$result = $query->executeQuery();
2747
-		$syncToken = (int)$result->fetchOne();
2747
+		$syncToken = (int) $result->fetchOne();
2748 2748
 		$result->closeCursor();
2749 2749
 
2750 2750
 		$query = $this->db->getQueryBuilder();
@@ -2801,7 +2801,7 @@  discard block
 block discarded – undo
2801 2801
 				// Track first component type and uid
2802 2802
 				if ($uid === null) {
2803 2803
 					$componentType = $component->name;
2804
-					$uid = (string)$component->UID;
2804
+					$uid = (string) $component->UID;
2805 2805
 				}
2806 2806
 			}
2807 2807
 		}
@@ -2900,7 +2900,7 @@  discard block
 block discarded – undo
2900 2900
 			]));
2901 2901
 		$this->calendarSharingBackend->updateShares($shareable, $add, $remove);
2902 2902
 
2903
-		$this->dispatcher->dispatchTyped(new CalendarShareUpdatedEvent((int)$calendarId, $calendarRow, $oldShares, $add, $remove));
2903
+		$this->dispatcher->dispatchTyped(new CalendarShareUpdatedEvent((int) $calendarId, $calendarRow, $oldShares, $add, $remove));
2904 2904
 	}
2905 2905
 
2906 2906
 	/**
@@ -2940,7 +2940,7 @@  discard block
 block discarded – undo
2940 2940
 				]);
2941 2941
 			$query->executeStatement();
2942 2942
 
2943
-			$this->dispatcher->dispatchTyped(new CalendarPublishedEvent((int)$calendarId, $calendarData, $publicUri));
2943
+			$this->dispatcher->dispatchTyped(new CalendarPublishedEvent((int) $calendarId, $calendarData, $publicUri));
2944 2944
 			return $publicUri;
2945 2945
 		}
2946 2946
 		$query->delete('dav_shares')
@@ -2948,7 +2948,7 @@  discard block
 block discarded – undo
2948 2948
 			->andWhere($query->expr()->eq('access', $query->createNamedParameter(self::ACCESS_PUBLIC)));
2949 2949
 		$query->executeStatement();
2950 2950
 
2951
-		$this->dispatcher->dispatchTyped(new CalendarUnpublishedEvent((int)$calendarId, $calendarData));
2951
+		$this->dispatcher->dispatchTyped(new CalendarUnpublishedEvent((int) $calendarId, $calendarData));
2952 2952
 		return null;
2953 2953
 	}
2954 2954
 
@@ -3175,10 +3175,10 @@  discard block
 block discarded – undo
3175 3175
 		$result->closeCursor();
3176 3176
 
3177 3177
 		if (!isset($objectIds['id'])) {
3178
-			throw new \InvalidArgumentException('Calendarobject does not exists: ' . $uri);
3178
+			throw new \InvalidArgumentException('Calendarobject does not exists: '.$uri);
3179 3179
 		}
3180 3180
 
3181
-		return (int)$objectIds['id'];
3181
+		return (int) $objectIds['id'];
3182 3182
 	}
3183 3183
 
3184 3184
 	/**
@@ -3204,8 +3204,8 @@  discard block
 block discarded – undo
3204 3204
 	 *
3205 3205
 	 */
3206 3206
 	private function addOwnerPrincipalToCalendar(array $calendarInfo): array {
3207
-		$ownerPrincipalKey = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal';
3208
-		$displaynameKey = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_NEXTCLOUD . '}owner-displayname';
3207
+		$ownerPrincipalKey = '{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}owner-principal';
3208
+		$displaynameKey = '{'.\OCA\DAV\DAV\Sharing\Plugin::NS_NEXTCLOUD.'}owner-displayname';
3209 3209
 		if (isset($calendarInfo[$ownerPrincipalKey])) {
3210 3210
 			$uri = $calendarInfo[$ownerPrincipalKey];
3211 3211
 		} else {
Please login to merge, or discard this patch.