Completed
Push — master ( 5262ba...247b25 )
by
unknown
30:03 queued 13s
created
apps/dav/lib/CalDAV/Federation/FederatedCalendarImpl.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 	}
25 25
 
26 26
 	public function getKey(): string {
27
-		return (string)$this->calendarInfo['id'];
27
+		return (string) $this->calendarInfo['id'];
28 28
 	}
29 29
 
30 30
 	public function getUri(): string {
Please login to merge, or discard this patch.
apps/dav/lib/CalDAV/Federation/CalendarFederationNotifier.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
 	): IResponse {
46 46
 		$sharedWithEncoded = base64_encode($shareWith->getId());
47 47
 		$relativeCalendarUrl = "remote-calendars/$sharedWithEncoded/{$calendarName}_shared_by_$calendarOwner";
48
-		$calendarUrl = $this->url->linkTo('', 'remote.php') . "/dav/$relativeCalendarUrl";
48
+		$calendarUrl = $this->url->linkTo('', 'remote.php')."/dav/$relativeCalendarUrl";
49 49
 		$calendarUrl = $this->url->getAbsoluteURL($calendarUrl);
50 50
 
51 51
 		$notification = $this->federationFactory->getCloudFederationNotification();
Please login to merge, or discard this patch.
apps/dav/lib/CalDAV/Federation/FederatedCalendarSyncService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
 			return 0;
61 61
 		}
62 62
 
