Passed
Push — master ( 67704a...4e14c1 )
by Roeland
34:06 queued 19:41
created
lib/private/Server.php 1 patch
Spacing   +97 added lines, -97 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 (Server $c) {
292
+		$this->registerService(IPreview::class, function(Server $c) {
293 293
 			return new PreviewManager(
294 294
 				$c->getConfig(),
295 295
 				$c->getRootFolder(),
@@ -302,13 +302,13 @@  discard block
 block discarded – undo
302 302
 		/** @deprecated 19.0.0 */
303 303
 		$this->registerDeprecatedAlias('PreviewManager', IPreview::class);
304 304
 
305
-		$this->registerService(\OC\Preview\Watcher::class, function (Server $c) {
305
+		$this->registerService(\OC\Preview\Watcher::class, function(Server $c) {
306 306
 			return new \OC\Preview\Watcher(
307 307
 				new \OC\Preview\Storage\Root($c->getRootFolder(), $c->getSystemConfig())
308 308
 			);
309 309
 		});
310 310
 
311
-		$this->registerService(\OCP\Encryption\IManager::class, function (Server $c) {
311
+		$this->registerService(\OCP\Encryption\IManager::class, function(Server $c) {
312 312
 			$view = new View();
313 313
 			$util = new Encryption\Util(
314 314
 				$view,
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 		/** @deprecated 19.0.0 */
329 329
 		$this->registerDeprecatedAlias('EncryptionManager', \OCP\Encryption\IManager::class);
330 330
 
331
-		$this->registerService('EncryptionFileHelper', function (Server $c) {
331
+		$this->registerService('EncryptionFileHelper', function(Server $c) {
332 332
 			$util = new Encryption\Util(
333 333
 				new View(),
334 334
 				$c->getUserManager(),
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 			);
343 343
 		});
344 344
 
345
-		$this->registerService('EncryptionKeyStorage', function (Server $c) {
345
+		$this->registerService('EncryptionKeyStorage', function(Server $c) {
346 346
 			$view = new View();
347 347
 			$util = new Encryption\Util(
348 348
 				$view,
@@ -360,21 +360,21 @@  discard block
 block discarded – undo
360 360
 		/** @deprecated 19.0.0 */
361 361
 		$this->registerDeprecatedAlias('TagManager', \OCP\ITagManager::class);
362 362
 
363
-		$this->registerService('SystemTagManagerFactory', function (Server $c) {
363
+		$this->registerService('SystemTagManagerFactory', function(Server $c) {
364 364
 			$config = $c->getConfig();
365 365
 			$factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class);
366 366
 			return new $factoryClass($this);
367 367
 		});
368
-		$this->registerService(ISystemTagManager::class, function (Server $c) {
368
+		$this->registerService(ISystemTagManager::class, function(Server $c) {
369 369
 			return $c->query('SystemTagManagerFactory')->getManager();
370 370
 		});
371 371
 		/** @deprecated 19.0.0 */
372 372
 		$this->registerDeprecatedAlias('SystemTagManager', ISystemTagManager::class);
373 373
 
374
-		$this->registerService(ISystemTagObjectMapper::class, function (Server $c) {
374
+		$this->registerService(ISystemTagObjectMapper::class, function(Server $c) {
375 375
 			return $c->query('SystemTagManagerFactory')->getObjectMapper();
376 376
 		});
377
-		$this->registerService('RootFolder', function (Server $c) {
377
+		$this->registerService('RootFolder', function(Server $c) {
378 378
 			$manager = \OC\Files\Filesystem::getMountManager(null);
379 379
 			$view = new View();
380 380
 			$root = new Root(
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 
392 392
 			return $root;
393 393
 		});
394
-		$this->registerService(HookConnector::class, function (Server $c) {
394
+		$this->registerService(HookConnector::class, function(Server $c) {
395 395
 			return new HookConnector(
396 396
 				$c->query(IRootFolder::class),
397 397
 				new View(),
@@ -403,8 +403,8 @@  discard block
 block discarded – undo
403 403
 		/** @deprecated 19.0.0 */
404 404
 		$this->registerDeprecatedAlias('SystemTagObjectMapper', ISystemTagObjectMapper::class);
405 405
 
406
-		$this->registerService(IRootFolder::class, function (Server $c) {
407
-			return new LazyRoot(function () use ($c) {
406
+		$this->registerService(IRootFolder::class, function(Server $c) {
407
+			return new LazyRoot(function() use ($c) {
408 408
 				return $c->query('RootFolder');
409 409
 			});
410 410
 		});
@@ -415,44 +415,44 @@  discard block
 block discarded – undo
415 415
 		$this->registerDeprecatedAlias('UserManager', \OC\User\Manager::class);
416 416
 		$this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class);
417 417
 
418
-		$this->registerService(\OCP\IGroupManager::class, function (Server $c) {
418
+		$this->registerService(\OCP\IGroupManager::class, function(Server $c) {
419 419
 			$groupManager = new \OC\Group\Manager($this->getUserManager(), $c->getEventDispatcher(), $this->getLogger());
420
-			$groupManager->listen('\OC\Group', 'preCreate', function ($gid) {
420
+			$groupManager->listen('\OC\Group', 'preCreate', function($gid) {
421 421
 				\OC_Hook::emit('OC_Group', 'pre_createGroup', ['run' => true, 'gid' => $gid]);
422 422
 
423 423
 				/** @var IEventDispatcher $dispatcher */
424 424
 				$dispatcher = $this->query(IEventDispatcher::class);
425 425
 				$dispatcher->dispatchTyped(new BeforeGroupCreatedEvent($gid));
426 426
 			});
427
-			$groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $group) {
427
+			$groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $group) {
428 428
 				\OC_Hook::emit('OC_User', 'post_createGroup', ['gid' => $group->getGID()]);
429 429
 
430 430
 				/** @var IEventDispatcher $dispatcher */
431 431
 				$dispatcher = $this->query(IEventDispatcher::class);
432 432
 				$dispatcher->dispatchTyped(new GroupCreatedEvent($group));
433 433
 			});
434
-			$groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) {
434
+			$groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) {
435 435
 				\OC_Hook::emit('OC_Group', 'pre_deleteGroup', ['run' => true, 'gid' => $group->getGID()]);
436 436
 
437 437
 				/** @var IEventDispatcher $dispatcher */
438 438
 				$dispatcher = $this->query(IEventDispatcher::class);
439 439
 				$dispatcher->dispatchTyped(new BeforeGroupDeletedEvent($group));
440 440
 			});
441
-			$groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) {
441
+			$groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) {
442 442
 				\OC_Hook::emit('OC_User', 'post_deleteGroup', ['gid' => $group->getGID()]);
443 443
 
444 444
 				/** @var IEventDispatcher $dispatcher */
445 445
 				$dispatcher = $this->query(IEventDispatcher::class);
446 446
 				$dispatcher->dispatchTyped(new GroupDeletedEvent($group));
447 447
 			});
448
-			$groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
448
+			$groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) {
449 449
 				\OC_Hook::emit('OC_Group', 'pre_addToGroup', ['run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID()]);
450 450
 
451 451
 				/** @var IEventDispatcher $dispatcher */
452 452
 				$dispatcher = $this->query(IEventDispatcher::class);
453 453
 				$dispatcher->dispatchTyped(new BeforeUserAddedEvent($group, $user));
454 454
 			});
455
-			$groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
455
+			$groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) {
456 456
 				\OC_Hook::emit('OC_Group', 'post_addToGroup', ['uid' => $user->getUID(), 'gid' => $group->getGID()]);
457 457
 				//Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks
458 458
 				\OC_Hook::emit('OC_User', 'post_addToGroup', ['uid' => $user->getUID(), 'gid' => $group->getGID()]);
@@ -461,12 +461,12 @@  discard block
 block discarded – undo
461 461
 				$dispatcher = $this->query(IEventDispatcher::class);
462 462
 				$dispatcher->dispatchTyped(new UserAddedEvent($group, $user));
463 463
 			});
464
-			$groupManager->listen('\OC\Group', 'preRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) {
464
+			$groupManager->listen('\OC\Group', 'preRemoveUser', function(\OC\Group\Group $group, \OC\User\User $user) {
465 465
 				/** @var IEventDispatcher $dispatcher */
466 466
 				$dispatcher = $this->query(IEventDispatcher::class);
467 467
 				$dispatcher->dispatchTyped(new BeforeUserRemovedEvent($group, $user));
468 468
 			});
469
-			$groupManager->listen('\OC\Group', 'postRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) {
469
+			$groupManager->listen('\OC\Group', 'postRemoveUser', function(\OC\Group\Group $group, \OC\User\User $user) {
470 470
 				/** @var IEventDispatcher $dispatcher */
471 471
 				$dispatcher = $this->query(IEventDispatcher::class);
472 472
 				$dispatcher->dispatchTyped(new UserRemovedEvent($group, $user));
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
 		/** @deprecated 19.0.0 */
477 477
 		$this->registerDeprecatedAlias('GroupManager', \OCP\IGroupManager::class);
478 478
 
479
-		$this->registerService(Store::class, function (Server $c) {
479
+		$this->registerService(Store::class, function(Server $c) {
480 480
 			$session = $c->getSession();
481 481
 			if (\OC::$server->getSystemConfig()->getValue('installed', false)) {
482 482
 				$tokenProvider = $c->query(IProvider::class);
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
 		$this->registerAlias(IStore::class, Store::class);
490 490
 		$this->registerAlias(IProvider::class, Authentication\Token\Manager::class);
491 491
 
492
-		$this->registerService(\OC\User\Session::class, function (Server $c) {
492
+		$this->registerService(\OC\User\Session::class, function(Server $c) {
493 493
 			$manager = $c->getUserManager();
494 494
 			$session = new \OC\Session\Memory('');
495 495
 			$timeFactory = new TimeFactory();
@@ -514,14 +514,14 @@  discard block
 block discarded – undo
514 514
 				$c->getLogger(),
515 515
 				$c->query(IEventDispatcher::class)
516 516
 			);
517
-			$userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) {
517
+			$userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) {
518 518
 				\OC_Hook::emit('OC_User', 'pre_createUser', ['run' => true, 'uid' => $uid, 'password' => $password]);
519 519
 
520 520
 				/** @var IEventDispatcher $dispatcher */
521 521
 				$dispatcher = $this->query(IEventDispatcher::class);
522 522
 				$dispatcher->dispatchTyped(new BeforeUserCreatedEvent($uid, $password));
523 523
 			});
524
-			$userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) {
524
+			$userSession->listen('\OC\User', 'postCreateUser', function($user, $password) {
525 525
 				/** @var \OC\User\User $user */
526 526
 				\OC_Hook::emit('OC_User', 'post_createUser', ['uid' => $user->getUID(), 'password' => $password]);
527 527
 
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
 				$dispatcher = $this->query(IEventDispatcher::class);
530 530
 				$dispatcher->dispatchTyped(new UserCreatedEvent($user, $password));
531 531
 			});
532
-			$userSession->listen('\OC\User', 'preDelete', function ($user) use ($legacyDispatcher) {
532
+			$userSession->listen('\OC\User', 'preDelete', function($user) use ($legacyDispatcher) {
533 533
 				/** @var \OC\User\User $user */
534 534
 				\OC_Hook::emit('OC_User', 'pre_deleteUser', ['run' => true, 'uid' => $user->getUID()]);
535 535
 				$legacyDispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user));
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
 				$dispatcher = $this->query(IEventDispatcher::class);
539 539
 				$dispatcher->dispatchTyped(new BeforeUserDeletedEvent($user));
540 540
 			});
541
-			$userSession->listen('\OC\User', 'postDelete', function ($user) {
541
+			$userSession->listen('\OC\User', 'postDelete', function($user) {
542 542
 				/** @var \OC\User\User $user */
543 543
 				\OC_Hook::emit('OC_User', 'post_deleteUser', ['uid' => $user->getUID()]);
544 544
 
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
 				$dispatcher = $this->query(IEventDispatcher::class);
547 547
 				$dispatcher->dispatchTyped(new UserDeletedEvent($user));
548 548
 			});
549
-			$userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) {
549
+			$userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) {
550 550
 				/** @var \OC\User\User $user */
551 551
 				\OC_Hook::emit('OC_User', 'pre_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]);
552 552
 
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 				$dispatcher = $this->query(IEventDispatcher::class);
555 555
 				$dispatcher->dispatchTyped(new BeforePasswordUpdatedEvent($user, $password, $recoveryPassword));
556 556
 			});
557
-			$userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) {
557
+			$userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) {
558 558
 				/** @var \OC\User\User $user */
559 559
 				\OC_Hook::emit('OC_User', 'post_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]);
560 560
 
@@ -562,14 +562,14 @@  discard block
 block discarded – undo
562 562
 				$dispatcher = $this->query(IEventDispatcher::class);
563 563
 				$dispatcher->dispatchTyped(new PasswordUpdatedEvent($user, $password, $recoveryPassword));
564 564
 			});
565
-			$userSession->listen('\OC\User', 'preLogin', function ($uid, $password) {
565
+			$userSession->listen('\OC\User', 'preLogin', function($uid, $password) {
566 566
 				\OC_Hook::emit('OC_User', 'pre_login', ['run' => true, 'uid' => $uid, 'password' => $password]);
567 567
 
568 568
 				/** @var IEventDispatcher $dispatcher */
569 569
 				$dispatcher = $this->query(IEventDispatcher::class);
570 570
 				$dispatcher->dispatchTyped(new BeforeUserLoggedInEvent($uid, $password));
571 571
 			});
572
-			$userSession->listen('\OC\User', 'postLogin', function ($user, $loginName, $password, $isTokenLogin) {
572
+			$userSession->listen('\OC\User', 'postLogin', function($user, $loginName, $password, $isTokenLogin) {
573 573
 				/** @var \OC\User\User $user */
574 574
 				\OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'loginName' => $loginName, 'password' => $password, 'isTokenLogin' => $isTokenLogin]);
575 575
 
@@ -577,12 +577,12 @@  discard block
 block discarded – undo
577 577
 				$dispatcher = $this->query(IEventDispatcher::class);
578 578
 				$dispatcher->dispatchTyped(new UserLoggedInEvent($user, $password, $isTokenLogin));
579 579
 			});
580
-			$userSession->listen('\OC\User', 'preRememberedLogin', function ($uid) {
580
+			$userSession->listen('\OC\User', 'preRememberedLogin', function($uid) {
581 581
 				/** @var IEventDispatcher $dispatcher */
582 582
 				$dispatcher = $this->query(IEventDispatcher::class);
583 583
 				$dispatcher->dispatchTyped(new BeforeUserLoggedInWithCookieEvent($uid));
584 584
 			});
585
-			$userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) {
585
+			$userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) {
586 586
 				/** @var \OC\User\User $user */
587 587
 				\OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'password' => $password]);
588 588
 
@@ -590,19 +590,19 @@  discard block
 block discarded – undo
590 590
 				$dispatcher = $this->query(IEventDispatcher::class);
591 591
 				$dispatcher->dispatchTyped(new UserLoggedInWithCookieEvent($user, $password));
592 592
 			});
593
-			$userSession->listen('\OC\User', 'logout', function ($user) {
593
+			$userSession->listen('\OC\User', 'logout', function($user) {
594 594
 				\OC_Hook::emit('OC_User', 'logout', []);
595 595
 
596 596
 				/** @var IEventDispatcher $dispatcher */
597 597
 				$dispatcher = $this->query(IEventDispatcher::class);
598 598
 				$dispatcher->dispatchTyped(new BeforeUserLoggedOutEvent($user));
599 599
 			});
600
-			$userSession->listen('\OC\User', 'postLogout', function ($user) {
600
+			$userSession->listen('\OC\User', 'postLogout', function($user) {
601 601
 				/** @var IEventDispatcher $dispatcher */
602 602
 				$dispatcher = $this->query(IEventDispatcher::class);
603 603
 				$dispatcher->dispatchTyped(new UserLoggedOutEvent($user));
604 604
 			});
605
-			$userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) {
605
+			$userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) {
606 606
 				/** @var \OC\User\User $user */
607 607
 				\OC_Hook::emit('OC_User', 'changeUser', ['run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue]);
608 608
 
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
 		$this->registerDeprecatedAlias('AllConfig', \OC\AllConfig::class);
627 627
 		$this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class);
628 628
 
629
-		$this->registerService(\OC\SystemConfig::class, function ($c) use ($config) {
629
+		$this->registerService(\OC\SystemConfig::class, function($c) use ($config) {
630 630
 			return new \OC\SystemConfig($config);
631 631
 		});
632 632
 		/** @deprecated 19.0.0 */
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
 		$this->registerDeprecatedAlias('AppConfig', \OC\AppConfig::class);
637 637
 		$this->registerAlias(IAppConfig::class, \OC\AppConfig::class);
638 638
 
639
-		$this->registerService(IFactory::class, function (Server $c) {
639
+		$this->registerService(IFactory::class, function(Server $c) {
640 640
 			return new \OC\L10N\Factory(
641 641
 				$c->getConfig(),
642 642
 				$c->getRequest(),
@@ -656,13 +656,13 @@  discard block
 block discarded – undo
656 656
 		/** @deprecated 19.0.0 */
657 657
 		$this->registerDeprecatedAlias('CategoryFetcher', CategoryFetcher::class);
658 658
 
659
-		$this->registerService(ICache::class, function ($c) {
659
+		$this->registerService(ICache::class, function($c) {
660 660
 			return new Cache\File();
661 661
 		});
662 662
 		/** @deprecated 19.0.0 */
663 663
 		$this->registerDeprecatedAlias('UserCache', ICache::class);
664 664
 
665
-		$this->registerService(Factory::class, function (Server $c) {
665
+		$this->registerService(Factory::class, function(Server $c) {
666 666
 			$arrayCacheFactory = new \OC\Memcache\Factory('', $c->getLogger(),
667 667
 				ArrayCache::class,
668 668
 				ArrayCache::class,
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
 				$version = implode(',', $v);
677 677
 				$instanceId = \OC_Util::getInstanceId();
678 678
 				$path = \OC::$SERVERROOT;
679
-				$prefix = md5($instanceId . '-' . $version . '-' . $path);
679
+				$prefix = md5($instanceId.'-'.$version.'-'.$path);
680 680
 				return new \OC\Memcache\Factory($prefix, $c->getLogger(),
681 681
 					$config->getSystemValue('memcache.local', null),
682 682
 					$config->getSystemValue('memcache.distributed', null),
@@ -689,12 +689,12 @@  discard block
 block discarded – undo
689 689
 		$this->registerDeprecatedAlias('MemCacheFactory', Factory::class);
690 690
 		$this->registerAlias(ICacheFactory::class, Factory::class);
691 691
 
692
-		$this->registerService('RedisFactory', function (Server $c) {
692
+		$this->registerService('RedisFactory', function(Server $c) {
693 693
 			$systemConfig = $c->getSystemConfig();
694 694
 			return new RedisFactory($systemConfig);
695 695
 		});
696 696
 
697
-		$this->registerService(\OCP\Activity\IManager::class, function (Server $c) {
697
+		$this->registerService(\OCP\Activity\IManager::class, function(Server $c) {
698 698
 			$l10n = $this->get(IFactory::class)->get('lib');
699 699
 			return new \OC\Activity\Manager(
700 700
 				$c->getRequest(),
@@ -707,14 +707,14 @@  discard block
 block discarded – undo
707 707
 		/** @deprecated 19.0.0 */
708 708
 		$this->registerDeprecatedAlias('ActivityManager', \OCP\Activity\IManager::class);
709 709
 
710
-		$this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) {
710
+		$this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) {
711 711
 			return new \OC\Activity\EventMerger(
712 712
 				$c->getL10N('lib')
713 713
 			);
714 714
 		});
715 715
 		$this->registerAlias(IValidator::class, Validator::class);
716 716
 
717
-		$this->registerService(AvatarManager::class, function (Server $c) {
717
+		$this->registerService(AvatarManager::class, function(Server $c) {
718 718
 			return new AvatarManager(
719 719
 				$c->query(\OC\User\Manager::class),
720 720
 				$c->getAppDataDir('avatar'),
@@ -730,7 +730,7 @@  discard block
 block discarded – undo
730 730
 		$this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class);
731 731
 		$this->registerAlias(\OCP\Support\Subscription\IRegistry::class, \OC\Support\Subscription\Registry::class);
732 732
 
733
-		$this->registerService(\OC\Log::class, function (Server $c) {
733
+		$this->registerService(\OC\Log::class, function(Server $c) {
734 734
 			$logType = $c->query(AllConfig::class)->getSystemValue('log_type', 'file');
735 735
 			$factory = new LogFactory($c, $this->getSystemConfig());
736 736
 			$logger = $factory->get($logType);
@@ -744,7 +744,7 @@  discard block
 block discarded – undo
744 744
 		// PSR-3 logger
745 745
 		$this->registerAlias(LoggerInterface::class, PsrLoggerAdapter::class);
746 746
 
747
-		$this->registerService(ILogFactory::class, function (Server $c) {
747
+		$this->registerService(ILogFactory::class, function(Server $c) {
748 748
 			return new LogFactory($c, $this->getSystemConfig());
749 749
 		});
750 750
 
@@ -752,7 +752,7 @@  discard block
 block discarded – undo
752 752
 		/** @deprecated 19.0.0 */
753 753
 		$this->registerDeprecatedAlias('JobList', IJobList::class);
754 754
 
755
-		$this->registerService(IRouter::class, function (Server $c) {
755
+		$this->registerService(IRouter::class, function(Server $c) {
756 756
 			$cacheFactory = $c->getMemCacheFactory();
757 757
 			$logger = $c->getLogger();
758 758
 			if ($cacheFactory->isLocalCacheAvailable()) {
@@ -769,7 +769,7 @@  discard block
 block discarded – undo
769 769
 		/** @deprecated 19.0.0 */
770 770
 		$this->registerDeprecatedAlias('Search', ISearch::class);
771 771
 
772
-		$this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) {
772
+		$this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) {
773 773
 			return new \OC\Security\RateLimiting\Backend\MemoryCache(
774 774
 				$this->getMemCacheFactory(),
775 775
 				new \OC\AppFramework\Utility\TimeFactory()
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
 		/** @deprecated 19.0.0 */
793 793
 		$this->registerDeprecatedAlias('CredentialsManager', ICredentialsManager::class);
794 794
 
795
-		$this->registerService(IDBConnection::class, function (Server $c) {
795
+		$this->registerService(IDBConnection::class, function(Server $c) {
796 796
 			$systemConfig = $c->getSystemConfig();
797 797
 			$factory = new \OC\DB\ConnectionFactory($systemConfig);
798 798
 			$type = $systemConfig->getValue('dbtype', 'sqlite');
@@ -808,7 +808,7 @@  discard block
 block discarded – undo
808 808
 		$this->registerDeprecatedAlias('DatabaseConnection', IDBConnection::class);
809 809
 
810 810
 
811
-		$this->registerService(IClientService::class, function (Server $c) {
811
+		$this->registerService(IClientService::class, function(Server $c) {
812 812
 			$user = \OC_User::getUser();
813 813
 			$uid = $user ? $user : null;
814 814
 			return new ClientService(
@@ -825,7 +825,7 @@  discard block
 block discarded – undo
825 825
 		});
826 826
 		/** @deprecated 19.0.0 */
827 827
 		$this->registerDeprecatedAlias('HttpClientService', IClientService::class);
828
-		$this->registerService(IEventLogger::class, function (Server $c) {
828
+		$this->registerService(IEventLogger::class, function(Server $c) {
829 829
 			$eventLogger = new EventLogger();
830 830
 			if ($c->getSystemConfig()->getValue('debug', false)) {
831 831
 				// In debug mode, module is being activated by default
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
 		/** @deprecated 19.0.0 */
837 837
 		$this->registerDeprecatedAlias('EventLogger', IEventLogger::class);
838 838
 
839
-		$this->registerService(IQueryLogger::class, function (Server $c) {
839
+		$this->registerService(IQueryLogger::class, function(Server $c) {
840 840
 			$queryLogger = new QueryLogger();
841 841
 			if ($c->getSystemConfig()->getValue('debug', false)) {
842 842
 				// In debug mode, module is being activated by default
@@ -851,7 +851,7 @@  discard block
 block discarded – undo
851 851
 		$this->registerDeprecatedAlias('TempManager', TempManager::class);
852 852
 		$this->registerAlias(ITempManager::class, TempManager::class);
853 853
 
854
-		$this->registerService(AppManager::class, function (Server $c) {
854
+		$this->registerService(AppManager::class, function(Server $c) {
855 855
 			return new \OC\App\AppManager(
856 856
 				$c->getUserSession(),
857 857
 				$c->getConfig(),
@@ -870,7 +870,7 @@  discard block
 block discarded – undo
870 870
 		/** @deprecated 19.0.0 */
871 871
 		$this->registerDeprecatedAlias('DateTimeZone', IDateTimeZone::class);
872 872
 
873
-		$this->registerService(IDateTimeFormatter::class, function (Server $c) {
873
+		$this->registerService(IDateTimeFormatter::class, function(Server $c) {
874 874
 			$language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null);
875 875
 
876 876
 			return new DateTimeFormatter(
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
 		/** @deprecated 19.0.0 */
882 882
 		$this->registerDeprecatedAlias('DateTimeFormatter', IDateTimeFormatter::class);
883 883
 
884
-		$this->registerService(IUserMountCache::class, function (Server $c) {
884
+		$this->registerService(IUserMountCache::class, function(Server $c) {
885 885
 			$mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger());
886 886
 			$listener = new UserMountCacheListener($mountCache);
887 887
 			$listener->listen($c->getUserManager());
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
 		/** @deprecated 19.0.0 */
891 891
 		$this->registerDeprecatedAlias('UserMountCache', IUserMountCache::class);
892 892
 
893
-		$this->registerService(IMountProviderCollection::class, function (Server $c) {
893
+		$this->registerService(IMountProviderCollection::class, function(Server $c) {
894 894
 			$loader = \OC\Files\Filesystem::getLoader();
895 895
 			$mountCache = $c->query(IUserMountCache::class);
896 896
 			$manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache);
@@ -911,7 +911,7 @@  discard block
 block discarded – undo
911 911
 
912 912
 		/** @deprecated 20.0.0 */
913 913
 		$this->registerDeprecatedAlias('IniWrapper', IniGetWrapper::class);
914
-		$this->registerService('AsyncCommandBus', function (Server $c) {
914
+		$this->registerService('AsyncCommandBus', function(Server $c) {
915 915
 			$busClass = $c->getConfig()->getSystemValue('commandbus');
916 916
 			if ($busClass) {
917 917
 				[$app, $class] = explode('::', $busClass, 2);
@@ -931,7 +931,7 @@  discard block
 block discarded – undo
931 931
 		$this->registerDeprecatedAlias('TrustedDomainHelper', TrustedDomainHelper::class);
932 932
 		/** @deprecated 19.0.0 */
933 933
 		$this->registerDeprecatedAlias('Throttler', Throttler::class);
934
-		$this->registerService('IntegrityCodeChecker', function (Server $c) {
934
+		$this->registerService('IntegrityCodeChecker', function(Server $c) {
935 935
 			// IConfig and IAppManager requires a working database. This code
936 936
 			// might however be called when ownCloud is not yet setup.
937 937
 			if (\OC::$server->getSystemConfig()->getValue('installed', false)) {
@@ -953,7 +953,7 @@  discard block
 block discarded – undo
953 953
 				$c->getMimeTypeDetector()
954 954
 			);
955 955
 		});
956
-		$this->registerService(\OCP\IRequest::class, function ($c) {
956
+		$this->registerService(\OCP\IRequest::class, function($c) {
957 957
 			if (isset($this['urlParams'])) {
958 958
 				$urlParams = $this['urlParams'];
959 959
 			} else {
@@ -990,7 +990,7 @@  discard block
 block discarded – undo
990 990
 		/** @deprecated 19.0.0 */
991 991
 		$this->registerDeprecatedAlias('Request', \OCP\IRequest::class);
992 992
 
993
-		$this->registerService(IMailer::class, function (Server $c) {
993
+		$this->registerService(IMailer::class, function(Server $c) {
994 994
 			return new Mailer(
995 995
 				$c->getConfig(),
996 996
 				$c->getLogger(),
@@ -1004,7 +1004,7 @@  discard block
 block discarded – undo
1004 1004
 		/** @deprecated 19.0.0 */
1005 1005
 		$this->registerDeprecatedAlias('Mailer', IMailer::class);
1006 1006
 
1007
-		$this->registerService('LDAPProvider', function (Server $c) {
1007
+		$this->registerService('LDAPProvider', function(Server $c) {
1008 1008
 			$config = $c->getConfig();
1009 1009
 			$factoryClass = $config->getSystemValue('ldapProviderFactory', null);
1010 1010
 			if (is_null($factoryClass)) {
@@ -1014,7 +1014,7 @@  discard block
 block discarded – undo
1014 1014
 			$factory = new $factoryClass($this);
1015 1015
 			return $factory->getLDAPProvider();
1016 1016
 		});
1017
-		$this->registerService(ILockingProvider::class, function (Server $c) {
1017
+		$this->registerService(ILockingProvider::class, function(Server $c) {
1018 1018
 			$ini = $c->get(IniGetWrapper::class);
1019 1019
 			$config = $c->getConfig();
1020 1020
 			$ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time')));
@@ -1042,12 +1042,12 @@  discard block
 block discarded – undo
1042 1042
 		/** @deprecated 19.0.0 */
1043 1043
 		$this->registerDeprecatedAlias('MountManager', IMountManager::class);
1044 1044
 
1045
-		$this->registerService(IMimeTypeDetector::class, function (Server $c) {
1045
+		$this->registerService(IMimeTypeDetector::class, function(Server $c) {
1046 1046
 			return new \OC\Files\Type\Detection(
1047 1047
 				$c->getURLGenerator(),
1048 1048
 				$c->getLogger(),
1049 1049
 				\OC::$configDir,
1050
-				\OC::$SERVERROOT . '/resources/config/'
1050
+				\OC::$SERVERROOT.'/resources/config/'
1051 1051
 			);
1052 1052
 		});
1053 1053
 		/** @deprecated 19.0.0 */
@@ -1056,19 +1056,19 @@  discard block
 block discarded – undo
1056 1056
 		$this->registerAlias(IMimeTypeLoader::class, Loader::class);
1057 1057
 		/** @deprecated 19.0.0 */
1058 1058
 		$this->registerDeprecatedAlias('MimeTypeLoader', IMimeTypeLoader::class);
1059
-		$this->registerService(BundleFetcher::class, function () {
1059
+		$this->registerService(BundleFetcher::class, function() {
1060 1060
 			return new BundleFetcher($this->getL10N('lib'));
1061 1061
 		});
1062 1062
 		$this->registerAlias(\OCP\Notification\IManager::class, Manager::class);
1063 1063
 		/** @deprecated 19.0.0 */
1064 1064
 		$this->registerDeprecatedAlias('NotificationManager', \OCP\Notification\IManager::class);
1065 1065
 
1066
-		$this->registerService(CapabilitiesManager::class, function (Server $c) {
1066
+		$this->registerService(CapabilitiesManager::class, function(Server $c) {
1067 1067
 			$manager = new CapabilitiesManager($c->getLogger());
1068
-			$manager->registerCapability(function () use ($c) {
1068
+			$manager->registerCapability(function() use ($c) {
1069 1069
 				return new \OC\OCS\CoreCapabilities($c->getConfig());
1070 1070
 			});
1071
-			$manager->registerCapability(function () use ($c) {
1071
+			$manager->registerCapability(function() use ($c) {
1072 1072
 				return $c->query(\OC\Security\Bruteforce\Capabilities::class);
1073 1073
 			});
1074 1074
 			return $manager;
@@ -1076,14 +1076,14 @@  discard block
 block discarded – undo
1076 1076
 		/** @deprecated 19.0.0 */
1077 1077
 		$this->registerDeprecatedAlias('CapabilitiesManager', CapabilitiesManager::class);
1078 1078
 
1079
-		$this->registerService(ICommentsManager::class, function (Server $c) {
1079
+		$this->registerService(ICommentsManager::class, function(Server $c) {
1080 1080
 			$config = $c->getConfig();
1081 1081
 			$factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class);
1082 1082
 			/** @var \OCP\Comments\ICommentsManagerFactory $factory */
1083 1083
 			$factory = new $factoryClass($this);
1084 1084
 			$manager = $factory->getManager();
1085 1085
 
1086
-			$manager->registerDisplayNameResolver('user', function ($id) use ($c) {
1086
+			$manager->registerDisplayNameResolver('user', function($id) use ($c) {
1087 1087
 				$manager = $c->getUserManager();
1088 1088
 				$user = $manager->get($id);
1089 1089
 				if (is_null($user)) {
@@ -1101,7 +1101,7 @@  discard block
 block discarded – undo
1101 1101
 		$this->registerDeprecatedAlias('CommentsManager', ICommentsManager::class);
1102 1102
 
1103 1103
 		$this->registerAlias(\OC_Defaults::class, 'ThemingDefaults');
1104
-		$this->registerService('ThemingDefaults', function (Server $c) {
1104
+		$this->registerService('ThemingDefaults', function(Server $c) {
1105 1105
 			/*
1106 1106
 			 * Dark magic for autoloader.
1107 1107
 			 * If we do a class_exists it will try to load the class which will
@@ -1129,7 +1129,7 @@  discard block
 block discarded – undo
1129 1129
 			}
1130 1130
 			return new \OC_Defaults();
1131 1131
 		});
1132
-		$this->registerService(JSCombiner::class, function (Server $c) {
1132
+		$this->registerService(JSCombiner::class, function(Server $c) {
1133 1133
 			return new JSCombiner(
1134 1134
 				$c->getAppDataDir('js'),
1135 1135
 				$c->getURLGenerator(),
@@ -1143,7 +1143,7 @@  discard block
 block discarded – undo
1143 1143
 		$this->registerDeprecatedAlias('EventDispatcher', \OC\EventDispatcher\SymfonyAdapter::class);
1144 1144
 		$this->registerAlias(EventDispatcherInterface::class, \OC\EventDispatcher\SymfonyAdapter::class);
1145 1145
 
1146
-		$this->registerService('CryptoWrapper', function (Server $c) {
1146
+		$this->registerService('CryptoWrapper', function(Server $c) {
1147 1147
 			// FIXME: Instantiiated here due to cyclic dependency
1148 1148
 			$request = new Request(
1149 1149
 				[
@@ -1170,14 +1170,14 @@  discard block
 block discarded – undo
1170 1170
 		});
1171 1171
 		/** @deprecated 19.0.0 */
1172 1172
 		$this->registerDeprecatedAlias('CsrfTokenManager', CsrfTokenManager::class);
1173
-		$this->registerService(SessionStorage::class, function (Server $c) {
1173
+		$this->registerService(SessionStorage::class, function(Server $c) {
1174 1174
 			return new SessionStorage($c->getSession());
1175 1175
 		});
1176 1176
 		$this->registerAlias(\OCP\Security\IContentSecurityPolicyManager::class, ContentSecurityPolicyManager::class);
1177 1177
 		/** @deprecated 19.0.0 */
1178 1178
 		$this->registerDeprecatedAlias('ContentSecurityPolicyManager', ContentSecurityPolicyManager::class);
1179 1179
 
1180
-		$this->registerService(\OCP\Share\IManager::class, function (Server $c) {
1180
+		$this->registerService(\OCP\Share\IManager::class, function(Server $c) {
1181 1181
 			$config = $c->getConfig();
1182 1182
 			$factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class);
1183 1183
 			/** @var \OCP\Share\IProviderFactory $factory */
@@ -1207,7 +1207,7 @@  discard block
 block discarded – undo
1207 1207
 		/** @deprecated 19.0.0 */
1208 1208
 		$this->registerDeprecatedAlias('ShareManager', \OCP\Share\IManager::class);
1209 1209
 
1210
-		$this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function (Server $c) {
1210
+		$this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function(Server $c) {
1211 1211
 			$instance = new Collaboration\Collaborators\Search($c);
1212 1212
 
1213 1213
 			// register default plugins
@@ -1230,34 +1230,34 @@  discard block
 block discarded – undo
1230 1230
 
1231 1231
 		$this->registerDeprecatedAlias('SettingsManager', \OC\Settings\Manager::class);
1232 1232
 		$this->registerAlias(\OCP\Settings\IManager::class, \OC\Settings\Manager::class);
1233
-		$this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) {
1233
+		$this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) {
1234 1234
 			return new \OC\Files\AppData\Factory(
1235 1235
 				$c->getRootFolder(),
1236 1236
 				$c->getSystemConfig()
1237 1237
 			);
1238 1238
 		});
1239 1239
 
1240
-		$this->registerService('LockdownManager', function (Server $c) {
1241
-			return new LockdownManager(function () use ($c) {
1240
+		$this->registerService('LockdownManager', function(Server $c) {
1241
+			return new LockdownManager(function() use ($c) {
1242 1242
 				return $c->getSession();
1243 1243
 			});
1244 1244
 		});
1245 1245
 
1246
-		$this->registerService(\OCP\OCS\IDiscoveryService::class, function (Server $c) {
1246
+		$this->registerService(\OCP\OCS\IDiscoveryService::class, function(Server $c) {
1247 1247
 			return new DiscoveryService($c->getMemCacheFactory(), $c->getHTTPClientService());
1248 1248
 		});
1249 1249
 
1250
-		$this->registerService(ICloudIdManager::class, function (Server $c) {
1250
+		$this->registerService(ICloudIdManager::class, function(Server $c) {
1251 1251
 			return new CloudIdManager();
1252 1252
 		});
1253 1253
 
1254 1254
 		$this->registerAlias(\OCP\GlobalScale\IConfig::class, \OC\GlobalScale\Config::class);
1255 1255
 
1256
-		$this->registerService(ICloudFederationProviderManager::class, function (Server $c) {
1256
+		$this->registerService(ICloudFederationProviderManager::class, function(Server $c) {
1257 1257
 			return new CloudFederationProviderManager($c->getAppManager(), $c->getHTTPClientService(), $c->getCloudIdManager(), $c->getLogger());
1258 1258
 		});
1259 1259
 
1260
-		$this->registerService(ICloudFederationFactory::class, function (Server $c) {
1260
+		$this->registerService(ICloudFederationFactory::class, function(Server $c) {
1261 1261
 			return new CloudFederationFactory();
1262 1262
 		});
1263 1263
 
@@ -1269,7 +1269,7 @@  discard block
 block discarded – undo
1269 1269
 		/** @deprecated 19.0.0 */
1270 1270
 		$this->registerDeprecatedAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class);
1271 1271
 
1272
-		$this->registerService(Defaults::class, function (Server $c) {
1272
+		$this->registerService(Defaults::class, function(Server $c) {
1273 1273
 			return new Defaults(
1274 1274
 				$c->getThemingDefaults()
1275 1275
 			);
@@ -1277,17 +1277,17 @@  discard block
 block discarded – undo
1277 1277
 		/** @deprecated 19.0.0 */
1278 1278
 		$this->registerDeprecatedAlias('Defaults', \OCP\Defaults::class);
1279 1279
 
1280
-		$this->registerService(\OCP\ISession::class, function (SimpleContainer $c) {
1280
+		$this->registerService(\OCP\ISession::class, function(SimpleContainer $c) {
1281 1281
 			return $c->query(\OCP\IUserSession::class)->getSession();
1282 1282
 		});
1283 1283
 
1284
-		$this->registerService(IShareHelper::class, function (Server $c) {
1284
+		$this->registerService(IShareHelper::class, function(Server $c) {
1285 1285
 			return new ShareHelper(
1286 1286
 				$c->query(\OCP\Share\IManager::class)
1287 1287
 			);
1288 1288
 		});
1289 1289
 
1290
-		$this->registerService(Installer::class, function (Server $c) {
1290
+		$this->registerService(Installer::class, function(Server $c) {
1291 1291
 			return new Installer(
1292 1292
 				$c->getAppFetcher(),
1293 1293
 				$c->getHTTPClientService(),
@@ -1298,11 +1298,11 @@  discard block
 block discarded – undo
1298 1298
 			);
1299 1299
 		});
1300 1300
 
1301
-		$this->registerService(IApiFactory::class, function (Server $c) {
1301
+		$this->registerService(IApiFactory::class, function(Server $c) {
1302 1302
 			return new ApiFactory($c->getHTTPClientService());
1303 1303
 		});
1304 1304
 
1305
-		$this->registerService(IInstanceFactory::class, function (Server $c) {
1305
+		$this->registerService(IInstanceFactory::class, function(Server $c) {
1306 1306
 			$memcacheFactory = $c->getMemCacheFactory();
1307 1307
 			return new InstanceFactory($memcacheFactory->createLocal('remoteinstance.'), $c->getHTTPClientService());
1308 1308
 		});
@@ -1359,7 +1359,7 @@  discard block
 block discarded – undo
1359 1359
 		$dispatcher = $this->get(SymfonyAdapter::class);
1360 1360
 
1361 1361
 		// Delete avatar on user deletion
1362
-		$dispatcher->addListener('OCP\IUser::preDelete', function (GenericEvent $e) {
1362
+		$dispatcher->addListener('OCP\IUser::preDelete', function(GenericEvent $e) {
1363 1363
 			$logger = $this->get(ILogger::class);
1364 1364
 			$manager = $this->getAvatarManager();
1365 1365
 			/** @var IUser $user */
@@ -1372,11 +1372,11 @@  discard block
 block discarded – undo
1372 1372
 				// no avatar to remove
1373 1373
 			} catch (\Exception $e) {
1374 1374
 				// Ignore exceptions
1375
-				$logger->info('Could not cleanup avatar of ' . $user->getUID());
1375
+				$logger->info('Could not cleanup avatar of '.$user->getUID());
1376 1376
 			}
1377 1377
 		});
1378 1378
 
1379
-		$dispatcher->addListener('OCP\IUser::changeUser', function (GenericEvent $e) {
1379
+		$dispatcher->addListener('OCP\IUser::changeUser', function(GenericEvent $e) {
1380 1380
 			$manager = $this->getAvatarManager();
1381 1381
 			/** @var IUser $user */
1382 1382
 			$user = $e->getSubject();
@@ -2283,11 +2283,11 @@  discard block
 block discarded – undo
2283 2283
 	}
2284 2284
 
2285 2285
 	private function registerDeprecatedAlias(string $alias, string $target) {
2286
-		$this->registerService($alias, function (ContainerInterface $container) use ($target, $alias) {
2286
+		$this->registerService($alias, function(ContainerInterface $container) use ($target, $alias) {
2287 2287
 			try {
2288 2288
 				/** @var ILogger $logger */
2289 2289
 				$logger = $container->get(ILogger::class);
2290
-				$logger->debug('The requested alias "' . $alias . '" is depreacted. Please request "' . $target . '" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']);
2290
+				$logger->debug('The requested alias "'.$alias.'" is depreacted. Please request "'.$target.'" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']);
2291 2291
 			} catch (ContainerExceptionInterface $e) {
2292 2292
 				// Could not get logger. Continue
2293 2293
 			}
Please login to merge, or discard this patch.