Passed
Push — master ( f0dd71...c56a27 )
by Christoph
11:49 queued 12s
created
apps/dav/lib/Connector/Sabre/TagsPlugin.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -226,9 +226,9 @@  discard block
 block discarded – undo
226 226
 		)) {
227 227
 			// note: pre-fetching only supported for depth <= 1
228 228
 			$folderContent = $node->getChildren();
229
-			$fileIds[] = (int)$node->getId();
229
+			$fileIds[] = (int) $node->getId();
230 230
 			foreach ($folderContent as $info) {
231
-				$fileIds[] = (int)$info->getId();
231
+				$fileIds[] = (int) $info->getId();
232 232
 			}
233 233
 			$tags = $this->getTagger()->getTagsForObjects($fileIds);
234 234
 			if ($tags === false) {
@@ -246,12 +246,12 @@  discard block
 block discarded – undo
246 246
 
247 247
 		$isFav = null;
248 248
 
249
-		$propFind->handle(self::TAGS_PROPERTYNAME, function () use (&$isFav, $node) {
249
+		$propFind->handle(self::TAGS_PROPERTYNAME, function() use (&$isFav, $node) {
250 250
 			list($tags, $isFav) = $this->getTagsAndFav($node->getId());
251 251
 			return new TagList($tags);
252 252
 		});
253 253
 
254
-		$propFind->handle(self::FAVORITE_PROPERTYNAME, function () use ($isFav, $node) {
254
+		$propFind->handle(self::FAVORITE_PROPERTYNAME, function() use ($isFav, $node) {
255 255
 			if (is_null($isFav)) {
256 256
 				list(, $isFav) = $this->getTagsAndFav($node->getId());
257 257
 			}
@@ -277,13 +277,13 @@  discard block
 block discarded – undo
277 277
 			return;
278 278
 		}
279 279
 
280
-		$propPatch->handle(self::TAGS_PROPERTYNAME, function ($tagList) use ($node) {
280
+		$propPatch->handle(self::TAGS_PROPERTYNAME, function($tagList) use ($node) {
281 281
 			$this->updateTags($node->getId(), $tagList->getTags());
282 282
 			return true;
283 283
 		});
284 284
 
285
-		$propPatch->handle(self::FAVORITE_PROPERTYNAME, function ($favState) use ($node) {
286
-			if ((int)$favState === 1 || $favState === 'true') {
285
+		$propPatch->handle(self::FAVORITE_PROPERTYNAME, function($favState) use ($node) {
286
+			if ((int) $favState === 1 || $favState === 'true') {
287 287
 				$this->getTagger()->tagAs($node->getId(), self::TAG_FAVORITE);
288 288
 			} else {
289 289
 				$this->getTagger()->unTag($node->getId(), self::TAG_FAVORITE);
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/FilesPlugin.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -178,9 +178,9 @@  discard block
 block discarded – undo
178 178
 		$this->server->on('propPatch', [$this, 'handleUpdateProperties']);
179 179
 		$this->server->on('afterBind', [$this, 'sendFileIdHeader']);
180 180
 		$this->server->on('afterWriteContent', [$this, 'sendFileIdHeader']);
181
-		$this->server->on('afterMethod:GET', [$this,'httpGet']);
181
+		$this->server->on('afterMethod:GET', [$this, 'httpGet']);
182 182
 		$this->server->on('afterMethod:GET', [$this, 'handleDownloadToken']);
183
-		$this->server->on('afterResponse', function ($request, ResponseInterface $response) {
183
+		$this->server->on('afterResponse', function($request, ResponseInterface $response) {
184 184
 			$body = $response->getBody();
185 185
 			if (is_resource($body)) {
186 186
 				fclose($body);
@@ -208,11 +208,11 @@  discard block
 block discarded – undo
208 208
 		if ($sourceDir !== $destinationDir) {
209 209
 			$sourceNodeFileInfo = $sourceNode->getFileInfo();
210 210
 			if ($sourceNodeFileInfo === null) {
211
-				throw new NotFound($source . ' does not exist');
211
+				throw new NotFound($source.' does not exist');
212 212
 			}
213 213
 
214 214
 			if (!$sourceNodeFileInfo->isDeletable()) {
215
-				throw new Forbidden($source . " cannot be deleted");
215
+				throw new Forbidden($source." cannot be deleted");
216 216
 			}
217 217
 		}
218 218
 	}
@@ -265,10 +265,10 @@  discard block
 block discarded – undo
265 265
 					Request::USER_AGENT_ANDROID_MOBILE_CHROME,
266 266
 					Request::USER_AGENT_FREEBOX,
267 267
 				])) {
268
-				$response->addHeader('Content-Disposition', 'attachment; filename="' . rawurlencode($filename) . '"');
268
+				$response->addHeader('Content-Disposition', 'attachment; filename="'.rawurlencode($filename).'"');
269 269
 			} else {
270
-				$response->addHeader('Content-Disposition', 'attachment; filename*=UTF-8\'\'' . rawurlencode($filename)
271
-													 . '; filename="' . rawurlencode($filename) . '"');
270
+				$response->addHeader('Content-Disposition', 'attachment; filename*=UTF-8\'\''.rawurlencode($filename)
271
+													 . '; filename="'.rawurlencode($filename).'"');
272 272
 			}
273 273
 		}
274 274
 
@@ -305,15 +305,15 @@  discard block
 block discarded – undo
305 305
 			 * }
306 306
 			 */
307 307
 
308
-			$propFind->handle(self::FILEID_PROPERTYNAME, function () use ($node) {
308
+			$propFind->handle(self::FILEID_PROPERTYNAME, function() use ($node) {
309 309
 				return $node->getFileId();
310 310
 			});
311 311
 
312
-			$propFind->handle(self::INTERNAL_FILEID_PROPERTYNAME, function () use ($node) {
312
+			$propFind->handle(self::INTERNAL_FILEID_PROPERTYNAME, function() use ($node) {
313 313
 				return $node->getInternalFileId();
314 314
 			});
315 315
 
316
-			$propFind->handle(self::PERMISSIONS_PROPERTYNAME, function () use ($node) {
316
+			$propFind->handle(self::PERMISSIONS_PROPERTYNAME, function() use ($node) {
317 317
 				$perms = $node->getDavPermissions();
318 318
 				if ($this->isPublic) {
319 319
 					// remove mount information
@@ -322,13 +322,13 @@  discard block
 block discarded – undo
322 322
 				return $perms;
323 323
 			});
324 324
 
325
-			$propFind->handle(self::SHARE_PERMISSIONS_PROPERTYNAME, function () use ($node, $httpRequest) {
325
+			$propFind->handle(self::SHARE_PERMISSIONS_PROPERTYNAME, function() use ($node, $httpRequest) {
326 326
 				return $node->getSharePermissions(
327 327
 					$httpRequest->getRawServerValue('PHP_AUTH_USER')
328 328
 				);
329 329
 			});
330 330
 
331
-			$propFind->handle(self::OCM_SHARE_PERMISSIONS_PROPERTYNAME, function () use ($node, $httpRequest) {
331
+			$propFind->handle(self::OCM_SHARE_PERMISSIONS_PROPERTYNAME, function() use ($node, $httpRequest) {
332 332
 				$ncPermissions = $node->getSharePermissions(
333 333
 					$httpRequest->getRawServerValue('PHP_AUTH_USER')
334 334
 				);
@@ -336,11 +336,11 @@  discard block
 block discarded – undo
336 336
 				return json_encode($ocmPermissions);
337 337
 			});
338 338
 
339
-			$propFind->handle(self::GETETAG_PROPERTYNAME, function () use ($node) {
339
+			$propFind->handle(self::GETETAG_PROPERTYNAME, function() use ($node) {
340 340
 				return $node->getETag();
341 341
 			});
342 342
 
343
-			$propFind->handle(self::OWNER_ID_PROPERTYNAME, function () use ($node) {
343
+			$propFind->handle(self::OWNER_ID_PROPERTYNAME, function() use ($node) {
344 344
 				$owner = $node->getOwner();
345 345
 				if (!$owner) {
346 346
 					return null;
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 					return $owner->getUID();
349 349
 				}
350 350
 			});
351
-			$propFind->handle(self::OWNER_DISPLAY_NAME_PROPERTYNAME, function () use ($node) {
351
+			$propFind->handle(self::OWNER_DISPLAY_NAME_PROPERTYNAME, function() use ($node) {
352 352
 				$owner = $node->getOwner();
353 353
 				if (!$owner) {
354 354
 					return null;
@@ -357,17 +357,17 @@  discard block
 block discarded – undo
357 357
 				}
358 358
 			});
359 359
 
360
-			$propFind->handle(self::HAS_PREVIEW_PROPERTYNAME, function () use ($node) {
360
+			$propFind->handle(self::HAS_PREVIEW_PROPERTYNAME, function() use ($node) {
361 361
 				return json_encode($this->previewManager->isAvailable($node->getFileInfo()));
362 362
 			});
363
-			$propFind->handle(self::SIZE_PROPERTYNAME, function () use ($node) {
363
+			$propFind->handle(self::SIZE_PROPERTYNAME, function() use ($node) {
364 364
 				return $node->getSize();
365 365
 			});
366
-			$propFind->handle(self::MOUNT_TYPE_PROPERTYNAME, function () use ($node) {
366
+			$propFind->handle(self::MOUNT_TYPE_PROPERTYNAME, function() use ($node) {
367 367
 				return $node->getFileInfo()->getMountPoint()->getMountType();
368 368
 			});
369 369
 
370
-			$propFind->handle(self::SHARE_NOTE, function () use ($node, $httpRequest) {
370
+			$propFind->handle(self::SHARE_NOTE, function() use ($node, $httpRequest) {
371 371
 				return $node->getNoteFromShare(
372 372
 					$httpRequest->getRawServerValue('PHP_AUTH_USER')
373 373
 				);
@@ -375,13 +375,13 @@  discard block
 block discarded – undo
375 375
 		}
376 376
 
377 377
 		if ($node instanceof \OCA\DAV\Connector\Sabre\Node) {
378
-			$propFind->handle(self::DATA_FINGERPRINT_PROPERTYNAME, function () use ($node) {
378
+			$propFind->handle(self::DATA_FINGERPRINT_PROPERTYNAME, function() use ($node) {
379 379
 				return $this->config->getSystemValue('data-fingerprint', '');
380 380
 			});
381 381
 		}
382 382
 
383 383
 		if ($node instanceof \OCA\DAV\Connector\Sabre\File) {
384
-			$propFind->handle(self::DOWNLOADURL_PROPERTYNAME, function () use ($node) {
384
+			$propFind->handle(self::DOWNLOADURL_PROPERTYNAME, function() use ($node) {
385 385
 				/** @var $node \OCA\DAV\Connector\Sabre\File */
386 386
 				try {
387 387
 					$directDownloadUrl = $node->getDirectDownload();
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
 				return false;
397 397
 			});
398 398
 
399
-			$propFind->handle(self::CHECKSUMS_PROPERTYNAME, function () use ($node) {
399
+			$propFind->handle(self::CHECKSUMS_PROPERTYNAME, function() use ($node) {
400 400
 				$checksum = $node->getChecksum();
401 401
 				if ($checksum === null || $checksum === '') {
402 402
 					return null;
@@ -405,22 +405,22 @@  discard block
 block discarded – undo
405 405
 				return new ChecksumList($checksum);
406 406
 			});
407 407
 
408
-			$propFind->handle(self::CREATION_TIME_PROPERTYNAME, function () use ($node) {
408
+			$propFind->handle(self::CREATION_TIME_PROPERTYNAME, function() use ($node) {
409 409
 				return $node->getFileInfo()->getCreationTime();
410 410
 			});
411 411
 
412
-			$propFind->handle(self::UPLOAD_TIME_PROPERTYNAME, function () use ($node) {
412
+			$propFind->handle(self::UPLOAD_TIME_PROPERTYNAME, function() use ($node) {
413 413
 				return $node->getFileInfo()->getUploadTime();
414 414
 			});
415 415
 
416 416
 		}
417 417
 
418 418
 		if ($node instanceof \OCA\DAV\Connector\Sabre\Directory) {
419
-			$propFind->handle(self::SIZE_PROPERTYNAME, function () use ($node) {
419
+			$propFind->handle(self::SIZE_PROPERTYNAME, function() use ($node) {
420 420
 				return $node->getSize();
421 421
 			});
422 422
 
423
-			$propFind->handle(self::IS_ENCRYPTED_PROPERTYNAME, function () use ($node) {
423
+			$propFind->handle(self::IS_ENCRYPTED_PROPERTYNAME, function() use ($node) {
424 424
 				return $node->getFileInfo()->isEncrypted() ? '1' : '0';
425 425
 			});
426 426
 		}
@@ -467,14 +467,14 @@  discard block
 block discarded – undo
467 467
 			return;
468 468
 		}
469 469
 
470
-		$propPatch->handle(self::LASTMODIFIED_PROPERTYNAME, function ($time) use ($node) {
470
+		$propPatch->handle(self::LASTMODIFIED_PROPERTYNAME, function($time) use ($node) {
471 471
 			if (empty($time)) {
472 472
 				return false;
473 473
 			}
474 474
 			$node->touch($time);
475 475
 			return true;
476 476
 		});
477
-		$propPatch->handle(self::GETETAG_PROPERTYNAME, function ($etag) use ($node) {
477
+		$propPatch->handle(self::GETETAG_PROPERTYNAME, function($etag) use ($node) {
478 478
 			if (empty($etag)) {
479 479
 				return false;
480 480
 			}
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
 			}
484 484
 			return false;
485 485
 		});
486
-		$propPatch->handle(self::CREATION_TIME_PROPERTYNAME, function ($time) use ($node) {
486
+		$propPatch->handle(self::CREATION_TIME_PROPERTYNAME, function($time) use ($node) {
487 487
 			if (empty($time)) {
488 488
 				return false;
489 489
 			}
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
 			list($path, $name) = \Sabre\Uri\split($filePath);
504 504
 			$info = \OC_FileChunking::decodeName($name);
505 505
 			if (!empty($info)) {
506
-				$filePath = $path . '/' . $info['name'];
506
+				$filePath = $path.'/'.$info['name'];
507 507
 			}
508 508
 		}
509 509
 
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/Principal.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 		$principals = [];
133 133
 
134 134
 		if ($prefixPath === $this->principalPrefix) {
135
-			foreach($this->userManager->search('') as $user) {
135
+			foreach ($this->userManager->search('') as $user) {
136 136
 				$principals[] = $this->userToPrincipal($user);
137 137
 			}
138 138
 		}
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 
160 160
 				if ($user !== null) {
161 161
 					return [
162
-						'uri' => 'principals/users/' . $user->getUID() . '/' . $name,
162
+						'uri' => 'principals/users/'.$user->getUID().'/'.$name,
163 163
 					];
164 164
 				}
165 165
 				return null;
@@ -206,8 +206,8 @@  discard block
 block discarded – undo
206 206
 
207 207
 		if ($this->hasGroups || $needGroups) {
208 208
 			$userGroups = $this->groupManager->getUserGroups($user);
209
-			foreach($userGroups as $userGroup) {
210
-				$groups[] = 'principals/groups/' . urlencode($userGroup->getGID());
209
+			foreach ($userGroups as $userGroup) {
210
+				$groups[] = 'principals/groups/'.urlencode($userGroup->getGID());
211 211
 			}
212 212
 		}
213 213
 
@@ -273,13 +273,13 @@  discard block
 block discarded – undo
273 273
 					$users = $this->userManager->getByEmail($value);
274 274
 
275 275
 					if (!$allowEnumeration) {
276
-						$users = \array_filter($users, static function (IUser $user) use ($value) {
276
+						$users = \array_filter($users, static function(IUser $user) use ($value) {
277 277
 							return $user->getEMailAddress() === $value;
278 278
 						});
279 279
 					}
280 280
 
281 281
 					if ($limitEnumeration) {
282
-						$users = \array_filter($users, function (IUser $user) use ($currentUserGroups, $value) {
282
+						$users = \array_filter($users, function(IUser $user) use ($currentUserGroups, $value) {
283 283
 							return !empty(array_intersect(
284 284
 									$this->groupManager->getUserGroupIds($user),
285 285
 									$currentUserGroups
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 						});
288 288
 					}
289 289
 
290
-					$results[] = array_reduce($users, function (array $carry, IUser $user) use ($restrictGroups) {
290
+					$results[] = array_reduce($users, function(array $carry, IUser $user) use ($restrictGroups) {
291 291
 						// is sharing restricted to groups only?
292 292
 						if ($restrictGroups !== false) {
293 293
 							$userGroups = $this->groupManager->getUserGroupIds($user);
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 							}
297 297
 						}
298 298
 
299
-						$carry[] = $this->principalPrefix . '/' . $user->getUID();
299
+						$carry[] = $this->principalPrefix.'/'.$user->getUID();
300 300
 						return $carry;
301 301
 					}, []);
302 302
 					break;
@@ -305,13 +305,13 @@  discard block
 block discarded – undo
305 305
 					$users = $this->userManager->searchDisplayName($value);
306 306
 
307 307
 					if (!$allowEnumeration) {
308
-						$users = \array_filter($users, static function (IUser $user) use ($value) {
308
+						$users = \array_filter($users, static function(IUser $user) use ($value) {
309 309
 							return $user->getDisplayName() === $value;
310 310
 						});
311 311
 					}
312 312
 
313 313
 					if ($limitEnumeration) {
314
-						$users = \array_filter($users, function (IUser $user) use ($currentUserGroups, $value) {
314
+						$users = \array_filter($users, function(IUser $user) use ($currentUserGroups, $value) {
315 315
 							return !empty(array_intersect(
316 316
 									$this->groupManager->getUserGroupIds($user),
317 317
 									$currentUserGroups
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 						});
320 320
 					}
321 321
 
322
-					$results[] = array_reduce($users, function (array $carry, IUser $user) use ($restrictGroups) {
322
+					$results[] = array_reduce($users, function(array $carry, IUser $user) use ($restrictGroups) {
323 323
 						// is sharing restricted to groups only?
324 324
 						if ($restrictGroups !== false) {
325 325
 							$userGroups = $this->groupManager->getUserGroupIds($user);
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 							}
329 329
 						}
330 330
 
331
-						$carry[] = $this->principalPrefix . '/' . $user->getUID();
331
+						$carry[] = $this->principalPrefix.'/'.$user->getUID();
332 332
 						return $carry;
333 333
 					}, []);
334 334
 					break;
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 					}
425 425
 				}
426 426
 
427
-				return $this->principalPrefix . '/' . $user->getUID();
427
+				return $this->principalPrefix.'/'.$user->getUID();
428 428
 			}
429 429
 		}
430 430
 		if (substr($uri, 0, 10) === 'principal:') {
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 		$userId = $user->getUID();
447 447
 		$displayName = $user->getDisplayName();
448 448
 		$principal = [
449
-			'uri' => $this->principalPrefix . '/' . $userId,
449
+			'uri' => $this->principalPrefix.'/'.$userId,
450 450
 			'{DAV:}displayname' => is_null($displayName) ? $userId : $displayName,
451 451
 			'{urn:ietf:params:xml:ns:caldav}calendar-user-type' => 'INDIVIDUAL',
452 452
 		];
@@ -477,9 +477,9 @@  discard block
 block discarded – undo
477 477
 
478 478
 		try {
479 479
 			$circle = \OCA\Circles\Api\v1\Circles::detailsCircle($circleUniqueId, true);
480
-		} catch(QueryException $ex) {
480
+		} catch (QueryException $ex) {
481 481
 			return null;
482
-		} catch(CircleDoesNotExistException $ex) {
482
+		} catch (CircleDoesNotExistException $ex) {
483 483
 			return null;
484 484
 		}
485 485
 
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
 		}
489 489
 
490 490
 		$principal = [
491
-			'uri' => 'principals/circles/' . $circleUniqueId,
491
+			'uri' => 'principals/circles/'.$circleUniqueId,
492 492
 			'{DAV:}displayname' => $circle->getName(),
493 493
 		];
494 494
 
@@ -518,9 +518,9 @@  discard block
 block discarded – undo
518 518
 
519 519
 			$circles = \OCA\Circles\Api\v1\Circles::joinedCircles($name, true);
520 520
 
521
-			$circles = array_map(function ($circle) {
521
+			$circles = array_map(function($circle) {
522 522
 				/** @var \OCA\Circles\Model\Circle $circle */
523
-				return 'principals/circles/' . urlencode($circle->getUniqueId());
523
+				return 'principals/circles/'.urlencode($circle->getUniqueId());
524 524
 			}, $circles);
525 525
 
526 526
 			return $circles;
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -99,15 +99,15 @@  discard block
 block discarded – undo
99 99
 			}
100 100
 		}
101 101
 
102
-		$propFind->handle(self::PROPERTY_NAME_COUNT, function () use ($node) {
103
-			return $this->commentsManager->getNumberOfCommentsForObject('files', (string)$node->getId());
102
+		$propFind->handle(self::PROPERTY_NAME_COUNT, function() use ($node) {
103
+			return $this->commentsManager->getNumberOfCommentsForObject('files', (string) $node->getId());
104 104
 		});
105 105
 
106
-		$propFind->handle(self::PROPERTY_NAME_HREF, function () use ($node) {
106
+		$propFind->handle(self::PROPERTY_NAME_HREF, function() use ($node) {
107 107
 			return $this->getCommentsLink($node);
108 108
 		});
109 109
 
110
-		$propFind->handle(self::PROPERTY_NAME_UNREAD, function () use ($node) {
110
+		$propFind->handle(self::PROPERTY_NAME_UNREAD, function() use ($node) {
111 111
 			if (isset($this->cachedUnreadCount[$node->getId()])) {
112 112
 				return $this->cachedUnreadCount[$node->getId()];
113 113
 			} else {
@@ -132,13 +132,13 @@  discard block
 block discarded – undo
132 132
 	 * @return mixed|string
133 133
 	 */
134 134
 	public function getCommentsLink(Node $node) {
135
-		$href =  $this->server->getBaseUri();
135
+		$href = $this->server->getBaseUri();
136 136
 		$entryPoint = strpos($href, '/remote.php/');
137
-		if($entryPoint === false) {
137
+		if ($entryPoint === false) {
138 138
 			// in case we end up somewhere else, unexpectedly.
139 139
 			return null;
140 140
 		}
141
-		$commentsPart = 'dav/comments/files/' . rawurldecode($node->getId());
141
+		$commentsPart = 'dav/comments/files/'.rawurldecode($node->getId());
142 142
 		$href = substr_replace($href, $commentsPart, $entryPoint + strlen('/remote.php/'));
143 143
 		return $href;
144 144
 	}
@@ -152,13 +152,13 @@  discard block
 block discarded – undo
152 152
 	 */
153 153
 	public function getUnreadCount(Node $node) {
154 154
 		$user = $this->userSession->getUser();
155
-		if(is_null($user)) {
155
+		if (is_null($user)) {
156 156
 			return null;
157 157
 		}
158 158
 
159
-		$lastRead = $this->commentsManager->getReadMark('files', (string)$node->getId(), $user);
159
+		$lastRead = $this->commentsManager->getReadMark('files', (string) $node->getId(), $user);
160 160
 
161
-		return $this->commentsManager->getNumberOfCommentsForObject('files', (string)$node->getId(), $lastRead);
161
+		return $this->commentsManager->getNumberOfCommentsForObject('files', (string) $node->getId(), $lastRead);
162 162
 	}
163 163
 
164 164
 }
Please login to merge, or discard this patch.
apps/dav/lib/DAV/GroupPrincipalBackend.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 		$principals = [];
79 79
 
80 80
 		if ($prefixPath === self::PRINCIPAL_PREFIX) {
81
-			foreach($this->groupManager->search('') as $user) {
81
+			foreach ($this->groupManager->search('') as $user) {
82 82
 				$principals[] = $this->groupToPrincipal($user);
83 83
 			}
84 84
 		}
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	 * @return array
96 96
 	 */
97 97
 	public function getPrincipalByPath($path) {
98
-		$elements = explode('/', $path,  3);
98
+		$elements = explode('/', $path, 3);
99 99
 		if ($elements[0] !== 'principals') {
100 100
 			return null;
101 101
 		}
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 			return [];
135 135
 		}
136 136
 
137
-		return array_map(function ($user) {
137
+		return array_map(function($user) {
138 138
 			return $this->userToPrincipal($user);
139 139
 		}, $group->getUsers());
140 140
 	}
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 				case '{DAV:}displayname':
211 211
 					$groups = $this->groupManager->search($value);
212 212
 
213
-					$results[] = array_reduce($groups, function (array $carry, IGroup $group) use ($restrictGroups) {
213
+					$results[] = array_reduce($groups, function(array $carry, IGroup $group) use ($restrictGroups) {
214 214
 						$gid = $group->getGID();
215 215
 						// is sharing restricted to groups only?
216 216
 						if ($restrictGroups !== false) {
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 							}
220 220
 						}
221 221
 
222
-						$carry[] = self::PRINCIPAL_PREFIX . '/' . $gid;
222
+						$carry[] = self::PRINCIPAL_PREFIX.'/'.$gid;
223 223
 						return $carry;
224 224
 					}, []);
225 225
 					break;
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 		$displayName = $group->getDisplayName();
300 300
 
301 301
 		return [
302
-			'uri' => 'principals/groups/' . urlencode($groupId),
302
+			'uri' => 'principals/groups/'.urlencode($groupId),
303 303
 			'{DAV:}displayname' => $displayName,
304 304
 			'{urn:ietf:params:xml:ns:caldav}calendar-user-type' => 'GROUP',
305 305
 		];
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 		$displayName = $user->getDisplayName();
316 316
 
317 317
 		$principal = [
318
-			'uri' => 'principals/users/' . $userId,
318
+			'uri' => 'principals/users/'.$userId,
319 319
 			'{DAV:}displayname' => $displayName,
320 320
 			'{urn:ietf:params:xml:ns:caldav}calendar-user-type' => 'INDIVIDUAL',
321 321
 		];
Please login to merge, or discard this patch.
apps/dav/lib/DAV/Sharing/Plugin.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -102,11 +102,11 @@  discard block
 block discarded – undo
102 102
 	 */
103 103
 	function initialize(Server $server) {
104 104
 		$this->server = $server;
105
-		$this->server->xml->elementMap['{' . Plugin::NS_OWNCLOUD . '}share'] = ShareRequest::class;
106
-		$this->server->xml->elementMap['{' . Plugin::NS_OWNCLOUD . '}invite'] = Invite::class;
105
+		$this->server->xml->elementMap['{'.Plugin::NS_OWNCLOUD.'}share'] = ShareRequest::class;
106
+		$this->server->xml->elementMap['{'.Plugin::NS_OWNCLOUD.'}invite'] = Invite::class;
107 107
 
108 108
 		$this->server->on('method:POST', [$this, 'httpPost']);
109
-		$this->server->on('propFind',    [$this, 'propFind']);
109
+		$this->server->on('propFind', [$this, 'propFind']);
110 110
 	}
111 111
 
112 112
 	/**
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
 			// Dealing with the 'share' document, which modified invitees on a
151 151
 			// calendar.
152
-			case '{' . self::NS_OWNCLOUD . '}share' :
152
+			case '{'.self::NS_OWNCLOUD.'}share' :
153 153
 
154 154
 				// We can only deal with IShareableCalendar objects
155 155
 				if (!$node instanceof IShareable) {
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 	function propFind(PropFind $propFind, INode $node) {
193 193
 		if ($node instanceof IShareable) {
194 194
 
195
-			$propFind->handle('{' . Plugin::NS_OWNCLOUD . '}invite', function () use ($node) {
195
+			$propFind->handle('{'.Plugin::NS_OWNCLOUD.'}invite', function() use ($node) {
196 196
 				return new Invite(
197 197
 					$node->getShares()
198 198
 				);
Please login to merge, or discard this patch.
apps/dav/lib/Server.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 		$authPlugin->addBackend($authBackend);
127 127
 
128 128
 		// debugging
129
-		if(\OC::$server->getConfig()->getSystemValue('debug', false)) {
129
+		if (\OC::$server->getConfig()->getSystemValue('debug', false)) {
130 130
 			$this->server->addPlugin(new \Sabre\DAV\Browser\Plugin());
131 131
 		} else {
132 132
 			$this->server->addPlugin(new DummyGetResponsePlugin());
@@ -201,10 +201,10 @@  discard block
 block discarded – undo
201 201
 
202 202
 		// Some WebDAV clients do require Class 2 WebDAV support (locking), since
203 203
 		// we do not provide locking we emulate it using a fake locking plugin.
204
-		if($request->isUserAgent([
204
+		if ($request->isUserAgent([
205 205
 			'/WebDAVFS/',
206 206
 			'/OneNote/',
207
-			'/^Microsoft-WebDAV/',// Microsoft-WebDAV-MiniRedir/6.1.7601
207
+			'/^Microsoft-WebDAV/', // Microsoft-WebDAV-MiniRedir/6.1.7601
208 208
 		])) {
209 209
 			$this->server->addPlugin(new FakeLockerPlugin());
210 210
 		}
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 		$this->server->addPlugin(new SearchPlugin($lazySearchBackend));
218 218
 
219 219
 		// wait with registering these until auth is handled and the filesystem is setup
220
-		$this->server->on('beforeMethod:*', function () use ($root, $lazySearchBackend) {
220
+		$this->server->on('beforeMethod:*', function() use ($root, $lazySearchBackend) {
221 221
 			// custom properties plugin must be the last one
222 222
 			$userSession = \OC::$server->getUserSession();
223 223
 			$user = $userSession->getUser();
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 					\OC::$server->getThemingDefaults(),
296 296
 					\OC::$server->getRequest(),
297 297
 					\OC::$server->getL10N('dav'),
298
-					function () {
298
+					function() {
299 299
 						return UUIDUtil::getUUID();
300 300
 					}
301 301
 				));
Please login to merge, or discard this patch.
apps/dav/lib/Command/SyncBirthdayCalendar.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@
 block discarded – undo
96 96
 		$output->writeln("Start birthday calendar sync for all users ...");
97 97
 		$p = new ProgressBar($output);
98 98
 		$p->start();
99
-		$this->userManager->callForSeenUsers(function ($user) use ($p) {
99
+		$this->userManager->callForSeenUsers(function($user) use ($p) {
100 100
 			$p->advance();
101 101
 
102 102
 			$userId = $user->getUID();
Please login to merge, or discard this patch.
apps/dav/lib/Traits/PrincipalProxyTrait.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -91,11 +91,11 @@  discard block
 block discarded – undo
91 91
 		$proxies = $this->proxyMapper->getProxiesFor($principal);
92 92
 		foreach ($proxies as $proxy) {
93 93
 			if ($proxy->getPermissions() === ProxyMapper::PERMISSION_READ) {
94
-				$groups[] = $proxy->getOwnerId() . '/calendar-proxy-read';
94
+				$groups[] = $proxy->getOwnerId().'/calendar-proxy-read';
95 95
 			}
96 96
 
97 97
 			if ($proxy->getPermissions() === (ProxyMapper::PERMISSION_READ | ProxyMapper::PERMISSION_WRITE)) {
98
-				$groups[] = $proxy->getOwnerId() . '/calendar-proxy-write';
98
+				$groups[] = $proxy->getOwnerId().'/calendar-proxy-write';
99 99
 			}
100 100
 		}
101 101
 
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 			list($prefix, $name) = \Sabre\Uri\split($member);
136 136
 
137 137
 			if ($prefix !== $this->principalPrefix) {
138
-				throw new Exception('Invalid member group prefix: ' . $prefix);
138
+				throw new Exception('Invalid member group prefix: '.$prefix);
139 139
 			}
140 140
 
141 141
 			$principalArray = $this->getPrincipalByPath($member);
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 					$proxy->setPermissions($proxy->getPermissions() | $permission);
151 151
 					$this->proxyMapper->update($proxy);
152 152
 
153
-					$proxies = array_filter($proxies, function (Proxy $p) use ($proxy) {
153
+					$proxies = array_filter($proxies, function(Proxy $p) use ($proxy) {
154 154
 						return $p->getId() !== $proxy->getId();
155 155
 					});
156 156
 					break;
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 	 * @return string
220 220
 	 */
221 221
 	private function getPrincipalUriFromProxyPrincipal(string $principalUri):string {
222
-		list($realPrincipalUri, ) = \Sabre\Uri\split($principalUri);
222
+		list($realPrincipalUri,) = \Sabre\Uri\split($principalUri);
223 223
 		return $realPrincipalUri;
224 224
 	}
225 225
 }
Please login to merge, or discard this patch.