63
-		$newSyncToken = (int)$matches[1];
63
+		$newSyncToken = (int) $matches[1];
64 64
 		if ($newSyncToken !== $calendar->getSyncToken()) {
65 65
 			$this->federatedCalendarMapper->updateSyncTokenAndTime(
66 66
 				$calendar->getId(),
Please login to merge, or discard this patch.
apps/dav/lib/CalDAV/Federation/FederatedCalendarMapper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -159,7 +159,7 @@
 block discarded – undo
159 159
 		$qb->select($qb->func()->count('*'))
160 160
 			->from(self::TABLE_NAME);
161 161
 		$result = $qb->executeQuery();
162
-		$count = (int)$result->fetchOne();
162
+		$count = (int) $result->fetchOne();
163 163
 		$result->closeCursor();
164 164
 		return $count;
165 165
 	}
Please login to merge, or discard this patch.
apps/dav/lib/CalDAV/Federation/FederatedCalendarAuth.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 		string $username,
36 36
 		string $password,
37 37
 	): ?string {
38
-		$remoteUserPrincipalUri = RemoteUserPrincipalBackend::PRINCIPAL_PREFIX . "/$username";
38
+		$remoteUserPrincipalUri = RemoteUserPrincipalBackend::PRINCIPAL_PREFIX."/$username";
39 39
 		[, $remoteUserPrincipalId] = \Sabre\Uri\split($remoteUserPrincipalUri);
40 40
 
41 41
 		$rows = $this->sharingMapper->getSharedCalendarsForRemoteUser(
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 		foreach ($rows as $row) {
48 48
 			$ownerPrincipalUri = $row['principaluri'];
49 49
 			[, $ownerUserId] = \Sabre\Uri\split($ownerPrincipalUri);
50
-			$shareUri = $row['uri'] . '_shared_by_' . $ownerUserId;
50
+			$shareUri = $row['uri'].'_shared_by_'.$ownerUserId;
51 51
 			if (str_starts_with($requestPath, "remote-calendars/$remoteUserPrincipalId/$shareUri")) {
52 52
 				// Yes? -> return early
53 53
 				return $remoteUserPrincipalUri;
Please login to merge, or discard this patch.
apps/dav/lib/CalDAV/CalendarProvider.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -34,11 +34,11 @@  discard block
 block discarded – undo
34 34
 		$federatedCalendarInfos = $this->calDavBackend->getFederatedCalendarsForUser($principalUri);
35 35
 
36 36
 		if (!empty($calendarUris)) {
37
-			$calendarInfos = array_filter($calendarInfos, function ($calendar) use ($calendarUris) {
37
+			$calendarInfos = array_filter($calendarInfos, function($calendar) use ($calendarUris) {
38 38
 				return in_array($calendar['uri'], $calendarUris);
39 39
 			});
40 40
 
41
-			$federatedCalendarInfos = array_filter($federatedCalendarInfos, function ($federatedCalendar) use ($calendarUris) {
41
+			$federatedCalendarInfos = array_filter($federatedCalendarInfos, function($federatedCalendar) use ($calendarUris) {
42 42
 				return in_array($federatedCalendar['uri'], $calendarUris);
43 43
 			});
44 44
 		}
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
 		foreach ($calendarInfos as $calendarInfo) {
50 50
 			$user = str_replace('principals/users/', '', $calendarInfo['principaluri']);
51
-			$path = 'calendars/' . $user . '/' . $calendarInfo['uri'];
51
+			$path = 'calendars/'.$user.'/'.$calendarInfo['uri'];
52 52
 
53 53
 			$calendarInfo = array_merge($calendarInfo, $additionalProperties[$path] ?? []);
54 54
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 		);
66 66
 		foreach ($federatedCalendarInfos as $calendarInfo) {
67 67
 			$user = str_replace('principals/users/', '', $calendarInfo['principaluri']);
68
-			$path = 'calendars/' . $user . '/' . $calendarInfo['uri'];
68
+			$path = 'calendars/'.$user.'/'.$calendarInfo['uri'];
69 69
 			if (isset($additionalFederatedProps[$path])) {
70 70
 				$calendarInfo = array_merge($calendarInfo, $additionalProperties[$path]);
71 71
 			}
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 			if (!array_key_exists($user, $calendars)) {
92 92
 				$calendars[$user] = [];
93 93
 			}
94
-			$calendars[$user][] = 'calendars/' . $user . '/' . $uri['uri'];
94
+			$calendars[$user][] = 'calendars/'.$user.'/'.$uri['uri'];
95 95
 		}
96 96
 
97 97
 		$properties = $this->propertyMapper->findPropertiesByPathsAndUsers($calendars);
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 				}
105 105
 
106 106
 				$list[$property->getPropertypath()][$property->getPropertyname()] = match ($property->getPropertyname()) {
107
-					'{http://owncloud.org/ns}calendar-enabled' => (bool)$property->getPropertyvalue(),
107
+					'{http://owncloud.org/ns}calendar-enabled' => (bool) $property->getPropertyvalue(),
108 108
 					default => $property->getPropertyvalue()
109 109
 				};
110 110
 			}
Please login to merge, or discard this patch.
apps/dav/lib/Listener/CalendarFederationNotificationListener.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 			return;
42 42
 		}
43 43
 
44
-		$remoteUserShares = array_filter($event->getShares(), function (array $share): bool {
44
+		$remoteUserShares = array_filter($event->getShares(), function(array $share): bool {
45 45
 			$sharedWithPrincipal = $share['{http://owncloud.org/ns}principal'] ?? '';
46 46
 			[$prefix] = \Sabre\Uri\split($sharedWithPrincipal);
47 47
 			return $prefix === RemoteUserPrincipalBackend::PRINCIPAL_PREFIX;
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 		);
59 59
 		$remoteShares = $this->sharingMapper->getSharesByPrincipalsAndResource(
60 60
 			$remoteUserPrincipals,
61
-			(int)$calendarInfo['id'],
61
+			(int) $calendarInfo['id'],
62 62
 			'calendar',
63 63
 		);
64 64
 
Please login to merge, or discard this patch.
apps/dav/lib/DAV/Sharing/Backend.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 	 * @return list<array{href: string, commonName: string, status: int, readOnly: bool, '{http://owncloud.org/ns}principal': string, '{http://owncloud.org/ns}group-share': bool}>
132 132
 	 */
133 133
 	public function getShares(int $resourceId): array {
134
-		$cached = $this->shareCache->get((string)$resourceId);
134
+		$cached = $this->shareCache->get((string) $resourceId);
135 135
 		if ($cached) {
136 136
 			return $cached;
137 137
 		}
@@ -142,20 +142,20 @@  discard block
 block discarded – undo
142 142
 			$p = $this->getPrincipalByPath($row['principaluri']);
143 143
 			$shares[] = [
144 144
 				'href' => "principal:{$row['principaluri']}",
145
-				'commonName' => isset($p['{DAV:}displayname']) ? (string)$p['{DAV:}displayname'] : '',
145
+				'commonName' => isset($p['{DAV:}displayname']) ? (string) $p['{DAV:}displayname'] : '',
146 146
 				'status' => 1,
147
-				'readOnly' => (int)$row['access'] === Backend::ACCESS_READ,
148
-				'{http://owncloud.org/ns}principal' => (string)$row['principaluri'],
147
+				'readOnly' => (int) $row['access'] === Backend::ACCESS_READ,
148
+				'{http://owncloud.org/ns}principal' => (string) $row['principaluri'],
149 149
 				'{http://owncloud.org/ns}group-share' => isset($p['uri']) && (str_starts_with($p['uri'], 'principals/groups') || str_starts_with($p['uri'], 'principals/circles')),
150 150
 			];
151 151
 		}
152
-		$this->shareCache->set((string)$resourceId, $shares);
152
+		$this->shareCache->set((string) $resourceId, $shares);
153 153
 		return $shares;
154 154
 	}
155 155
 
156 156
 	public function preloadShares(array $resourceIds): void {
157
-		$resourceIds = array_filter($resourceIds, function (int $resourceId) {
158
-			return empty($this->shareCache->get((string)$resourceId));
157
+		$resourceIds = array_filter($resourceIds, function(int $resourceId) {
158
+			return empty($this->shareCache->get((string) $resourceId));
159 159
 		});
160 160
 		if (empty($resourceIds)) {
161 161
 			return;
@@ -164,17 +164,17 @@  discard block
 block discarded – undo
164 164
 		$rows = $this->service->getSharesForIds($resourceIds);
165 165
 		$sharesByResource = array_fill_keys($resourceIds, []);
166 166
 		foreach ($rows as $row) {
167
-			$resourceId = (int)$row['resourceid'];
167
+			$resourceId = (int) $row['resourceid'];
168 168
 			$p = $this->getPrincipalByPath($row['principaluri']);
169 169
 			$sharesByResource[$resourceId][] = [
170 170
 				'href' => "principal:{$row['principaluri']}",
171
-				'commonName' => isset($p['{DAV:}displayname']) ? (string)$p['{DAV:}displayname'] : '',
171
+				'commonName' => isset($p['{DAV:}displayname']) ? (string) $p['{DAV:}displayname'] : '',
172 172
 				'status' => 1,
173
-				'readOnly' => (int)$row['access'] === self::ACCESS_READ,
174
-				'{http://owncloud.org/ns}principal' => (string)$row['principaluri'],
173
+				'readOnly' => (int) $row['access'] === self::ACCESS_READ,
174
+				'{http://owncloud.org/ns}principal' => (string) $row['principaluri'],
175 175
 				'{http://owncloud.org/ns}group-share' => isset($p['uri']) && str_starts_with($p['uri'], 'principals/groups')
176 176
 			];
177
-			$this->shareCache->set((string)$resourceId, $sharesByResource[$resourceId]);
177
+			$this->shareCache->set((string) $resourceId, $sharesByResource[$resourceId]);
178 178
 		}
179 179
 	}
180 180
 
@@ -190,21 +190,21 @@  discard block
 block discarded – undo
190 190
 		foreach ($shares as $share) {
191 191
 			$acl[] = [
192 192
 				'privilege' => '{DAV:}read',
193
-				'principal' => $share['{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}principal'],
193
+				'principal' => $share['{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}principal'],
194 194
 				'protected' => true,
195 195
 			];
196 196
 			if (!$share['readOnly']) {
197 197
 				$acl[] = [
198 198
 					'privilege' => '{DAV:}write',
199
-					'principal' => $share['{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}principal'],
199
+					'principal' => $share['{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}principal'],
200 200
 					'protected' => true,
201 201
 				];
202
-			} elseif (in_array($this->service->getResourceType(), ['calendar','addressbook'])) {
202
+			} elseif (in_array($this->service->getResourceType(), ['calendar', 'addressbook'])) {
203 203
 				// Allow changing the properties of read only calendars,
204 204
 				// so users can change the visibility.
205 205
 				$acl[] = [
206 206
 					'privilege' => '{DAV:}write-properties',
207
-					'principal' => $share['{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}principal'],
207
+					'principal' => $share['{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}principal'],
208 208
 					'protected' => true,
209 209
 				];
210 210
 			}
Please login to merge, or discard this patch.
apps/dav/lib/CardDAV/SyncService.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 			if ($ex->getCode() === Http::STATUS_UNAUTHORIZED) {
60 60
 				// remote server revoked access to the address book, remove it
61 61
 				$this->backend->deleteAddressBook($addressBookId);
62
-				$this->logger->error('Authorization failed, remove address book: ' . $url, ['app' => 'dav']);
62
+				$this->logger->error('Authorization failed, remove address book: '.$url, ['app' => 'dav']);
63 63
 				throw $ex;
64 64
 			}
65 65
 			$this->logger->error('Client exception:', ['app' => 'dav', 'exception' => $ex]);
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 			if (isset($status[200])) {
74 74
 				$absoluteUrl = $this->prepareUri($url, $resource);
75 75
 				$vCard = $this->download($absoluteUrl, $userName, $sharedSecret);
76
-				$this->atomic(function () use ($addressBookId, $cardUri, $vCard): void {
76
+				$this->atomic(function() use ($addressBookId, $cardUri, $vCard): void {
77 77
 					$existingCard = $this->backend->getCard($addressBookId, $cardUri);
78 78
 					if ($existingCard === false) {
79 79
 						$this->backend->createCard($addressBookId, $cardUri, $vCard);
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	 */
98 98
 	public function ensureSystemAddressBookExists(string $principal, string $uri, array $properties): ?array {
99 99
 		try {
100
-			return $this->atomic(function () use ($principal, $uri, $properties) {
100
+			return $this->atomic(function() use ($principal, $uri, $properties) {
101 101
 				$book = $this->backend->getAddressBooksByUri($principal, $uri);
102 102
 				if (!is_null($book)) {
103 103
 					return $book;
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 
128 128
 	public function ensureLocalSystemAddressBookExists(): ?array {
129 129
 		return $this->ensureSystemAddressBookExists('principals/system/system', 'system', [
130
-			'{' . Plugin::NS_CARDDAV . '}addressbook-description' => 'System addressbook which holds all users of this instance'
130
+			'{'.Plugin::NS_CARDDAV.'}addressbook-description' => 'System addressbook which holds all users of this instance'
131 131
 		]);
132 132
 	}
133 133
 
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
 		$cardId = self::getCardUri($user);
142 142
 		if ($user->isEnabled()) {
143
-			$this->atomic(function () use ($addressBookId, $cardId, $user): void {
143
+			$this->atomic(function() use ($addressBookId, $cardId, $user): void {
144 144
 				$card = $this->backend->getCard($addressBookId, $cardId);
145 145
 				if ($card === false) {
146 146
 					$vCard = $this->converter->createCardFromUser($user);
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 	 */
189 189
 	public function syncInstance(?\Closure $progressCallback = null) {
190 190
 		$systemAddressBook = $this->getLocalSystemAddressBook();
191
-		$this->userManager->callForAllUsers(function ($user) use ($systemAddressBook, $progressCallback): void {
191
+		$this->userManager->callForAllUsers(function($user) use ($systemAddressBook, $progressCallback): void {
192 192
 			$this->updateUser($user);
193 193
 			if (!is_null($progressCallback)) {
194 194
 				$progressCallback();
@@ -212,6 +212,6 @@  discard block
 block discarded – undo
212 212
 	 * @return string
213 213
 	 */
214 214
 	public static function getCardUri(IUser $user): string {
215
-		return $user->getBackendClassName() . ':' . $user->getUID() . '.vcf';
215
+		return $user->getBackendClassName().':'.$user->getUID().'.vcf';
216 216
 	}
217 217
 }
Please login to merge, or discard this patch.