Passed
Push — master ( f6daf1...00cb8e )
by Morris
12:11 queued 12s
created
apps/dav/lib/CalDAV/Schedule/Plugin.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
 	/** @var string|null */
66 66
 	private $pathOfCalendarObjectChange = null;
67 67
 
68
-	public const CALENDAR_USER_TYPE = '{' . self::NS_CALDAV . '}calendar-user-type';
69
-	public const SCHEDULE_DEFAULT_CALENDAR_URL = '{' . Plugin::NS_CALDAV . '}schedule-default-calendar-URL';
68
+	public const CALENDAR_USER_TYPE = '{'.self::NS_CALDAV.'}calendar-user-type';
69
+	public const SCHEDULE_DEFAULT_CALENDAR_URL = '{'.Plugin::NS_CALDAV.'}schedule-default-calendar-URL';
70 70
 
71 71
 	/**
72 72
 	 * @param IConfig $config
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 	public function propFind(PropFind $propFind, INode $node) {
101 101
 		if ($node instanceof IPrincipal) {
102 102
 			// overwrite Sabre/Dav's implementation
103
-			$propFind->handle(self::CALENDAR_USER_TYPE, function () use ($node) {
103
+			$propFind->handle(self::CALENDAR_USER_TYPE, function() use ($node) {
104 104
 				if ($node instanceof IProperties) {
105 105
 					$props = $node->getProperties([self::CALENDAR_USER_TYPE]);
106 106
 
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 		}
208 208
 
209 209
 		$dtstart = $vevent->DTSTART;
210
-		$dtend =  $this->getDTEndFromVEvent($vevent);
210
+		$dtend = $this->getDTEndFromVEvent($vevent);
211 211
 		$uid = $vevent->UID->getValue();
212 212
 		$sequence = isset($vevent->SEQUENCE) ? $vevent->SEQUENCE->getValue() : 0;
213 213
 		$recurrenceId = isset($vevent->{'RECURRENCE-ID'}) ? $vevent->{'RECURRENCE-ID'}->serialize() : '';
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 	 */
280 280
 	public function propFindDefaultCalendarUrl(PropFind $propFind, INode $node) {
281 281
 		if ($node instanceof IPrincipal) {
282
-			$propFind->handle(self::SCHEDULE_DEFAULT_CALENDAR_URL, function () use ($node) {
282
+			$propFind->handle(self::SCHEDULE_DEFAULT_CALENDAR_URL, function() use ($node) {
283 283
 				/** @var \OCA\DAV\CalDAV\Plugin $caldavPlugin */
284 284
 				$caldavPlugin = $this->server->getPlugin('caldav');
285 285
 				$principalUrl = $node->getPrincipalUrl();
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
 					]);
312 312
 				}
313 313
 
314
-				$result = $this->server->getPropertiesForPath($calendarHomePath . '/' . $uri, [], 1);
314
+				$result = $this->server->getPropertiesForPath($calendarHomePath.'/'.$uri, [], 1);
315 315
 				if (empty($result)) {
316 316
 					return null;
317 317
 				}
@@ -327,8 +327,8 @@  discard block
 block discarded – undo
327 327
 	 * @param string $principal
328 328
 	 * @return string|null
329 329
 	 */
330
-	protected function getCalendarUserTypeForPrincipal($principal):?string {
331
-		$calendarUserType = '{' . self::NS_CALDAV . '}calendar-user-type';
330
+	protected function getCalendarUserTypeForPrincipal($principal): ?string {
331
+		$calendarUserType = '{'.self::NS_CALDAV.'}calendar-user-type';
332 332
 		$properties = $this->server->getProperties(
333 333
 			$principal,
334 334
 			[$calendarUserType]
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
 	 * @param ITip\Message $iTipMessage
347 347
 	 * @return null|Property
348 348
 	 */
349
-	private function getCurrentAttendee(ITip\Message $iTipMessage):?Property {
349
+	private function getCurrentAttendee(ITip\Message $iTipMessage): ?Property {
350 350
 		/** @var VEvent $vevent */
351 351
 		$vevent = $iTipMessage->message->VEVENT;
352 352
 		$attendees = $vevent->select('ATTENDEE');
@@ -424,8 +424,8 @@  discard block
 block discarded – undo
424 424
 			['{http://sabredav.org/ns}email-address' => $this->stripOffMailTo($email)],
425 425
 			[
426 426
 				'{DAV:}principal-URL',
427
-				'{' . self::NS_CALDAV . '}calendar-home-set',
428
-				'{' . self::NS_CALDAV . '}schedule-inbox-URL',
427
+				'{'.self::NS_CALDAV.'}calendar-home-set',
428
+				'{'.self::NS_CALDAV.'}schedule-inbox-URL',
429 429
 				'{http://sabredav.org/ns}email-address',
430 430
 
431 431
 			]
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 		$objects = [];
438 438
 		$calendarTimeZone = new DateTimeZone('UTC');
439 439
 
440
-		$homePath = $result[0][200]['{' . self::NS_CALDAV . '}calendar-home-set']->getHref();
440
+		$homePath = $result[0][200]['{'.self::NS_CALDAV.'}calendar-home-set']->getHref();
441 441
 		foreach ($this->server->tree->getNodeForPath($homePath)->getChildren() as $node) {
442 442
 			if (!$node instanceof ICalendar) {
443 443
 				continue;
@@ -488,8 +488,8 @@  discard block
 block discarded – undo
488 488
 		}
489 489
 
490 490
 		$inboxProps = $this->server->getProperties(
491
-			$result[0][200]['{' . self::NS_CALDAV . '}schedule-inbox-URL']->getHref(),
492
-			['{' . self::NS_CALDAV . '}calendar-availability']
491
+			$result[0][200]['{'.self::NS_CALDAV.'}schedule-inbox-URL']->getHref(),
492
+			['{'.self::NS_CALDAV.'}calendar-availability']
493 493
 		);
494 494
 
495 495
 		$vcalendar = new VCalendar();
@@ -501,10 +501,10 @@  discard block
 block discarded – undo
501 501
 		$generator->setBaseObject($vcalendar);
502 502
 		$generator->setTimeZone($calendarTimeZone);
503 503
 
504
-		if (isset($inboxProps['{' . self::NS_CALDAV . '}calendar-availability'])) {
504
+		if (isset($inboxProps['{'.self::NS_CALDAV.'}calendar-availability'])) {
505 505
 			$generator->setVAvailability(
506 506
 				Reader::read(
507
-					$inboxProps['{' . self::NS_CALDAV . '}calendar-availability']
507
+					$inboxProps['{'.self::NS_CALDAV.'}calendar-availability']
508 508
 				)
509 509
 			);
510 510
 		}
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
 	 * @return string
549 549
 	 */
550 550
 	private function stripOffMailTo(string $email): string {
551
-		if (stripos($email, 'mailto:')  === 0) {
551
+		if (stripos($email, 'mailto:') === 0) {
552 552
 			return substr($email, 7);
553 553
 		}
554 554
 
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
 	}
@@ -267,10 +267,10 @@  discard block
 block discarded – undo
267 267
 					Request::USER_AGENT_ANDROID_MOBILE_CHROME,
268 268
 					Request::USER_AGENT_FREEBOX,
269 269
 				])) {
270
-				$response->addHeader('Content-Disposition', 'attachment; filename="' . rawurlencode($filename) . '"');
270
+				$response->addHeader('Content-Disposition', 'attachment; filename="'.rawurlencode($filename).'"');
271 271
 			} else {
272
-				$response->addHeader('Content-Disposition', 'attachment; filename*=UTF-8\'\'' . rawurlencode($filename)
273
-													 . '; filename="' . rawurlencode($filename) . '"');
272
+				$response->addHeader('Content-Disposition', 'attachment; filename*=UTF-8\'\''.rawurlencode($filename)
273
+													 . '; filename="'.rawurlencode($filename).'"');
274 274
 			}
275 275
 		}
276 276
 
@@ -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
 				try {
386 386
 					$directDownloadUrl = $node->getDirectDownload();
387 387
 					if (isset($directDownloadUrl['url'])) {
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 				return false;
396 396
 			});
397 397
 
398
-			$propFind->handle(self::CHECKSUMS_PROPERTYNAME, function () use ($node) {
398
+			$propFind->handle(self::CHECKSUMS_PROPERTYNAME, function() use ($node) {
399 399
 				$checksum = $node->getChecksum();
400 400
 				if ($checksum === null || $checksum === '') {
401 401
 					return null;
@@ -404,21 +404,21 @@  discard block
 block discarded – undo
404 404
 				return new ChecksumList($checksum);
405 405
 			});
406 406
 
407
-			$propFind->handle(self::CREATION_TIME_PROPERTYNAME, function () use ($node) {
407
+			$propFind->handle(self::CREATION_TIME_PROPERTYNAME, function() use ($node) {
408 408
 				return $node->getFileInfo()->getCreationTime();
409 409
 			});
410 410
 
411
-			$propFind->handle(self::UPLOAD_TIME_PROPERTYNAME, function () use ($node) {
411
+			$propFind->handle(self::UPLOAD_TIME_PROPERTYNAME, function() use ($node) {
412 412
 				return $node->getFileInfo()->getUploadTime();
413 413
 			});
414 414
 		}
415 415
 
416 416
 		if ($node instanceof \OCA\DAV\Connector\Sabre\Directory) {
417
-			$propFind->handle(self::SIZE_PROPERTYNAME, function () use ($node) {
417
+			$propFind->handle(self::SIZE_PROPERTYNAME, function() use ($node) {
418 418
 				return $node->getSize();
419 419
 			});
420 420
 
421
-			$propFind->handle(self::IS_ENCRYPTED_PROPERTYNAME, function () use ($node) {
421
+			$propFind->handle(self::IS_ENCRYPTED_PROPERTYNAME, function() use ($node) {
422 422
 				return $node->getFileInfo()->isEncrypted() ? '1' : '0';
423 423
 			});
424 424
 		}
@@ -463,14 +463,14 @@  discard block
 block discarded – undo
463 463
 			return;
464 464
 		}
465 465
 
466
-		$propPatch->handle(self::LASTMODIFIED_PROPERTYNAME, function ($time) use ($node) {
466
+		$propPatch->handle(self::LASTMODIFIED_PROPERTYNAME, function($time) use ($node) {
467 467
 			if (empty($time)) {
468 468
 				return false;
469 469
 			}
470 470
 			$node->touch($time);
471 471
 			return true;
472 472
 		});
473
-		$propPatch->handle(self::GETETAG_PROPERTYNAME, function ($etag) use ($node) {
473
+		$propPatch->handle(self::GETETAG_PROPERTYNAME, function($etag) use ($node) {
474 474
 			if (empty($etag)) {
475 475
 				return false;
476 476
 			}
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
 			}
480 480
 			return false;
481 481
 		});
482
-		$propPatch->handle(self::CREATION_TIME_PROPERTYNAME, function ($time) use ($node) {
482
+		$propPatch->handle(self::CREATION_TIME_PROPERTYNAME, function($time) use ($node) {
483 483
 			if (empty($time)) {
484 484
 				return false;
485 485
 			}
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
 			list($path, $name) = \Sabre\Uri\split($filePath);
500 500
 			$info = \OC_FileChunking::decodeName($name);
501 501
 			if (!empty($info)) {
502
-				$filePath = $path . '/' . $info['name'];
502
+				$filePath = $path.'/'.$info['name'];
503 503
 			}
504 504
 		}
505 505
 
Please login to merge, or discard this patch.
lib/private/Server.php 1 patch
Spacing   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -258,10 +258,10 @@  discard block
 block discarded – undo
258 258
 		$this->registerParameter('isCLI', \OC::$CLI);
259 259
 		$this->registerParameter('serverRoot', \OC::$SERVERROOT);
260 260
 
261
-		$this->registerService(ContainerInterface::class, function (ContainerInterface $c) {
261
+		$this->registerService(ContainerInterface::class, function(ContainerInterface $c) {
262 262
 			return $c;
263 263
 		});
264
-		$this->registerService(\OCP\IServerContainer::class, function (ContainerInterface $c) {
264
+		$this->registerService(\OCP\IServerContainer::class, function(ContainerInterface $c) {
265 265
 			return $c;
266 266
 		});
267 267
 
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 		$this->registerAlias(IActionFactory::class, ActionFactory::class);
287 287
 
288 288
 
289
-		$this->registerService(IPreview::class, function (Server $c) {
289
+		$this->registerService(IPreview::class, function(Server $c) {
290 290
 			return new PreviewManager(
291 291
 				$c->getConfig(),
292 292
 				$c->getRootFolder(),
@@ -299,13 +299,13 @@  discard block
 block discarded – undo
299 299
 		/** @deprecated 19.0.0 */
300 300
 		$this->registerDeprecatedAlias('PreviewManager', IPreview::class);
301 301
 
302
-		$this->registerService(\OC\Preview\Watcher::class, function (Server $c) {
302
+		$this->registerService(\OC\Preview\Watcher::class, function(Server $c) {
303 303
 			return new \OC\Preview\Watcher(
304 304
 				new \OC\Preview\Storage\Root($c->getRootFolder(), $c->getSystemConfig())
305 305
 			);
306 306
 		});
307 307
 
308
-		$this->registerService(\OCP\Encryption\IManager::class, function (Server $c) {
308
+		$this->registerService(\OCP\Encryption\IManager::class, function(Server $c) {
309 309
 			$view = new View();
310 310
 			$util = new Encryption\Util(
311 311
 				$view,
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 		/** @deprecated 19.0.0 */
326 326
 		$this->registerDeprecatedAlias('EncryptionManager', \OCP\Encryption\IManager::class);
327 327
 
328
-		$this->registerService('EncryptionFileHelper', function (Server $c) {
328
+		$this->registerService('EncryptionFileHelper', function(Server $c) {
329 329
 			$util = new Encryption\Util(
330 330
 				new View(),
331 331
 				$c->getUserManager(),
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 			);
340 340
 		});
341 341
 
342
-		$this->registerService('EncryptionKeyStorage', function (Server $c) {
342
+		$this->registerService('EncryptionKeyStorage', function(Server $c) {
343 343
 			$view = new View();
344 344
 			$util = new Encryption\Util(
345 345
 				$view,
@@ -357,21 +357,21 @@  discard block
 block discarded – undo
357 357
 		/** @deprecated 19.0.0 */
358 358
 		$this->registerDeprecatedAlias('TagManager', \OCP\ITagManager::class);
359 359
 
360
-		$this->registerService('SystemTagManagerFactory', function (Server $c) {
360
+		$this->registerService('SystemTagManagerFactory', function(Server $c) {
361 361
 			$config = $c->getConfig();
362 362
 			$factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class);
363 363
 			return new $factoryClass($this);
364 364
 		});
365
-		$this->registerService(ISystemTagManager::class, function (Server $c) {
365
+		$this->registerService(ISystemTagManager::class, function(Server $c) {
366 366
 			return $c->query('SystemTagManagerFactory')->getManager();
367 367
 		});
368 368
 		/** @deprecated 19.0.0 */
369 369
 		$this->registerDeprecatedAlias('SystemTagManager', ISystemTagManager::class);
370 370
 
371
-		$this->registerService(ISystemTagObjectMapper::class, function (Server $c) {
371
+		$this->registerService(ISystemTagObjectMapper::class, function(Server $c) {
372 372
 			return $c->query('SystemTagManagerFactory')->getObjectMapper();
373 373
 		});
374
-		$this->registerService('RootFolder', function (Server $c) {
374
+		$this->registerService('RootFolder', function(Server $c) {
375 375
 			$manager = \OC\Files\Filesystem::getMountManager(null);
376 376
 			$view = new View();
377 377
 			$root = new Root(
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 
389 389
 			return $root;
390 390
 		});
391
-		$this->registerService(HookConnector::class, function (Server $c) {
391
+		$this->registerService(HookConnector::class, function(Server $c) {
392 392
 			return new HookConnector(
393 393
 				$c->query(IRootFolder::class),
394 394
 				new View(),
@@ -400,8 +400,8 @@  discard block
 block discarded – undo
400 400
 		/** @deprecated 19.0.0 */
401 401
 		$this->registerDeprecatedAlias('SystemTagObjectMapper', ISystemTagObjectMapper::class);
402 402
 
403
-		$this->registerService(IRootFolder::class, function (Server $c) {
404
-			return new LazyRoot(function () use ($c) {
403
+		$this->registerService(IRootFolder::class, function(Server $c) {
404
+			return new LazyRoot(function() use ($c) {
405 405
 				return $c->query('RootFolder');
406 406
 			});
407 407
 		});
@@ -412,44 +412,44 @@  discard block
 block discarded – undo
412 412
 		$this->registerDeprecatedAlias('UserManager', \OC\User\Manager::class);
413 413
 		$this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class);
414 414
 
415
-		$this->registerService(\OCP\IGroupManager::class, function (Server $c) {
415
+		$this->registerService(\OCP\IGroupManager::class, function(Server $c) {
416 416
 			$groupManager = new \OC\Group\Manager($this->getUserManager(), $c->getEventDispatcher(), $this->getLogger());
417
-			$groupManager->listen('\OC\Group', 'preCreate', function ($gid) {
417
+			$groupManager->listen('\OC\Group', 'preCreate', function($gid) {
418 418
 				\OC_Hook::emit('OC_Group', 'pre_createGroup', ['run' => true, 'gid' => $gid]);
419 419
 
420 420
 				/** @var IEventDispatcher $dispatcher */
421 421
 				$dispatcher = $this->query(IEventDispatcher::class);
422 422
 				$dispatcher->dispatchTyped(new BeforeGroupCreatedEvent($gid));
423 423
 			});
424
-			$groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $group) {
424
+			$groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $group) {
425 425
 				\OC_Hook::emit('OC_User', 'post_createGroup', ['gid' => $group->getGID()]);
426 426
 
427 427
 				/** @var IEventDispatcher $dispatcher */
428 428
 				$dispatcher = $this->query(IEventDispatcher::class);
429 429
 				$dispatcher->dispatchTyped(new GroupCreatedEvent($group));
430 430
 			});
431
-			$groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) {
431
+			$groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) {
432 432
 				\OC_Hook::emit('OC_Group', 'pre_deleteGroup', ['run' => true, 'gid' => $group->getGID()]);
433 433
 
434 434
 				/** @var IEventDispatcher $dispatcher */
435 435
 				$dispatcher = $this->query(IEventDispatcher::class);
436 436
 				$dispatcher->dispatchTyped(new BeforeGroupDeletedEvent($group));
437 437
 			});
438
-			$groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) {
438
+			$groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) {
439 439
 				\OC_Hook::emit('OC_User', 'post_deleteGroup', ['gid' => $group->getGID()]);
440 440
 
441 441
 				/** @var IEventDispatcher $dispatcher */
442 442
 				$dispatcher = $this->query(IEventDispatcher::class);
443 443
 				$dispatcher->dispatchTyped(new GroupDeletedEvent($group));
444 444
 			});
445
-			$groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
445
+			$groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) {
446 446
 				\OC_Hook::emit('OC_Group', 'pre_addToGroup', ['run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID()]);
447 447
 
448 448
 				/** @var IEventDispatcher $dispatcher */
449 449
 				$dispatcher = $this->query(IEventDispatcher::class);
450 450
 				$dispatcher->dispatchTyped(new BeforeUserAddedEvent($group, $user));
451 451
 			});
452
-			$groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
452
+			$groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) {
453 453
 				\OC_Hook::emit('OC_Group', 'post_addToGroup', ['uid' => $user->getUID(), 'gid' => $group->getGID()]);
454 454
 				//Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks
455 455
 				\OC_Hook::emit('OC_User', 'post_addToGroup', ['uid' => $user->getUID(), 'gid' => $group->getGID()]);
@@ -458,12 +458,12 @@  discard block
 block discarded – undo
458 458
 				$dispatcher = $this->query(IEventDispatcher::class);
459 459
 				$dispatcher->dispatchTyped(new UserAddedEvent($group, $user));
460 460
 			});
461
-			$groupManager->listen('\OC\Group', 'preRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) {
461
+			$groupManager->listen('\OC\Group', 'preRemoveUser', function(\OC\Group\Group $group, \OC\User\User $user) {
462 462
 				/** @var IEventDispatcher $dispatcher */
463 463
 				$dispatcher = $this->query(IEventDispatcher::class);
464 464
 				$dispatcher->dispatchTyped(new BeforeUserRemovedEvent($group, $user));
465 465
 			});
466
-			$groupManager->listen('\OC\Group', 'postRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) {
466
+			$groupManager->listen('\OC\Group', 'postRemoveUser', function(\OC\Group\Group $group, \OC\User\User $user) {
467 467
 				/** @var IEventDispatcher $dispatcher */
468 468
 				$dispatcher = $this->query(IEventDispatcher::class);
469 469
 				$dispatcher->dispatchTyped(new UserRemovedEvent($group, $user));
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
 		/** @deprecated 19.0.0 */
474 474
 		$this->registerDeprecatedAlias('GroupManager', \OCP\IGroupManager::class);
475 475
 
476
-		$this->registerService(Store::class, function (Server $c) {
476
+		$this->registerService(Store::class, function(Server $c) {
477 477
 			$session = $c->getSession();
478 478
 			if (\OC::$server->getSystemConfig()->getValue('installed', false)) {
479 479
 				$tokenProvider = $c->query(IProvider::class);
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
 		$this->registerAlias(IStore::class, Store::class);
487 487
 		$this->registerAlias(IProvider::class, Authentication\Token\Manager::class);
488 488
 
489
-		$this->registerService(\OC\User\Session::class, function (Server $c) {
489
+		$this->registerService(\OC\User\Session::class, function(Server $c) {
490 490
 			$manager = $c->getUserManager();
491 491
 			$session = new \OC\Session\Memory('');
492 492
 			$timeFactory = new TimeFactory();
@@ -511,14 +511,14 @@  discard block
 block discarded – undo
511 511
 				$c->getLogger(),
512 512
 				$c->query(IEventDispatcher::class)
513 513
 			);
514
-			$userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) {
514
+			$userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) {
515 515
 				\OC_Hook::emit('OC_User', 'pre_createUser', ['run' => true, 'uid' => $uid, 'password' => $password]);
516 516
 
517 517
 				/** @var IEventDispatcher $dispatcher */
518 518
 				$dispatcher = $this->query(IEventDispatcher::class);
519 519
 				$dispatcher->dispatchTyped(new BeforeUserCreatedEvent($uid, $password));
520 520
 			});
521
-			$userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) {
521
+			$userSession->listen('\OC\User', 'postCreateUser', function($user, $password) {
522 522
 				/** @var \OC\User\User $user */
523 523
 				\OC_Hook::emit('OC_User', 'post_createUser', ['uid' => $user->getUID(), 'password' => $password]);
524 524
 
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
 				$dispatcher = $this->query(IEventDispatcher::class);
527 527
 				$dispatcher->dispatchTyped(new UserCreatedEvent($user, $password));
528 528
 			});
529
-			$userSession->listen('\OC\User', 'preDelete', function ($user) use ($legacyDispatcher) {
529
+			$userSession->listen('\OC\User', 'preDelete', function($user) use ($legacyDispatcher) {
530 530
 				/** @var \OC\User\User $user */
531 531
 				\OC_Hook::emit('OC_User', 'pre_deleteUser', ['run' => true, 'uid' => $user->getUID()]);
532 532
 				$legacyDispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user));
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
 				$dispatcher = $this->query(IEventDispatcher::class);
536 536
 				$dispatcher->dispatchTyped(new BeforeUserDeletedEvent($user));
537 537
 			});
538
-			$userSession->listen('\OC\User', 'postDelete', function ($user) {
538
+			$userSession->listen('\OC\User', 'postDelete', function($user) {
539 539
 				/** @var \OC\User\User $user */
540 540
 				\OC_Hook::emit('OC_User', 'post_deleteUser', ['uid' => $user->getUID()]);
541 541
 
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 				$dispatcher = $this->query(IEventDispatcher::class);
544 544
 				$dispatcher->dispatchTyped(new UserDeletedEvent($user));
545 545
 			});
546
-			$userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) {
546
+			$userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) {
547 547
 				/** @var \OC\User\User $user */
548 548
 				\OC_Hook::emit('OC_User', 'pre_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]);
549 549
 
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
 				$dispatcher = $this->query(IEventDispatcher::class);
552 552
 				$dispatcher->dispatchTyped(new BeforePasswordUpdatedEvent($user, $password, $recoveryPassword));
553 553
 			});
554
-			$userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) {
554
+			$userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) {
555 555
 				/** @var \OC\User\User $user */
556 556
 				\OC_Hook::emit('OC_User', 'post_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]);
557 557
 
@@ -559,14 +559,14 @@  discard block
 block discarded – undo
559 559
 				$dispatcher = $this->query(IEventDispatcher::class);
560 560
 				$dispatcher->dispatchTyped(new PasswordUpdatedEvent($user, $password, $recoveryPassword));
561 561
 			});
562
-			$userSession->listen('\OC\User', 'preLogin', function ($uid, $password) {
562
+			$userSession->listen('\OC\User', 'preLogin', function($uid, $password) {
563 563
 				\OC_Hook::emit('OC_User', 'pre_login', ['run' => true, 'uid' => $uid, 'password' => $password]);
564 564
 
565 565
 				/** @var IEventDispatcher $dispatcher */
566 566
 				$dispatcher = $this->query(IEventDispatcher::class);
567 567
 				$dispatcher->dispatchTyped(new BeforeUserLoggedInEvent($uid, $password));
568 568
 			});
569
-			$userSession->listen('\OC\User', 'postLogin', function ($user, $password, $isTokenLogin) {
569
+			$userSession->listen('\OC\User', 'postLogin', function($user, $password, $isTokenLogin) {
570 570
 				/** @var \OC\User\User $user */
571 571
 				\OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'isTokenLogin' => $isTokenLogin]);
572 572
 
@@ -574,12 +574,12 @@  discard block
 block discarded – undo
574 574
 				$dispatcher = $this->query(IEventDispatcher::class);
575 575
 				$dispatcher->dispatchTyped(new UserLoggedInEvent($user, $password, $isTokenLogin));
576 576
 			});
577
-			$userSession->listen('\OC\User', 'preRememberedLogin', function ($uid) {
577
+			$userSession->listen('\OC\User', 'preRememberedLogin', function($uid) {
578 578
 				/** @var IEventDispatcher $dispatcher */
579 579
 				$dispatcher = $this->query(IEventDispatcher::class);
580 580
 				$dispatcher->dispatchTyped(new BeforeUserLoggedInWithCookieEvent($uid));
581 581
 			});
582
-			$userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) {
582
+			$userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) {
583 583
 				/** @var $user \OC\User\User */
584 584
 				\OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'password' => $password]);
585 585
 
@@ -587,19 +587,19 @@  discard block
 block discarded – undo
587 587
 				$dispatcher = $this->query(IEventDispatcher::class);
588 588
 				$dispatcher->dispatchTyped(new UserLoggedInWithCookieEvent($user, $password));
589 589
 			});
590
-			$userSession->listen('\OC\User', 'logout', function ($user) {
590
+			$userSession->listen('\OC\User', 'logout', function($user) {
591 591
 				\OC_Hook::emit('OC_User', 'logout', []);
592 592
 
593 593
 				/** @var IEventDispatcher $dispatcher */
594 594
 				$dispatcher = $this->query(IEventDispatcher::class);
595 595
 				$dispatcher->dispatchTyped(new BeforeUserLoggedOutEvent($user));
596 596
 			});
597
-			$userSession->listen('\OC\User', 'postLogout', function ($user) {
597
+			$userSession->listen('\OC\User', 'postLogout', function($user) {
598 598
 				/** @var IEventDispatcher $dispatcher */
599 599
 				$dispatcher = $this->query(IEventDispatcher::class);
600 600
 				$dispatcher->dispatchTyped(new UserLoggedOutEvent($user));
601 601
 			});
602
-			$userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) {
602
+			$userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) {
603 603
 				/** @var \OC\User\User $user */
604 604
 				\OC_Hook::emit('OC_User', 'changeUser', ['run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue]);
605 605
 
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
 		$this->registerDeprecatedAlias('AllConfig', \OC\AllConfig::class);
624 624
 		$this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class);
625 625
 
626
-		$this->registerService(\OC\SystemConfig::class, function ($c) use ($config) {
626
+		$this->registerService(\OC\SystemConfig::class, function($c) use ($config) {
627 627
 			return new \OC\SystemConfig($config);
628 628
 		});
629 629
 		/** @deprecated 19.0.0 */
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
 		$this->registerDeprecatedAlias('AppConfig', \OC\AppConfig::class);
634 634
 		$this->registerAlias(IAppConfig::class, \OC\AppConfig::class);
635 635
 
636
-		$this->registerService(IFactory::class, function (Server $c) {
636
+		$this->registerService(IFactory::class, function(Server $c) {
637 637
 			return new \OC\L10N\Factory(
638 638
 				$c->getConfig(),
639 639
 				$c->getRequest(),
@@ -644,7 +644,7 @@  discard block
 block discarded – undo
644 644
 		/** @deprecated 19.0.0 */
645 645
 		$this->registerDeprecatedAlias('L10NFactory', IFactory::class);
646 646
 
647
-		$this->registerService(IURLGenerator::class, function (Server $c) {
647
+		$this->registerService(IURLGenerator::class, function(Server $c) {
648 648
 			$config = $c->getConfig();
649 649
 			$cacheFactory = $c->getMemCacheFactory();
650 650
 			$request = $c->getRequest();
@@ -662,13 +662,13 @@  discard block
 block discarded – undo
662 662
 		/** @deprecated 19.0.0 */
663 663
 		$this->registerDeprecatedAlias('CategoryFetcher', CategoryFetcher::class);
664 664
 
665
-		$this->registerService(ICache::class, function ($c) {
665
+		$this->registerService(ICache::class, function($c) {
666 666
 			return new Cache\File();
667 667
 		});
668 668
 		/** @deprecated 19.0.0 */
669 669
 		$this->registerDeprecatedAlias('UserCache', ICache::class);
670 670
 
671
-		$this->registerService(Factory::class, function (Server $c) {
671
+		$this->registerService(Factory::class, function(Server $c) {
672 672
 			$arrayCacheFactory = new \OC\Memcache\Factory('', $c->getLogger(),
673 673
 				ArrayCache::class,
674 674
 				ArrayCache::class,
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
 				$version = implode(',', $v);
683 683
 				$instanceId = \OC_Util::getInstanceId();
684 684
 				$path = \OC::$SERVERROOT;
685
-				$prefix = md5($instanceId . '-' . $version . '-' . $path);
685
+				$prefix = md5($instanceId.'-'.$version.'-'.$path);
686 686
 				return new \OC\Memcache\Factory($prefix, $c->getLogger(),
687 687
 					$config->getSystemValue('memcache.local', null),
688 688
 					$config->getSystemValue('memcache.distributed', null),
@@ -695,12 +695,12 @@  discard block
 block discarded – undo
695 695
 		$this->registerDeprecatedAlias('MemCacheFactory', Factory::class);
696 696
 		$this->registerAlias(ICacheFactory::class, Factory::class);
697 697
 
698
-		$this->registerService('RedisFactory', function (Server $c) {
698
+		$this->registerService('RedisFactory', function(Server $c) {
699 699
 			$systemConfig = $c->getSystemConfig();
700 700
 			return new RedisFactory($systemConfig);
701 701
 		});
702 702
 
703
-		$this->registerService(\OCP\Activity\IManager::class, function (Server $c) {
703
+		$this->registerService(\OCP\Activity\IManager::class, function(Server $c) {
704 704
 			$l10n = $this->get(IFactory::class)->get('activity');
705 705
 			return new \OC\Activity\Manager(
706 706
 				$c->getRequest(),
@@ -713,14 +713,14 @@  discard block
 block discarded – undo
713 713
 		/** @deprecated 19.0.0 */
714 714
 		$this->registerDeprecatedAlias('ActivityManager', \OCP\Activity\IManager::class);
715 715
 
716
-		$this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) {
716
+		$this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) {
717 717
 			return new \OC\Activity\EventMerger(
718 718
 				$c->getL10N('lib')
719 719
 			);
720 720
 		});
721 721
 		$this->registerAlias(IValidator::class, Validator::class);
722 722
 
723
-		$this->registerService(AvatarManager::class, function (Server $c) {
723
+		$this->registerService(AvatarManager::class, function(Server $c) {
724 724
 			return new AvatarManager(
725 725
 				$c->query(\OC\User\Manager::class),
726 726
 				$c->getAppDataDir('avatar'),
@@ -736,7 +736,7 @@  discard block
 block discarded – undo
736 736
 		$this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class);
737 737
 		$this->registerAlias(\OCP\Support\Subscription\IRegistry::class, \OC\Support\Subscription\Registry::class);
738 738
 
739
-		$this->registerService(\OC\Log::class, function (Server $c) {
739
+		$this->registerService(\OC\Log::class, function(Server $c) {
740 740
 			$logType = $c->query(AllConfig::class)->getSystemValue('log_type', 'file');
741 741
 			$factory = new LogFactory($c, $this->getSystemConfig());
742 742
 			$logger = $factory->get($logType);
@@ -750,7 +750,7 @@  discard block
 block discarded – undo
750 750
 		// PSR-3 logger
751 751
 		$this->registerAlias(LoggerInterface::class, PsrLoggerAdapter::class);
752 752
 
753
-		$this->registerService(ILogFactory::class, function (Server $c) {
753
+		$this->registerService(ILogFactory::class, function(Server $c) {
754 754
 			return new LogFactory($c, $this->getSystemConfig());
755 755
 		});
756 756
 
@@ -758,7 +758,7 @@  discard block
 block discarded – undo
758 758
 		/** @deprecated 19.0.0 */
759 759
 		$this->registerDeprecatedAlias('JobList', IJobList::class);
760 760
 
761
-		$this->registerService(IRouter::class, function (Server $c) {
761
+		$this->registerService(IRouter::class, function(Server $c) {
762 762
 			$cacheFactory = $c->getMemCacheFactory();
763 763
 			$logger = $c->getLogger();
764 764
 			if ($cacheFactory->isLocalCacheAvailable()) {
@@ -775,7 +775,7 @@  discard block
 block discarded – undo
775 775
 		/** @deprecated 19.0.0 */
776 776
 		$this->registerDeprecatedAlias('Search', ISearch::class);
777 777
 
778
-		$this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) {
778
+		$this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) {
779 779
 			return new \OC\Security\RateLimiting\Backend\MemoryCache(
780 780
 				$this->getMemCacheFactory(),
781 781
 				new \OC\AppFramework\Utility\TimeFactory()
@@ -798,7 +798,7 @@  discard block
 block discarded – undo
798 798
 		/** @deprecated 19.0.0 */
799 799
 		$this->registerDeprecatedAlias('CredentialsManager', ICredentialsManager::class);
800 800
 
801
-		$this->registerService(IDBConnection::class, function (Server $c) {
801
+		$this->registerService(IDBConnection::class, function(Server $c) {
802 802
 			$systemConfig = $c->getSystemConfig();
803 803
 			$factory = new \OC\DB\ConnectionFactory($systemConfig);
804 804
 			$type = $systemConfig->getValue('dbtype', 'sqlite');
@@ -814,7 +814,7 @@  discard block
 block discarded – undo
814 814
 		$this->registerDeprecatedAlias('DatabaseConnection', IDBConnection::class);
815 815
 
816 816
 
817
-		$this->registerService(IClientService::class, function (Server $c) {
817
+		$this->registerService(IClientService::class, function(Server $c) {
818 818
 			$user = \OC_User::getUser();
819 819
 			$uid = $user ? $user : null;
820 820
 			return new ClientService(
@@ -831,7 +831,7 @@  discard block
 block discarded – undo
831 831
 		});
832 832
 		/** @deprecated 19.0.0 */
833 833
 		$this->registerDeprecatedAlias('HttpClientService', IClientService::class);
834
-		$this->registerService(IEventLogger::class, function (Server $c) {
834
+		$this->registerService(IEventLogger::class, function(Server $c) {
835 835
 			$eventLogger = new EventLogger();
836 836
 			if ($c->getSystemConfig()->getValue('debug', false)) {
837 837
 				// In debug mode, module is being activated by default
@@ -842,7 +842,7 @@  discard block
 block discarded – undo
842 842
 		/** @deprecated 19.0.0 */
843 843
 		$this->registerDeprecatedAlias('EventLogger', IEventLogger::class);
844 844
 
845
-		$this->registerService(IQueryLogger::class, function (Server $c) {
845
+		$this->registerService(IQueryLogger::class, function(Server $c) {
846 846
 			$queryLogger = new QueryLogger();
847 847
 			if ($c->getSystemConfig()->getValue('debug', false)) {
848 848
 				// In debug mode, module is being activated by default
@@ -857,7 +857,7 @@  discard block
 block discarded – undo
857 857
 		$this->registerDeprecatedAlias('TempManager', TempManager::class);
858 858
 		$this->registerAlias(ITempManager::class, TempManager::class);
859 859
 
860
-		$this->registerService(AppManager::class, function (Server $c) {
860
+		$this->registerService(AppManager::class, function(Server $c) {
861 861
 			return new \OC\App\AppManager(
862 862
 				$c->getUserSession(),
863 863
 				$c->getConfig(),
@@ -876,7 +876,7 @@  discard block
 block discarded – undo
876 876
 		/** @deprecated 19.0.0 */
877 877
 		$this->registerDeprecatedAlias('DateTimeZone', IDateTimeZone::class);
878 878
 
879
-		$this->registerService(IDateTimeFormatter::class, function (Server $c) {
879
+		$this->registerService(IDateTimeFormatter::class, function(Server $c) {
880 880
 			$language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null);
881 881
 
882 882
 			return new DateTimeFormatter(
@@ -887,7 +887,7 @@  discard block
 block discarded – undo
887 887
 		/** @deprecated 19.0.0 */
888 888
 		$this->registerDeprecatedAlias('DateTimeFormatter', IDateTimeFormatter::class);
889 889
 
890
-		$this->registerService(IUserMountCache::class, function (Server $c) {
890
+		$this->registerService(IUserMountCache::class, function(Server $c) {
891 891
 			$mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger());
892 892
 			$listener = new UserMountCacheListener($mountCache);
893 893
 			$listener->listen($c->getUserManager());
@@ -896,7 +896,7 @@  discard block
 block discarded – undo
896 896
 		/** @deprecated 19.0.0 */
897 897
 		$this->registerDeprecatedAlias('UserMountCache', IUserMountCache::class);
898 898
 
899
-		$this->registerService(IMountProviderCollection::class, function (Server $c) {
899
+		$this->registerService(IMountProviderCollection::class, function(Server $c) {
900 900
 			$loader = \OC\Files\Filesystem::getLoader();
901 901
 			$mountCache = $c->query(IUserMountCache::class);
902 902
 			$manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache);
@@ -917,7 +917,7 @@  discard block
 block discarded – undo
917 917
 
918 918
 		/** @deprecated 20.0.0 */
919 919
 		$this->registerDeprecatedAlias('IniWrapper', IniGetWrapper::class);
920
-		$this->registerService('AsyncCommandBus', function (Server $c) {
920
+		$this->registerService('AsyncCommandBus', function(Server $c) {
921 921
 			$busClass = $c->getConfig()->getSystemValue('commandbus');
922 922
 			if ($busClass) {
923 923
 				[$app, $class] = explode('::', $busClass, 2);
@@ -937,7 +937,7 @@  discard block
 block discarded – undo
937 937
 		$this->registerDeprecatedAlias('TrustedDomainHelper', TrustedDomainHelper::class);
938 938
 		/** @deprecated 19.0.0 */
939 939
 		$this->registerDeprecatedAlias('Throttler', Throttler::class);
940
-		$this->registerService('IntegrityCodeChecker', function (Server $c) {
940
+		$this->registerService('IntegrityCodeChecker', function(Server $c) {
941 941
 			// IConfig and IAppManager requires a working database. This code
942 942
 			// might however be called when ownCloud is not yet setup.
943 943
 			if (\OC::$server->getSystemConfig()->getValue('installed', false)) {
@@ -959,7 +959,7 @@  discard block
 block discarded – undo
959 959
 				$c->getMimeTypeDetector()
960 960
 			);
961 961
 		});
962
-		$this->registerService(\OCP\IRequest::class, function ($c) {
962
+		$this->registerService(\OCP\IRequest::class, function($c) {
963 963
 			if (isset($this['urlParams'])) {
964 964
 				$urlParams = $this['urlParams'];
965 965
 			} else {
@@ -996,7 +996,7 @@  discard block
 block discarded – undo
996 996
 		/** @deprecated 19.0.0 */
997 997
 		$this->registerDeprecatedAlias('Request', \OCP\IRequest::class);
998 998
 
999
-		$this->registerService(IMailer::class, function (Server $c) {
999
+		$this->registerService(IMailer::class, function(Server $c) {
1000 1000
 			return new Mailer(
1001 1001
 				$c->getConfig(),
1002 1002
 				$c->getLogger(),
@@ -1010,7 +1010,7 @@  discard block
 block discarded – undo
1010 1010
 		/** @deprecated 19.0.0 */
1011 1011
 		$this->registerDeprecatedAlias('Mailer', IMailer::class);
1012 1012
 
1013
-		$this->registerService('LDAPProvider', function (Server $c) {
1013
+		$this->registerService('LDAPProvider', function(Server $c) {
1014 1014
 			$config = $c->getConfig();
1015 1015
 			$factoryClass = $config->getSystemValue('ldapProviderFactory', null);
1016 1016
 			if (is_null($factoryClass)) {
@@ -1020,7 +1020,7 @@  discard block
 block discarded – undo
1020 1020
 			$factory = new $factoryClass($this);
1021 1021
 			return $factory->getLDAPProvider();
1022 1022
 		});
1023
-		$this->registerService(ILockingProvider::class, function (Server $c) {
1023
+		$this->registerService(ILockingProvider::class, function(Server $c) {
1024 1024
 			$ini = $c->getIniWrapper();
1025 1025
 			$config = $c->getConfig();
1026 1026
 			$ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time')));
@@ -1048,12 +1048,12 @@  discard block
 block discarded – undo
1048 1048
 		/** @deprecated 19.0.0 */
1049 1049
 		$this->registerDeprecatedAlias('MountManager', IMountManager::class);
1050 1050
 
1051
-		$this->registerService(IMimeTypeDetector::class, function (Server $c) {
1051
+		$this->registerService(IMimeTypeDetector::class, function(Server $c) {
1052 1052
 			return new \OC\Files\Type\Detection(
1053 1053
 				$c->getURLGenerator(),
1054 1054
 				$c->getLogger(),
1055 1055
 				\OC::$configDir,
1056
-				\OC::$SERVERROOT . '/resources/config/'
1056
+				\OC::$SERVERROOT.'/resources/config/'
1057 1057
 			);
1058 1058
 		});
1059 1059
 		/** @deprecated 19.0.0 */
@@ -1062,19 +1062,19 @@  discard block
 block discarded – undo
1062 1062
 		$this->registerAlias(IMimeTypeLoader::class, Loader::class);
1063 1063
 		/** @deprecated 19.0.0 */
1064 1064
 		$this->registerDeprecatedAlias('MimeTypeLoader', IMimeTypeLoader::class);
1065
-		$this->registerService(BundleFetcher::class, function () {
1065
+		$this->registerService(BundleFetcher::class, function() {
1066 1066
 			return new BundleFetcher($this->getL10N('lib'));
1067 1067
 		});
1068 1068
 		$this->registerAlias(\OCP\Notification\IManager::class, Manager::class);
1069 1069
 		/** @deprecated 19.0.0 */
1070 1070
 		$this->registerDeprecatedAlias('NotificationManager', \OCP\Notification\IManager::class);
1071 1071
 
1072
-		$this->registerService(CapabilitiesManager::class, function (Server $c) {
1072
+		$this->registerService(CapabilitiesManager::class, function(Server $c) {
1073 1073
 			$manager = new CapabilitiesManager($c->getLogger());
1074
-			$manager->registerCapability(function () use ($c) {
1074
+			$manager->registerCapability(function() use ($c) {
1075 1075
 				return new \OC\OCS\CoreCapabilities($c->getConfig());
1076 1076
 			});
1077
-			$manager->registerCapability(function () use ($c) {
1077
+			$manager->registerCapability(function() use ($c) {
1078 1078
 				return $c->query(\OC\Security\Bruteforce\Capabilities::class);
1079 1079
 			});
1080 1080
 			return $manager;
@@ -1082,14 +1082,14 @@  discard block
 block discarded – undo
1082 1082
 		/** @deprecated 19.0.0 */
1083 1083
 		$this->registerDeprecatedAlias('CapabilitiesManager', CapabilitiesManager::class);
1084 1084
 
1085
-		$this->registerService(ICommentsManager::class, function (Server $c) {
1085
+		$this->registerService(ICommentsManager::class, function(Server $c) {
1086 1086
 			$config = $c->getConfig();
1087 1087
 			$factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class);
1088 1088
 			/** @var \OCP\Comments\ICommentsManagerFactory $factory */
1089 1089
 			$factory = new $factoryClass($this);
1090 1090
 			$manager = $factory->getManager();
1091 1091
 
1092
-			$manager->registerDisplayNameResolver('user', function ($id) use ($c) {
1092
+			$manager->registerDisplayNameResolver('user', function($id) use ($c) {
1093 1093
 				$manager = $c->getUserManager();
1094 1094
 				$user = $manager->get($id);
1095 1095
 				if (is_null($user)) {
@@ -1107,7 +1107,7 @@  discard block
 block discarded – undo
1107 1107
 		$this->registerDeprecatedAlias('CommentsManager', ICommentsManager::class);
1108 1108
 
1109 1109
 		$this->registerAlias(\OC_Defaults::class, 'ThemingDefaults');
1110
-		$this->registerService('ThemingDefaults', function (Server $c) {
1110
+		$this->registerService('ThemingDefaults', function(Server $c) {
1111 1111
 			/*
1112 1112
 			 * Dark magic for autoloader.
1113 1113
 			 * If we do a class_exists it will try to load the class which will
@@ -1135,7 +1135,7 @@  discard block
 block discarded – undo
1135 1135
 			}
1136 1136
 			return new \OC_Defaults();
1137 1137
 		});
1138
-		$this->registerService(JSCombiner::class, function (Server $c) {
1138
+		$this->registerService(JSCombiner::class, function(Server $c) {
1139 1139
 			return new JSCombiner(
1140 1140
 				$c->getAppDataDir('js'),
1141 1141
 				$c->getURLGenerator(),
@@ -1149,7 +1149,7 @@  discard block
 block discarded – undo
1149 1149
 		$this->registerDeprecatedAlias('EventDispatcher', \OC\EventDispatcher\SymfonyAdapter::class);
1150 1150
 		$this->registerAlias(EventDispatcherInterface::class, \OC\EventDispatcher\SymfonyAdapter::class);
1151 1151
 
1152
-		$this->registerService('CryptoWrapper', function (Server $c) {
1152
+		$this->registerService('CryptoWrapper', function(Server $c) {
1153 1153
 			// FIXME: Instantiiated here due to cyclic dependency
1154 1154
 			$request = new Request(
1155 1155
 				[
@@ -1176,14 +1176,14 @@  discard block
 block discarded – undo
1176 1176
 		});
1177 1177
 		/** @deprecated 19.0.0 */
1178 1178
 		$this->registerDeprecatedAlias('CsrfTokenManager', CsrfTokenManager::class);
1179
-		$this->registerService(SessionStorage::class, function (Server $c) {
1179
+		$this->registerService(SessionStorage::class, function(Server $c) {
1180 1180
 			return new SessionStorage($c->getSession());
1181 1181
 		});
1182 1182
 		$this->registerAlias(\OCP\Security\IContentSecurityPolicyManager::class, ContentSecurityPolicyManager::class);
1183 1183
 		/** @deprecated 19.0.0 */
1184 1184
 		$this->registerDeprecatedAlias('ContentSecurityPolicyManager', ContentSecurityPolicyManager::class);
1185 1185
 
1186
-		$this->registerService(\OCP\Share\IManager::class, function (Server $c) {
1186
+		$this->registerService(\OCP\Share\IManager::class, function(Server $c) {
1187 1187
 			$config = $c->getConfig();
1188 1188
 			$factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class);
1189 1189
 			/** @var \OCP\Share\IProviderFactory $factory */
@@ -1213,7 +1213,7 @@  discard block
 block discarded – undo
1213 1213
 		/** @deprecated 19.0.0 */
1214 1214
 		$this->registerDeprecatedAlias('ShareManager', \OCP\Share\IManager::class);
1215 1215
 
1216
-		$this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function (Server $c) {
1216
+		$this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function(Server $c) {
1217 1217
 			$instance = new Collaboration\Collaborators\Search($c);
1218 1218
 
1219 1219
 			// register default plugins
@@ -1234,7 +1234,7 @@  discard block
 block discarded – undo
1234 1234
 		$this->registerAlias(\OCP\Collaboration\Resources\IProviderManager::class, \OC\Collaboration\Resources\ProviderManager::class);
1235 1235
 		$this->registerAlias(\OCP\Collaboration\Resources\IManager::class, \OC\Collaboration\Resources\Manager::class);
1236 1236
 
1237
-		$this->registerService('SettingsManager', function (Server $c) {
1237
+		$this->registerService('SettingsManager', function(Server $c) {
1238 1238
 			$manager = new \OC\Settings\Manager(
1239 1239
 				$c->getLogger(),
1240 1240
 				$c->getL10NFactory(),
@@ -1243,34 +1243,34 @@  discard block
 block discarded – undo
1243 1243
 			);
1244 1244
 			return $manager;
1245 1245
 		});
1246
-		$this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) {
1246
+		$this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) {
1247 1247
 			return new \OC\Files\AppData\Factory(
1248 1248
 				$c->getRootFolder(),
1249 1249
 				$c->getSystemConfig()
1250 1250
 			);
1251 1251
 		});
1252 1252
 
1253
-		$this->registerService('LockdownManager', function (Server $c) {
1254
-			return new LockdownManager(function () use ($c) {
1253
+		$this->registerService('LockdownManager', function(Server $c) {
1254
+			return new LockdownManager(function() use ($c) {
1255 1255
 				return $c->getSession();
1256 1256
 			});
1257 1257
 		});
1258 1258
 
1259
-		$this->registerService(\OCP\OCS\IDiscoveryService::class, function (Server $c) {
1259
+		$this->registerService(\OCP\OCS\IDiscoveryService::class, function(Server $c) {
1260 1260
 			return new DiscoveryService($c->getMemCacheFactory(), $c->getHTTPClientService());
1261 1261
 		});
1262 1262
 
1263
-		$this->registerService(ICloudIdManager::class, function (Server $c) {
1263
+		$this->registerService(ICloudIdManager::class, function(Server $c) {
1264 1264
 			return new CloudIdManager();
1265 1265
 		});
1266 1266
 
1267 1267
 		$this->registerAlias(\OCP\GlobalScale\IConfig::class, \OC\GlobalScale\Config::class);
1268 1268
 
1269
-		$this->registerService(ICloudFederationProviderManager::class, function (Server $c) {
1269
+		$this->registerService(ICloudFederationProviderManager::class, function(Server $c) {
1270 1270
 			return new CloudFederationProviderManager($c->getAppManager(), $c->getHTTPClientService(), $c->getCloudIdManager(), $c->getLogger());
1271 1271
 		});
1272 1272
 
1273
-		$this->registerService(ICloudFederationFactory::class, function (Server $c) {
1273
+		$this->registerService(ICloudFederationFactory::class, function(Server $c) {
1274 1274
 			return new CloudFederationFactory();
1275 1275
 		});
1276 1276
 
@@ -1282,7 +1282,7 @@  discard block
 block discarded – undo
1282 1282
 		/** @deprecated 19.0.0 */
1283 1283
 		$this->registerDeprecatedAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class);
1284 1284
 
1285
-		$this->registerService(Defaults::class, function (Server $c) {
1285
+		$this->registerService(Defaults::class, function(Server $c) {
1286 1286
 			return new Defaults(
1287 1287
 				$c->getThemingDefaults()
1288 1288
 			);
@@ -1290,17 +1290,17 @@  discard block
 block discarded – undo
1290 1290
 		/** @deprecated 19.0.0 */
1291 1291
 		$this->registerDeprecatedAlias('Defaults', \OCP\Defaults::class);
1292 1292
 
1293
-		$this->registerService(\OCP\ISession::class, function (SimpleContainer $c) {
1293
+		$this->registerService(\OCP\ISession::class, function(SimpleContainer $c) {
1294 1294
 			return $c->query(\OCP\IUserSession::class)->getSession();
1295 1295
 		});
1296 1296
 
1297
-		$this->registerService(IShareHelper::class, function (Server $c) {
1297
+		$this->registerService(IShareHelper::class, function(Server $c) {
1298 1298
 			return new ShareHelper(
1299 1299
 				$c->query(\OCP\Share\IManager::class)
1300 1300
 			);
1301 1301
 		});
1302 1302
 
1303
-		$this->registerService(Installer::class, function (Server $c) {
1303
+		$this->registerService(Installer::class, function(Server $c) {
1304 1304
 			return new Installer(
1305 1305
 				$c->getAppFetcher(),
1306 1306
 				$c->getHTTPClientService(),
@@ -1311,11 +1311,11 @@  discard block
 block discarded – undo
1311 1311
 			);
1312 1312
 		});
1313 1313
 
1314
-		$this->registerService(IApiFactory::class, function (Server $c) {
1314
+		$this->registerService(IApiFactory::class, function(Server $c) {
1315 1315
 			return new ApiFactory($c->getHTTPClientService());
1316 1316
 		});
1317 1317
 
1318
-		$this->registerService(IInstanceFactory::class, function (Server $c) {
1318
+		$this->registerService(IInstanceFactory::class, function(Server $c) {
1319 1319
 			$memcacheFactory = $c->getMemCacheFactory();
1320 1320
 			return new InstanceFactory($memcacheFactory->createLocal('remoteinstance.'), $c->getHTTPClientService());
1321 1321
 		});
@@ -1372,7 +1372,7 @@  discard block
 block discarded – undo
1372 1372
 		$dispatcher = $this->getEventDispatcher();
1373 1373
 
1374 1374
 		// Delete avatar on user deletion
1375
-		$dispatcher->addListener('OCP\IUser::preDelete', function (GenericEvent $e) {
1375
+		$dispatcher->addListener('OCP\IUser::preDelete', function(GenericEvent $e) {
1376 1376
 			$logger = $this->getLogger();
1377 1377
 			$manager = $this->getAvatarManager();
1378 1378
 			/** @var IUser $user */
@@ -1385,11 +1385,11 @@  discard block
 block discarded – undo
1385 1385
 				// no avatar to remove
1386 1386
 			} catch (\Exception $e) {
1387 1387
 				// Ignore exceptions
1388
-				$logger->info('Could not cleanup avatar of ' . $user->getUID());
1388
+				$logger->info('Could not cleanup avatar of '.$user->getUID());
1389 1389
 			}
1390 1390
 		});
1391 1391
 
1392
-		$dispatcher->addListener('OCP\IUser::changeUser', function (GenericEvent $e) {
1392
+		$dispatcher->addListener('OCP\IUser::changeUser', function(GenericEvent $e) {
1393 1393
 			$manager = $this->getAvatarManager();
1394 1394
 			/** @var IUser $user */
1395 1395
 			$user = $e->getSubject();
@@ -2294,11 +2294,11 @@  discard block
 block discarded – undo
2294 2294
 	}
2295 2295
 
2296 2296
 	private function registerDeprecatedAlias(string $alias, string $target) {
2297
-		$this->registerService($alias, function (ContainerInterface $container) use ($target, $alias) {
2297
+		$this->registerService($alias, function(ContainerInterface $container) use ($target, $alias) {
2298 2298
 			try {
2299 2299
 				/** @var ILogger $logger */
2300 2300
 				$logger = $container->get(ILogger::class);
2301
-				$logger->debug('The requested alias "' . $alias . '" is depreacted. Please request "' . $target . '" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']);
2301
+				$logger->debug('The requested alias "'.$alias.'" is depreacted. Please request "'.$target.'" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']);
2302 2302
 			} catch (ContainerExceptionInterface $e) {
2303 2303
 				// Could not get logger. Continue
2304 2304
 			}
Please login to merge, or discard this patch.