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