Passed
Push — master ( e39d65...61496d )
by Julius
12:40 queued 10s
created
lib/private/Server.php 1 patch
Spacing   +96 added lines, -96 removed lines patch added patch discarded remove patch
@@ -261,10 +261,10 @@  discard block
 block discarded – undo
261 261
 		$this->registerParameter('isCLI', \OC::$CLI);
262 262
 		$this->registerParameter('serverRoot', \OC::$SERVERROOT);
263 263
 
264
-		$this->registerService(ContainerInterface::class, function (ContainerInterface $c) {
264
+		$this->registerService(ContainerInterface::class, function(ContainerInterface $c) {
265 265
 			return $c;
266 266
 		});
267
-		$this->registerService(\OCP\IServerContainer::class, function (ContainerInterface $c) {
267
+		$this->registerService(\OCP\IServerContainer::class, function(ContainerInterface $c) {
268 268
 			return $c;
269 269
 		});
270 270
 
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 		$this->registerAlias(IActionFactory::class, ActionFactory::class);
290 290
 
291 291
 
292
-		$this->registerService(IPreview::class, function (ContainerInterface $c) {
292
+		$this->registerService(IPreview::class, function(ContainerInterface $c) {
293 293
 			return new PreviewManager(
294 294
 				$c->get(\OCP\IConfig::class),
295 295
 				$c->get(IRootFolder::class),
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 		/** @deprecated 19.0.0 */
306 306
 		$this->registerDeprecatedAlias('PreviewManager', IPreview::class);
307 307
 
308
-		$this->registerService(\OC\Preview\Watcher::class, function (ContainerInterface $c) {
308
+		$this->registerService(\OC\Preview\Watcher::class, function(ContainerInterface $c) {
309 309
 			return new \OC\Preview\Watcher(
310 310
 				new \OC\Preview\Storage\Root(
311 311
 					$c->get(IRootFolder::class),
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 			);
315 315
 		});
316 316
 
317
-		$this->registerService(\OCP\Encryption\IManager::class, function (Server $c) {
317
+		$this->registerService(\OCP\Encryption\IManager::class, function(Server $c) {
318 318
 			$view = new View();
319 319
 			$util = new Encryption\Util(
320 320
 				$view,
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 		/** @deprecated 19.0.0 */
335 335
 		$this->registerDeprecatedAlias('EncryptionManager', \OCP\Encryption\IManager::class);
336 336
 
337
-		$this->registerService('EncryptionFileHelper', function (ContainerInterface $c) {
337
+		$this->registerService('EncryptionFileHelper', function(ContainerInterface $c) {
338 338
 			$util = new Encryption\Util(
339 339
 				new View(),
340 340
 				$c->get(IUserManager::class),
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 			);
349 349
 		});
350 350
 
351
-		$this->registerService('EncryptionKeyStorage', function (ContainerInterface $c) {
351
+		$this->registerService('EncryptionKeyStorage', function(ContainerInterface $c) {
352 352
 			$view = new View();
353 353
 			$util = new Encryption\Util(
354 354
 				$view,
@@ -371,22 +371,22 @@  discard block
 block discarded – undo
371 371
 		/** @deprecated 19.0.0 */
372 372
 		$this->registerDeprecatedAlias('TagManager', \OCP\ITagManager::class);
373 373
 
374
-		$this->registerService('SystemTagManagerFactory', function (ContainerInterface $c) {
374
+		$this->registerService('SystemTagManagerFactory', function(ContainerInterface $c) {
375 375
 			/** @var \OCP\IConfig $config */
376 376
 			$config = $c->get(\OCP\IConfig::class);
377 377
 			$factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class);
378 378
 			return new $factoryClass($this);
379 379
 		});
380
-		$this->registerService(ISystemTagManager::class, function (ContainerInterface $c) {
380
+		$this->registerService(ISystemTagManager::class, function(ContainerInterface $c) {
381 381
 			return $c->get('SystemTagManagerFactory')->getManager();
382 382
 		});
383 383
 		/** @deprecated 19.0.0 */
384 384
 		$this->registerDeprecatedAlias('SystemTagManager', ISystemTagManager::class);
385 385
 
386
-		$this->registerService(ISystemTagObjectMapper::class, function (ContainerInterface $c) {
386
+		$this->registerService(ISystemTagObjectMapper::class, function(ContainerInterface $c) {
387 387
 			return $c->get('SystemTagManagerFactory')->getObjectMapper();
388 388
 		});
389
-		$this->registerService('RootFolder', function (ContainerInterface $c) {
389
+		$this->registerService('RootFolder', function(ContainerInterface $c) {
390 390
 			$manager = \OC\Files\Filesystem::getMountManager(null);
391 391
 			$view = new View();
392 392
 			$root = new Root(
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 
407 407
 			return $root;
408 408
 		});
409
-		$this->registerService(HookConnector::class, function (ContainerInterface $c) {
409
+		$this->registerService(HookConnector::class, function(ContainerInterface $c) {
410 410
 			return new HookConnector(
411 411
 				$c->get(IRootFolder::class),
412 412
 				new View(),
@@ -418,8 +418,8 @@  discard block
 block discarded – undo
418 418
 		/** @deprecated 19.0.0 */
419 419
 		$this->registerDeprecatedAlias('SystemTagObjectMapper', ISystemTagObjectMapper::class);
420 420
 
421
-		$this->registerService(IRootFolder::class, function (ContainerInterface $c) {
422
-			return new LazyRoot(function () use ($c) {
421
+		$this->registerService(IRootFolder::class, function(ContainerInterface $c) {
422
+			return new LazyRoot(function() use ($c) {
423 423
 				return $c->get('RootFolder');
424 424
 			});
425 425
 		});
@@ -430,44 +430,44 @@  discard block
 block discarded – undo
430 430
 		$this->registerDeprecatedAlias('UserManager', \OC\User\Manager::class);
431 431
 		$this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class);
432 432
 
433
-		$this->registerService(\OCP\IGroupManager::class, function (ContainerInterface $c) {
433
+		$this->registerService(\OCP\IGroupManager::class, function(ContainerInterface $c) {
434 434
 			$groupManager = new \OC\Group\Manager($this->get(IUserManager::class), $c->get(SymfonyAdapter::class), $this->get(ILogger::class));
435
-			$groupManager->listen('\OC\Group', 'preCreate', function ($gid) {
435
+			$groupManager->listen('\OC\Group', 'preCreate', function($gid) {
436 436
 				/** @var IEventDispatcher $dispatcher */
437 437
 				$dispatcher = $this->get(IEventDispatcher::class);
438 438
 				$dispatcher->dispatchTyped(new BeforeGroupCreatedEvent($gid));
439 439
 			});
440
-			$groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $group) {
440
+			$groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $group) {
441 441
 				/** @var IEventDispatcher $dispatcher */
442 442
 				$dispatcher = $this->get(IEventDispatcher::class);
443 443
 				$dispatcher->dispatchTyped(new GroupCreatedEvent($group));
444 444
 			});
445
-			$groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) {
445
+			$groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) {
446 446
 				/** @var IEventDispatcher $dispatcher */
447 447
 				$dispatcher = $this->get(IEventDispatcher::class);
448 448
 				$dispatcher->dispatchTyped(new BeforeGroupDeletedEvent($group));
449 449
 			});
450
-			$groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) {
450
+			$groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) {
451 451
 				/** @var IEventDispatcher $dispatcher */
452 452
 				$dispatcher = $this->get(IEventDispatcher::class);
453 453
 				$dispatcher->dispatchTyped(new GroupDeletedEvent($group));
454 454
 			});
455
-			$groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
455
+			$groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) {
456 456
 				/** @var IEventDispatcher $dispatcher */
457 457
 				$dispatcher = $this->get(IEventDispatcher::class);
458 458
 				$dispatcher->dispatchTyped(new BeforeUserAddedEvent($group, $user));
459 459
 			});
460
-			$groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
460
+			$groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) {
461 461
 				/** @var IEventDispatcher $dispatcher */
462 462
 				$dispatcher = $this->get(IEventDispatcher::class);
463 463
 				$dispatcher->dispatchTyped(new UserAddedEvent($group, $user));
464 464
 			});
465
-			$groupManager->listen('\OC\Group', 'preRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) {
465
+			$groupManager->listen('\OC\Group', 'preRemoveUser', function(\OC\Group\Group $group, \OC\User\User $user) {
466 466
 				/** @var IEventDispatcher $dispatcher */
467 467
 				$dispatcher = $this->get(IEventDispatcher::class);
468 468
 				$dispatcher->dispatchTyped(new BeforeUserRemovedEvent($group, $user));
469 469
 			});
470
-			$groupManager->listen('\OC\Group', 'postRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) {
470
+			$groupManager->listen('\OC\Group', 'postRemoveUser', function(\OC\Group\Group $group, \OC\User\User $user) {
471 471
 				/** @var IEventDispatcher $dispatcher */
472 472
 				$dispatcher = $this->get(IEventDispatcher::class);
473 473
 				$dispatcher->dispatchTyped(new UserRemovedEvent($group, $user));
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
 		/** @deprecated 19.0.0 */
478 478
 		$this->registerDeprecatedAlias('GroupManager', \OCP\IGroupManager::class);
479 479
 
480
-		$this->registerService(Store::class, function (ContainerInterface $c) {
480
+		$this->registerService(Store::class, function(ContainerInterface $c) {
481 481
 			$session = $c->get(ISession::class);
482 482
 			if (\OC::$server->get(SystemConfig::class)->getValue('installed', false)) {
483 483
 				$tokenProvider = $c->get(IProvider::class);
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 		$this->registerAlias(IStore::class, Store::class);
491 491
 		$this->registerAlias(IProvider::class, Authentication\Token\Manager::class);
492 492
 
493
-		$this->registerService(\OC\User\Session::class, function (Server $c) {
493
+		$this->registerService(\OC\User\Session::class, function(Server $c) {
494 494
 			$manager = $c->get(IUserManager::class);
495 495
 			$session = new \OC\Session\Memory('');
496 496
 			$timeFactory = new TimeFactory();
@@ -515,18 +515,18 @@  discard block
 block discarded – undo
515 515
 				$c->get(ILogger::class),
516 516
 				$c->get(IEventDispatcher::class)
517 517
 			);
518
-			$userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) {
518
+			$userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) {
519 519
 				\OC_Hook::emit('OC_User', 'pre_createUser', ['run' => true, 'uid' => $uid, 'password' => $password]);
520 520
 
521 521
 				/** @var IEventDispatcher $dispatcher */
522 522
 				$dispatcher = $this->get(IEventDispatcher::class);
523 523
 				$dispatcher->dispatchTyped(new BeforeUserCreatedEvent($uid, $password));
524 524
 			});
525
-			$userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) {
525
+			$userSession->listen('\OC\User', 'postCreateUser', function($user, $password) {
526 526
 				/** @var \OC\User\User $user */
527 527
 				\OC_Hook::emit('OC_User', 'post_createUser', ['uid' => $user->getUID(), 'password' => $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->get(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->get(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->get(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->get(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->get(IEventDispatcher::class);
567 567
 				$dispatcher->dispatchTyped(new BeforeUserLoggedInEvent($uid, $password));
568 568
 			});
569
-			$userSession->listen('\OC\User', 'postLogin', function ($user, $loginName, $password, $isTokenLogin) {
569
+			$userSession->listen('\OC\User', 'postLogin', function($user, $loginName, $password, $isTokenLogin) {
570 570
 				/** @var \OC\User\User $user */
571 571
 				\OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'loginName' => $loginName, 'password' => $password, 'isTokenLogin' => $isTokenLogin]);
572 572
 
@@ -574,12 +574,12 @@  discard block
 block discarded – undo
574 574
 				$dispatcher = $this->get(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->get(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 \OC\User\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->get(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->get(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->get(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->get(\OCP\IConfig::class),
639 639
 				$c->getRequest(),
@@ -653,13 +653,13 @@  discard block
 block discarded – undo
653 653
 		/** @deprecated 19.0.0 */
654 654
 		$this->registerDeprecatedAlias('CategoryFetcher', CategoryFetcher::class);
655 655
 
656
-		$this->registerService(ICache::class, function ($c) {
656
+		$this->registerService(ICache::class, function($c) {
657 657
 			return new Cache\File();
658 658
 		});
659 659
 		/** @deprecated 19.0.0 */
660 660
 		$this->registerDeprecatedAlias('UserCache', ICache::class);
661 661
 
662
-		$this->registerService(Factory::class, function (Server $c) {
662
+		$this->registerService(Factory::class, function(Server $c) {
663 663
 			$arrayCacheFactory = new \OC\Memcache\Factory('', $c->get(ILogger::class),
664 664
 				ArrayCache::class,
665 665
 				ArrayCache::class,
@@ -674,7 +674,7 @@  discard block
 block discarded – undo
674 674
 				$version = implode(',', $v);
675 675
 				$instanceId = \OC_Util::getInstanceId();
676 676
 				$path = \OC::$SERVERROOT;
677
-				$prefix = md5($instanceId . '-' . $version . '-' . $path);
677
+				$prefix = md5($instanceId.'-'.$version.'-'.$path);
678 678
 				return new \OC\Memcache\Factory($prefix, $c->get(ILogger::class),
679 679
 					$config->getSystemValue('memcache.local', null),
680 680
 					$config->getSystemValue('memcache.distributed', null),
@@ -687,12 +687,12 @@  discard block
 block discarded – undo
687 687
 		$this->registerDeprecatedAlias('MemCacheFactory', Factory::class);
688 688
 		$this->registerAlias(ICacheFactory::class, Factory::class);
689 689
 
690
-		$this->registerService('RedisFactory', function (Server $c) {
690
+		$this->registerService('RedisFactory', function(Server $c) {
691 691
 			$systemConfig = $c->get(SystemConfig::class);
692 692
 			return new RedisFactory($systemConfig);
693 693
 		});
694 694
 
695
-		$this->registerService(\OCP\Activity\IManager::class, function (Server $c) {
695
+		$this->registerService(\OCP\Activity\IManager::class, function(Server $c) {
696 696
 			$l10n = $this->get(IFactory::class)->get('lib');
697 697
 			return new \OC\Activity\Manager(
698 698
 				$c->getRequest(),
@@ -705,14 +705,14 @@  discard block
 block discarded – undo
705 705
 		/** @deprecated 19.0.0 */
706 706
 		$this->registerDeprecatedAlias('ActivityManager', \OCP\Activity\IManager::class);
707 707
 
708
-		$this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) {
708
+		$this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) {
709 709
 			return new \OC\Activity\EventMerger(
710 710
 				$c->getL10N('lib')
711 711
 			);
712 712
 		});
713 713
 		$this->registerAlias(IValidator::class, Validator::class);
714 714
 
715
-		$this->registerService(AvatarManager::class, function (Server $c) {
715
+		$this->registerService(AvatarManager::class, function(Server $c) {
716 716
 			return new AvatarManager(
717 717
 				$c->get(\OC\User\Manager::class),
718 718
 				$c->getAppDataDir('avatar'),
@@ -728,7 +728,7 @@  discard block
 block discarded – undo
728 728
 		$this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class);
729 729
 		$this->registerAlias(\OCP\Support\Subscription\IRegistry::class, \OC\Support\Subscription\Registry::class);
730 730
 
731
-		$this->registerService(\OC\Log::class, function (Server $c) {
731
+		$this->registerService(\OC\Log::class, function(Server $c) {
732 732
 			$logType = $c->get(AllConfig::class)->getSystemValue('log_type', 'file');
733 733
 			$factory = new LogFactory($c, $this->get(SystemConfig::class));
734 734
 			$logger = $factory->get($logType);
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
 		// PSR-3 logger
743 743
 		$this->registerAlias(LoggerInterface::class, PsrLoggerAdapter::class);
744 744
 
745
-		$this->registerService(ILogFactory::class, function (Server $c) {
745
+		$this->registerService(ILogFactory::class, function(Server $c) {
746 746
 			return new LogFactory($c, $this->get(SystemConfig::class));
747 747
 		});
748 748
 
@@ -750,7 +750,7 @@  discard block
 block discarded – undo
750 750
 		/** @deprecated 19.0.0 */
751 751
 		$this->registerDeprecatedAlias('JobList', IJobList::class);
752 752
 
753
-		$this->registerService(IRouter::class, function (Server $c) {
753
+		$this->registerService(IRouter::class, function(Server $c) {
754 754
 			$cacheFactory = $c->get(ICacheFactory::class);
755 755
 			$logger = $c->get(ILogger::class);
756 756
 			if ($cacheFactory->isLocalCacheAvailable()) {
@@ -767,7 +767,7 @@  discard block
 block discarded – undo
767 767
 		/** @deprecated 19.0.0 */
768 768
 		$this->registerDeprecatedAlias('Search', ISearch::class);
769 769
 
770
-		$this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) {
770
+		$this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) {
771 771
 			return new \OC\Security\RateLimiting\Backend\MemoryCache(
772 772
 				$this->get(ICacheFactory::class),
773 773
 				new \OC\AppFramework\Utility\TimeFactory()
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
 		/** @deprecated 19.0.0 */
791 791
 		$this->registerDeprecatedAlias('CredentialsManager', ICredentialsManager::class);
792 792
 
793
-		$this->registerService(IDBConnection::class, function (Server $c) {
793
+		$this->registerService(IDBConnection::class, function(Server $c) {
794 794
 			$systemConfig = $c->get(SystemConfig::class);
795 795
 			$factory = new \OC\DB\ConnectionFactory($systemConfig);
796 796
 			$type = $systemConfig->getValue('dbtype', 'sqlite');
@@ -808,7 +808,7 @@  discard block
 block discarded – undo
808 808
 		$this->registerAlias(ICertificateManager::class, CertificateManager::class);
809 809
 		$this->registerAlias(IClientService::class, ClientService::class);
810 810
 		$this->registerDeprecatedAlias('HttpClientService', IClientService::class);
811
-		$this->registerService(IEventLogger::class, function (ContainerInterface $c) {
811
+		$this->registerService(IEventLogger::class, function(ContainerInterface $c) {
812 812
 			$eventLogger = new EventLogger();
813 813
 			if ($c->get(SystemConfig::class)->getValue('debug', false)) {
814 814
 				// In debug mode, module is being activated by default
@@ -819,7 +819,7 @@  discard block
 block discarded – undo
819 819
 		/** @deprecated 19.0.0 */
820 820
 		$this->registerDeprecatedAlias('EventLogger', IEventLogger::class);
821 821
 
822
-		$this->registerService(IQueryLogger::class, function (ContainerInterface $c) {
822
+		$this->registerService(IQueryLogger::class, function(ContainerInterface $c) {
823 823
 			$queryLogger = new QueryLogger();
824 824
 			if ($c->get(SystemConfig::class)->getValue('debug', false)) {
825 825
 				// In debug mode, module is being activated by default
@@ -834,7 +834,7 @@  discard block
 block discarded – undo
834 834
 		$this->registerDeprecatedAlias('TempManager', TempManager::class);
835 835
 		$this->registerAlias(ITempManager::class, TempManager::class);
836 836
 
837
-		$this->registerService(AppManager::class, function (ContainerInterface $c) {
837
+		$this->registerService(AppManager::class, function(ContainerInterface $c) {
838 838
 			// TODO: use auto-wiring
839 839
 			return new \OC\App\AppManager(
840 840
 				$c->get(IUserSession::class),
@@ -854,7 +854,7 @@  discard block
 block discarded – undo
854 854
 		/** @deprecated 19.0.0 */
855 855
 		$this->registerDeprecatedAlias('DateTimeZone', IDateTimeZone::class);
856 856
 
857
-		$this->registerService(IDateTimeFormatter::class, function (Server $c) {
857
+		$this->registerService(IDateTimeFormatter::class, function(Server $c) {
858 858
 			$language = $c->get(\OCP\IConfig::class)->getUserValue($c->get(ISession::class)->get('user_id'), 'core', 'lang', null);
859 859
 
860 860
 			return new DateTimeFormatter(
@@ -865,7 +865,7 @@  discard block
 block discarded – undo
865 865
 		/** @deprecated 19.0.0 */
866 866
 		$this->registerDeprecatedAlias('DateTimeFormatter', IDateTimeFormatter::class);
867 867
 
868
-		$this->registerService(IUserMountCache::class, function (ContainerInterface $c) {
868
+		$this->registerService(IUserMountCache::class, function(ContainerInterface $c) {
869 869
 			$mountCache = new UserMountCache(
870 870
 				$c->get(IDBConnection::class),
871 871
 				$c->get(IUserManager::class),
@@ -878,7 +878,7 @@  discard block
 block discarded – undo
878 878
 		/** @deprecated 19.0.0 */
879 879
 		$this->registerDeprecatedAlias('UserMountCache', IUserMountCache::class);
880 880
 
881
-		$this->registerService(IMountProviderCollection::class, function (ContainerInterface $c) {
881
+		$this->registerService(IMountProviderCollection::class, function(ContainerInterface $c) {
882 882
 			$loader = \OC\Files\Filesystem::getLoader();
883 883
 			$mountCache = $c->get(IUserMountCache::class);
884 884
 			$manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache);
@@ -899,7 +899,7 @@  discard block
 block discarded – undo
899 899
 
900 900
 		/** @deprecated 20.0.0 */
901 901
 		$this->registerDeprecatedAlias('IniWrapper', IniGetWrapper::class);
902
-		$this->registerService(IBus::class, function (ContainerInterface $c) {
902
+		$this->registerService(IBus::class, function(ContainerInterface $c) {
903 903
 			$busClass = $c->get(\OCP\IConfig::class)->getSystemValue('commandbus');
904 904
 			if ($busClass) {
905 905
 				[$app, $class] = explode('::', $busClass, 2);
@@ -919,7 +919,7 @@  discard block
 block discarded – undo
919 919
 		$this->registerDeprecatedAlias('TrustedDomainHelper', TrustedDomainHelper::class);
920 920
 		/** @deprecated 19.0.0 */
921 921
 		$this->registerDeprecatedAlias('Throttler', Throttler::class);
922
-		$this->registerService('IntegrityCodeChecker', function (ContainerInterface $c) {
922
+		$this->registerService('IntegrityCodeChecker', function(ContainerInterface $c) {
923 923
 			// IConfig and IAppManager requires a working database. This code
924 924
 			// might however be called when ownCloud is not yet setup.
925 925
 			if (\OC::$server->get(SystemConfig::class)->getValue('installed', false)) {
@@ -941,7 +941,7 @@  discard block
 block discarded – undo
941 941
 				$c->get(IMimeTypeDetector::class)
942 942
 			);
943 943
 		});
944
-		$this->registerService(\OCP\IRequest::class, function (ContainerInterface $c) {
944
+		$this->registerService(\OCP\IRequest::class, function(ContainerInterface $c) {
945 945
 			if (isset($this['urlParams'])) {
946 946
 				$urlParams = $this['urlParams'];
947 947
 			} else {
@@ -978,7 +978,7 @@  discard block
 block discarded – undo
978 978
 		/** @deprecated 19.0.0 */
979 979
 		$this->registerDeprecatedAlias('Request', \OCP\IRequest::class);
980 980
 
981
-		$this->registerService(IMailer::class, function (Server $c) {
981
+		$this->registerService(IMailer::class, function(Server $c) {
982 982
 			return new Mailer(
983 983
 				$c->get(\OCP\IConfig::class),
984 984
 				$c->get(ILogger::class),
@@ -992,7 +992,7 @@  discard block
 block discarded – undo
992 992
 		/** @deprecated 19.0.0 */
993 993
 		$this->registerDeprecatedAlias('Mailer', IMailer::class);
994 994
 
995
-		$this->registerService('LDAPProvider', function (ContainerInterface $c) {
995
+		$this->registerService('LDAPProvider', function(ContainerInterface $c) {
996 996
 			$config = $c->get(\OCP\IConfig::class);
997 997
 			$factoryClass = $config->getSystemValue('ldapProviderFactory', null);
998 998
 			if (is_null($factoryClass)) {
@@ -1002,7 +1002,7 @@  discard block
 block discarded – undo
1002 1002
 			$factory = new $factoryClass($this);
1003 1003
 			return $factory->getLDAPProvider();
1004 1004
 		});
1005
-		$this->registerService(ILockingProvider::class, function (ContainerInterface $c) {
1005
+		$this->registerService(ILockingProvider::class, function(ContainerInterface $c) {
1006 1006
 			$ini = $c->get(IniGetWrapper::class);
1007 1007
 			$config = $c->get(\OCP\IConfig::class);
1008 1008
 			$ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time')));
@@ -1030,12 +1030,12 @@  discard block
 block discarded – undo
1030 1030
 		/** @deprecated 19.0.0 */
1031 1031
 		$this->registerDeprecatedAlias('MountManager', IMountManager::class);
1032 1032
 
1033
-		$this->registerService(IMimeTypeDetector::class, function (ContainerInterface $c) {
1033
+		$this->registerService(IMimeTypeDetector::class, function(ContainerInterface $c) {
1034 1034
 			return new \OC\Files\Type\Detection(
1035 1035
 				$c->get(IURLGenerator::class),
1036 1036
 				$c->get(ILogger::class),
1037 1037
 				\OC::$configDir,
1038
-				\OC::$SERVERROOT . '/resources/config/'
1038
+				\OC::$SERVERROOT.'/resources/config/'
1039 1039
 			);
1040 1040
 		});
1041 1041
 		/** @deprecated 19.0.0 */
@@ -1044,19 +1044,19 @@  discard block
 block discarded – undo
1044 1044
 		$this->registerAlias(IMimeTypeLoader::class, Loader::class);
1045 1045
 		/** @deprecated 19.0.0 */
1046 1046
 		$this->registerDeprecatedAlias('MimeTypeLoader', IMimeTypeLoader::class);
1047
-		$this->registerService(BundleFetcher::class, function () {
1047
+		$this->registerService(BundleFetcher::class, function() {
1048 1048
 			return new BundleFetcher($this->getL10N('lib'));
1049 1049
 		});
1050 1050
 		$this->registerAlias(\OCP\Notification\IManager::class, Manager::class);
1051 1051
 		/** @deprecated 19.0.0 */
1052 1052
 		$this->registerDeprecatedAlias('NotificationManager', \OCP\Notification\IManager::class);
1053 1053
 
1054
-		$this->registerService(CapabilitiesManager::class, function (ContainerInterface $c) {
1054
+		$this->registerService(CapabilitiesManager::class, function(ContainerInterface $c) {
1055 1055
 			$manager = new CapabilitiesManager($c->get(ILogger::class));
1056
-			$manager->registerCapability(function () use ($c) {
1056
+			$manager->registerCapability(function() use ($c) {
1057 1057
 				return new \OC\OCS\CoreCapabilities($c->get(\OCP\IConfig::class));
1058 1058
 			});
1059
-			$manager->registerCapability(function () use ($c) {
1059
+			$manager->registerCapability(function() use ($c) {
1060 1060
 				return $c->get(\OC\Security\Bruteforce\Capabilities::class);
1061 1061
 			});
1062 1062
 			return $manager;
@@ -1064,14 +1064,14 @@  discard block
 block discarded – undo
1064 1064
 		/** @deprecated 19.0.0 */
1065 1065
 		$this->registerDeprecatedAlias('CapabilitiesManager', CapabilitiesManager::class);
1066 1066
 
1067
-		$this->registerService(ICommentsManager::class, function (Server $c) {
1067
+		$this->registerService(ICommentsManager::class, function(Server $c) {
1068 1068
 			$config = $c->get(\OCP\IConfig::class);
1069 1069
 			$factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class);
1070 1070
 			/** @var \OCP\Comments\ICommentsManagerFactory $factory */
1071 1071
 			$factory = new $factoryClass($this);
1072 1072
 			$manager = $factory->getManager();
1073 1073
 
1074
-			$manager->registerDisplayNameResolver('user', function ($id) use ($c) {
1074
+			$manager->registerDisplayNameResolver('user', function($id) use ($c) {
1075 1075
 				$manager = $c->get(IUserManager::class);
1076 1076
 				$user = $manager->get($id);
1077 1077
 				if (is_null($user)) {
@@ -1089,7 +1089,7 @@  discard block
 block discarded – undo
1089 1089
 		$this->registerDeprecatedAlias('CommentsManager', ICommentsManager::class);
1090 1090
 
1091 1091
 		$this->registerAlias(\OC_Defaults::class, 'ThemingDefaults');
1092
-		$this->registerService('ThemingDefaults', function (Server $c) {
1092
+		$this->registerService('ThemingDefaults', function(Server $c) {
1093 1093
 			/*
1094 1094
 			 * Dark magic for autoloader.
1095 1095
 			 * If we do a class_exists it will try to load the class which will
@@ -1124,7 +1124,7 @@  discard block
 block discarded – undo
1124 1124
 			}
1125 1125
 			return new \OC_Defaults();
1126 1126
 		});
1127
-		$this->registerService(JSCombiner::class, function (Server $c) {
1127
+		$this->registerService(JSCombiner::class, function(Server $c) {
1128 1128
 			return new JSCombiner(
1129 1129
 				$c->getAppDataDir('js'),
1130 1130
 				$c->get(IURLGenerator::class),
@@ -1138,7 +1138,7 @@  discard block
 block discarded – undo
1138 1138
 		$this->registerDeprecatedAlias('EventDispatcher', \OC\EventDispatcher\SymfonyAdapter::class);
1139 1139
 		$this->registerAlias(EventDispatcherInterface::class, \OC\EventDispatcher\SymfonyAdapter::class);
1140 1140
 
1141
-		$this->registerService('CryptoWrapper', function (ContainerInterface $c) {
1141
+		$this->registerService('CryptoWrapper', function(ContainerInterface $c) {
1142 1142
 			// FIXME: Instantiiated here due to cyclic dependency
1143 1143
 			$request = new Request(
1144 1144
 				[
@@ -1165,14 +1165,14 @@  discard block
 block discarded – undo
1165 1165
 		});
1166 1166
 		/** @deprecated 19.0.0 */
1167 1167
 		$this->registerDeprecatedAlias('CsrfTokenManager', CsrfTokenManager::class);
1168
-		$this->registerService(SessionStorage::class, function (ContainerInterface $c) {
1168
+		$this->registerService(SessionStorage::class, function(ContainerInterface $c) {
1169 1169
 			return new SessionStorage($c->get(ISession::class));
1170 1170
 		});
1171 1171
 		$this->registerAlias(\OCP\Security\IContentSecurityPolicyManager::class, ContentSecurityPolicyManager::class);
1172 1172
 		/** @deprecated 19.0.0 */
1173 1173
 		$this->registerDeprecatedAlias('ContentSecurityPolicyManager', ContentSecurityPolicyManager::class);
1174 1174
 
1175
-		$this->registerService(\OCP\Share\IManager::class, function (IServerContainer $c) {
1175
+		$this->registerService(\OCP\Share\IManager::class, function(IServerContainer $c) {
1176 1176
 			$config = $c->get(\OCP\IConfig::class);
1177 1177
 			$factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class);
1178 1178
 			/** @var \OCP\Share\IProviderFactory $factory */
@@ -1202,7 +1202,7 @@  discard block
 block discarded – undo
1202 1202
 		/** @deprecated 19.0.0 */
1203 1203
 		$this->registerDeprecatedAlias('ShareManager', \OCP\Share\IManager::class);
1204 1204
 
1205
-		$this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function (Server $c) {
1205
+		$this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function(Server $c) {
1206 1206
 			$instance = new Collaboration\Collaborators\Search($c);
1207 1207
 
1208 1208
 			// register default plugins
@@ -1225,33 +1225,33 @@  discard block
 block discarded – undo
1225 1225
 
1226 1226
 		$this->registerDeprecatedAlias('SettingsManager', \OC\Settings\Manager::class);
1227 1227
 		$this->registerAlias(\OCP\Settings\IManager::class, \OC\Settings\Manager::class);
1228
-		$this->registerService(\OC\Files\AppData\Factory::class, function (ContainerInterface $c) {
1228
+		$this->registerService(\OC\Files\AppData\Factory::class, function(ContainerInterface $c) {
1229 1229
 			return new \OC\Files\AppData\Factory(
1230 1230
 				$c->get(IRootFolder::class),
1231 1231
 				$c->get(SystemConfig::class)
1232 1232
 			);
1233 1233
 		});
1234 1234
 
1235
-		$this->registerService('LockdownManager', function (ContainerInterface $c) {
1236
-			return new LockdownManager(function () use ($c) {
1235
+		$this->registerService('LockdownManager', function(ContainerInterface $c) {
1236
+			return new LockdownManager(function() use ($c) {
1237 1237
 				return $c->get(ISession::class);
1238 1238
 			});
1239 1239
 		});
1240 1240
 
1241
-		$this->registerService(\OCP\OCS\IDiscoveryService::class, function (ContainerInterface $c) {
1241
+		$this->registerService(\OCP\OCS\IDiscoveryService::class, function(ContainerInterface $c) {
1242 1242
 			return new DiscoveryService(
1243 1243
 				$c->get(ICacheFactory::class),
1244 1244
 				$c->get(IClientService::class)
1245 1245
 			);
1246 1246
 		});
1247 1247
 
1248
-		$this->registerService(ICloudIdManager::class, function (ContainerInterface $c) {
1248
+		$this->registerService(ICloudIdManager::class, function(ContainerInterface $c) {
1249 1249
 			return new CloudIdManager();
1250 1250
 		});
1251 1251
 
1252 1252
 		$this->registerAlias(\OCP\GlobalScale\IConfig::class, \OC\GlobalScale\Config::class);
1253 1253
 
1254
-		$this->registerService(ICloudFederationProviderManager::class, function (ContainerInterface $c) {
1254
+		$this->registerService(ICloudFederationProviderManager::class, function(ContainerInterface $c) {
1255 1255
 			return new CloudFederationProviderManager(
1256 1256
 				$c->get(IAppManager::class),
1257 1257
 				$c->get(IClientService::class),
@@ -1260,7 +1260,7 @@  discard block
 block discarded – undo
1260 1260
 			);
1261 1261
 		});
1262 1262
 
1263
-		$this->registerService(ICloudFederationFactory::class, function (Server $c) {
1263
+		$this->registerService(ICloudFederationFactory::class, function(Server $c) {
1264 1264
 			return new CloudFederationFactory();
1265 1265
 		});
1266 1266
 
@@ -1272,7 +1272,7 @@  discard block
 block discarded – undo
1272 1272
 		/** @deprecated 19.0.0 */
1273 1273
 		$this->registerDeprecatedAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class);
1274 1274
 
1275
-		$this->registerService(Defaults::class, function (Server $c) {
1275
+		$this->registerService(Defaults::class, function(Server $c) {
1276 1276
 			return new Defaults(
1277 1277
 				$c->getThemingDefaults()
1278 1278
 			);
@@ -1280,17 +1280,17 @@  discard block
 block discarded – undo
1280 1280
 		/** @deprecated 19.0.0 */
1281 1281
 		$this->registerDeprecatedAlias('Defaults', \OCP\Defaults::class);
1282 1282
 
1283
-		$this->registerService(\OCP\ISession::class, function (ContainerInterface $c) {
1283
+		$this->registerService(\OCP\ISession::class, function(ContainerInterface $c) {
1284 1284
 			return $c->get(\OCP\IUserSession::class)->getSession();
1285 1285
 		}, false);
1286 1286
 
1287
-		$this->registerService(IShareHelper::class, function (ContainerInterface $c) {
1287
+		$this->registerService(IShareHelper::class, function(ContainerInterface $c) {
1288 1288
 			return new ShareHelper(
1289 1289
 				$c->get(\OCP\Share\IManager::class)
1290 1290
 			);
1291 1291
 		});
1292 1292
 
1293
-		$this->registerService(Installer::class, function (ContainerInterface $c) {
1293
+		$this->registerService(Installer::class, function(ContainerInterface $c) {
1294 1294
 			return new Installer(
1295 1295
 				$c->get(AppFetcher::class),
1296 1296
 				$c->get(IClientService::class),
@@ -1301,11 +1301,11 @@  discard block
 block discarded – undo
1301 1301
 			);
1302 1302
 		});
1303 1303
 
1304
-		$this->registerService(IApiFactory::class, function (ContainerInterface $c) {
1304
+		$this->registerService(IApiFactory::class, function(ContainerInterface $c) {
1305 1305
 			return new ApiFactory($c->get(IClientService::class));
1306 1306
 		});
1307 1307
 
1308
-		$this->registerService(IInstanceFactory::class, function (ContainerInterface $c) {
1308
+		$this->registerService(IInstanceFactory::class, function(ContainerInterface $c) {
1309 1309
 			$memcacheFactory = $c->get(ICacheFactory::class);
1310 1310
 			return new InstanceFactory($memcacheFactory->createLocal('remoteinstance.'), $c->get(IClientService::class));
1311 1311
 		});
@@ -1362,7 +1362,7 @@  discard block
 block discarded – undo
1362 1362
 		$dispatcher = $this->get(SymfonyAdapter::class);
1363 1363
 
1364 1364
 		// Delete avatar on user deletion
1365
-		$dispatcher->addListener('OCP\IUser::preDelete', function (GenericEvent $e) {
1365
+		$dispatcher->addListener('OCP\IUser::preDelete', function(GenericEvent $e) {
1366 1366
 			$logger = $this->get(ILogger::class);
1367 1367
 			$manager = $this->getAvatarManager();
1368 1368
 			/** @var IUser $user */
@@ -1375,11 +1375,11 @@  discard block
 block discarded – undo
1375 1375
 				// no avatar to remove
1376 1376
 			} catch (\Exception $e) {
1377 1377
 				// Ignore exceptions
1378
-				$logger->info('Could not cleanup avatar of ' . $user->getUID());
1378
+				$logger->info('Could not cleanup avatar of '.$user->getUID());
1379 1379
 			}
1380 1380
 		});
1381 1381
 
1382
-		$dispatcher->addListener('OCP\IUser::changeUser', function (GenericEvent $e) {
1382
+		$dispatcher->addListener('OCP\IUser::changeUser', function(GenericEvent $e) {
1383 1383
 			$manager = $this->getAvatarManager();
1384 1384
 			/** @var IUser $user */
1385 1385
 			$user = $e->getSubject();
@@ -2270,11 +2270,11 @@  discard block
 block discarded – undo
2270 2270
 	}
2271 2271
 
2272 2272
 	private function registerDeprecatedAlias(string $alias, string $target) {
2273
-		$this->registerService($alias, function (ContainerInterface $container) use ($target, $alias) {
2273
+		$this->registerService($alias, function(ContainerInterface $container) use ($target, $alias) {
2274 2274
 			try {
2275 2275
 				/** @var ILogger $logger */
2276 2276
 				$logger = $container->get(ILogger::class);
2277
-				$logger->debug('The requested alias "' . $alias . '" is depreacted. Please request "' . $target . '" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']);
2277
+				$logger->debug('The requested alias "'.$alias.'" is depreacted. Please request "'.$target.'" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']);
2278 2278
 			} catch (ContainerExceptionInterface $e) {
2279 2279
 				// Could not get logger. Continue
2280 2280
 			}
Please login to merge, or discard this patch.