Passed
Push — master ( b12d36...33aeef )
by Christoph
12:02 queued 11s
created
lib/private/ServerContainer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 
104 104
 		if (isset($this->namespaces[$namespace])) {
105 105
 			if (!isset($this->hasNoAppContainer[$namespace])) {
106
-				$applicationClassName = 'OCA\\' . $sensitiveNamespace . '\\AppInfo\\Application';
106
+				$applicationClassName = 'OCA\\'.$sensitiveNamespace.'\\AppInfo\\Application';
107 107
 				if (class_exists($applicationClassName)) {
108 108
 					$app = new $applicationClassName();
109 109
 					if (isset($this->appContainers[$namespace])) {
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 		}
160 160
 
161 161
 		try {
162
-			[,$namespace,] = explode('\\', $id);
162
+			[,$namespace, ] = explode('\\', $id);
163 163
 			return $this->getAppContainer(strtolower($namespace), $namespace);
164 164
 		} catch (QueryException $e) {
165 165
 			return null;
Please login to merge, or discard this patch.
lib/private/Server.php 1 patch
Spacing   +123 added lines, -123 removed lines patch added patch discarded remove patch
@@ -257,10 +257,10 @@  discard block
 block discarded – undo
257 257
 		// To find out if we are running from CLI or not
258 258
 		$this->registerParameter('isCLI', \OC::$CLI);
259 259
 
260
-		$this->registerService(ContainerInterface::class, function (ContainerInterface $c) {
260
+		$this->registerService(ContainerInterface::class, function(ContainerInterface $c) {
261 261
 			return $c;
262 262
 		});
263
-		$this->registerService(\OCP\IServerContainer::class, function (ContainerInterface $c) {
263
+		$this->registerService(\OCP\IServerContainer::class, function(ContainerInterface $c) {
264 264
 			return $c;
265 265
 		});
266 266
 
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 		$this->registerAlias(IActionFactory::class, ActionFactory::class);
282 282
 
283 283
 
284
-		$this->registerService(IPreview::class, function (Server $c) {
284
+		$this->registerService(IPreview::class, function(Server $c) {
285 285
 			return new PreviewManager(
286 286
 				$c->getConfig(),
287 287
 				$c->getRootFolder(),
@@ -293,13 +293,13 @@  discard block
 block discarded – undo
293 293
 		});
294 294
 		$this->registerDeprecatedAlias('PreviewManager', IPreview::class);
295 295
 
296
-		$this->registerService(\OC\Preview\Watcher::class, function (Server $c) {
296
+		$this->registerService(\OC\Preview\Watcher::class, function(Server $c) {
297 297
 			return new \OC\Preview\Watcher(
298 298
 				new \OC\Preview\Storage\Root($c->getRootFolder(), $c->getSystemConfig(), 'preview')
299 299
 			);
300 300
 		});
301 301
 
302
-		$this->registerService(\OCP\Encryption\IManager::class, function (Server $c) {
302
+		$this->registerService(\OCP\Encryption\IManager::class, function(Server $c) {
303 303
 			$view = new View();
304 304
 			$util = new Encryption\Util(
305 305
 				$view,
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 		});
319 319
 		$this->registerDeprecatedAlias('EncryptionManager', \OCP\Encryption\IManager::class);
320 320
 
321
-		$this->registerService('EncryptionFileHelper', function (Server $c) {
321
+		$this->registerService('EncryptionFileHelper', function(Server $c) {
322 322
 			$util = new Encryption\Util(
323 323
 				new View(),
324 324
 				$c->getUserManager(),
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 			);
333 333
 		});
334 334
 
335
-		$this->registerService('EncryptionKeyStorage', function (Server $c) {
335
+		$this->registerService('EncryptionKeyStorage', function(Server $c) {
336 336
 			$view = new View();
337 337
 			$util = new Encryption\Util(
338 338
 				$view,
@@ -343,30 +343,30 @@  discard block
 block discarded – undo
343 343
 
344 344
 			return new Encryption\Keys\Storage($view, $util);
345 345
 		});
346
-		$this->registerService('TagMapper', function (Server $c) {
346
+		$this->registerService('TagMapper', function(Server $c) {
347 347
 			return new TagMapper($c->getDatabaseConnection());
348 348
 		});
349 349
 
350
-		$this->registerService(\OCP\ITagManager::class, function (Server $c) {
350
+		$this->registerService(\OCP\ITagManager::class, function(Server $c) {
351 351
 			$tagMapper = $c->query('TagMapper');
352 352
 			return new TagManager($tagMapper, $c->getUserSession());
353 353
 		});
354 354
 		$this->registerDeprecatedAlias('TagManager', \OCP\ITagManager::class);
355 355
 
356
-		$this->registerService('SystemTagManagerFactory', function (Server $c) {
356
+		$this->registerService('SystemTagManagerFactory', function(Server $c) {
357 357
 			$config = $c->getConfig();
358 358
 			$factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class);
359 359
 			return new $factoryClass($this);
360 360
 		});
361
-		$this->registerService(ISystemTagManager::class, function (Server $c) {
361
+		$this->registerService(ISystemTagManager::class, function(Server $c) {
362 362
 			return $c->query('SystemTagManagerFactory')->getManager();
363 363
 		});
364 364
 		$this->registerDeprecatedAlias('SystemTagManager', ISystemTagManager::class);
365 365
 
366
-		$this->registerService(ISystemTagObjectMapper::class, function (Server $c) {
366
+		$this->registerService(ISystemTagObjectMapper::class, function(Server $c) {
367 367
 			return $c->query('SystemTagManagerFactory')->getObjectMapper();
368 368
 		});
369
-		$this->registerService('RootFolder', function (Server $c) {
369
+		$this->registerService('RootFolder', function(Server $c) {
370 370
 			$manager = \OC\Files\Filesystem::getMountManager(null);
371 371
 			$view = new View();
372 372
 			$root = new Root(
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 
384 384
 			return $root;
385 385
 		});
386
-		$this->registerService(HookConnector::class, function (Server $c) {
386
+		$this->registerService(HookConnector::class, function(Server $c) {
387 387
 			return new HookConnector(
388 388
 				$c->query(IRootFolder::class),
389 389
 				new View(),
@@ -394,8 +394,8 @@  discard block
 block discarded – undo
394 394
 
395 395
 		$this->registerDeprecatedAlias('SystemTagObjectMapper', ISystemTagObjectMapper::class);
396 396
 
397
-		$this->registerService(IRootFolder::class, function (Server $c) {
398
-			return new LazyRoot(function () use ($c) {
397
+		$this->registerService(IRootFolder::class, function(Server $c) {
398
+			return new LazyRoot(function() use ($c) {
399 399
 				return $c->query('RootFolder');
400 400
 			});
401 401
 		});
@@ -404,44 +404,44 @@  discard block
 block discarded – undo
404 404
 		$this->registerDeprecatedAlias('UserManager', \OC\User\Manager::class);
405 405
 		$this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class);
406 406
 
407
-		$this->registerService(\OCP\IGroupManager::class, function (Server $c) {
407
+		$this->registerService(\OCP\IGroupManager::class, function(Server $c) {
408 408
 			$groupManager = new \OC\Group\Manager($this->getUserManager(), $c->getEventDispatcher(), $this->getLogger());
409
-			$groupManager->listen('\OC\Group', 'preCreate', function ($gid) {
409
+			$groupManager->listen('\OC\Group', 'preCreate', function($gid) {
410 410
 				\OC_Hook::emit('OC_Group', 'pre_createGroup', ['run' => true, 'gid' => $gid]);
411 411
 
412 412
 				/** @var IEventDispatcher $dispatcher */
413 413
 				$dispatcher = $this->query(IEventDispatcher::class);
414 414
 				$dispatcher->dispatchTyped(new BeforeGroupCreatedEvent($gid));
415 415
 			});
416
-			$groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $group) {
416
+			$groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $group) {
417 417
 				\OC_Hook::emit('OC_User', 'post_createGroup', ['gid' => $group->getGID()]);
418 418
 
419 419
 				/** @var IEventDispatcher $dispatcher */
420 420
 				$dispatcher = $this->query(IEventDispatcher::class);
421 421
 				$dispatcher->dispatchTyped(new GroupCreatedEvent($group));
422 422
 			});
423
-			$groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) {
423
+			$groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) {
424 424
 				\OC_Hook::emit('OC_Group', 'pre_deleteGroup', ['run' => true, 'gid' => $group->getGID()]);
425 425
 
426 426
 				/** @var IEventDispatcher $dispatcher */
427 427
 				$dispatcher = $this->query(IEventDispatcher::class);
428 428
 				$dispatcher->dispatchTyped(new BeforeGroupDeletedEvent($group));
429 429
 			});
430
-			$groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) {
430
+			$groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) {
431 431
 				\OC_Hook::emit('OC_User', 'post_deleteGroup', ['gid' => $group->getGID()]);
432 432
 
433 433
 				/** @var IEventDispatcher $dispatcher */
434 434
 				$dispatcher = $this->query(IEventDispatcher::class);
435 435
 				$dispatcher->dispatchTyped(new GroupDeletedEvent($group));
436 436
 			});
437
-			$groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
437
+			$groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) {
438 438
 				\OC_Hook::emit('OC_Group', 'pre_addToGroup', ['run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID()]);
439 439
 
440 440
 				/** @var IEventDispatcher $dispatcher */
441 441
 				$dispatcher = $this->query(IEventDispatcher::class);
442 442
 				$dispatcher->dispatchTyped(new BeforeUserAddedEvent($group, $user));
443 443
 			});
444
-			$groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
444
+			$groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) {
445 445
 				\OC_Hook::emit('OC_Group', 'post_addToGroup', ['uid' => $user->getUID(), 'gid' => $group->getGID()]);
446 446
 				//Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks
447 447
 				\OC_Hook::emit('OC_User', 'post_addToGroup', ['uid' => $user->getUID(), 'gid' => $group->getGID()]);
@@ -450,12 +450,12 @@  discard block
 block discarded – undo
450 450
 				$dispatcher = $this->query(IEventDispatcher::class);
451 451
 				$dispatcher->dispatchTyped(new UserAddedEvent($group, $user));
452 452
 			});
453
-			$groupManager->listen('\OC\Group', 'preRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) {
453
+			$groupManager->listen('\OC\Group', 'preRemoveUser', function(\OC\Group\Group $group, \OC\User\User $user) {
454 454
 				/** @var IEventDispatcher $dispatcher */
455 455
 				$dispatcher = $this->query(IEventDispatcher::class);
456 456
 				$dispatcher->dispatchTyped(new BeforeUserRemovedEvent($group, $user));
457 457
 			});
458
-			$groupManager->listen('\OC\Group', 'postRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) {
458
+			$groupManager->listen('\OC\Group', 'postRemoveUser', function(\OC\Group\Group $group, \OC\User\User $user) {
459 459
 				/** @var IEventDispatcher $dispatcher */
460 460
 				$dispatcher = $this->query(IEventDispatcher::class);
461 461
 				$dispatcher->dispatchTyped(new UserRemovedEvent($group, $user));
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
 		});
465 465
 		$this->registerDeprecatedAlias('GroupManager', \OCP\IGroupManager::class);
466 466
 
467
-		$this->registerService(Store::class, function (Server $c) {
467
+		$this->registerService(Store::class, function(Server $c) {
468 468
 			$session = $c->getSession();
469 469
 			if (\OC::$server->getSystemConfig()->getValue('installed', false)) {
470 470
 				$tokenProvider = $c->query(IProvider::class);
@@ -475,13 +475,13 @@  discard block
 block discarded – undo
475 475
 			return new Store($session, $logger, $tokenProvider);
476 476
 		});
477 477
 		$this->registerAlias(IStore::class, Store::class);
478
-		$this->registerService(Authentication\Token\DefaultTokenMapper::class, function (Server $c) {
478
+		$this->registerService(Authentication\Token\DefaultTokenMapper::class, function(Server $c) {
479 479
 			$dbConnection = $c->getDatabaseConnection();
480 480
 			return new Authentication\Token\DefaultTokenMapper($dbConnection);
481 481
 		});
482 482
 		$this->registerAlias(IProvider::class, Authentication\Token\Manager::class);
483 483
 
484
-		$this->registerService(\OC\User\Session::class, function (Server $c) {
484
+		$this->registerService(\OC\User\Session::class, function(Server $c) {
485 485
 			$manager = $c->getUserManager();
486 486
 			$session = new \OC\Session\Memory('');
487 487
 			$timeFactory = new TimeFactory();
@@ -506,14 +506,14 @@  discard block
 block discarded – undo
506 506
 				$c->getLogger(),
507 507
 				$c->query(IEventDispatcher::class)
508 508
 			);
509
-			$userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) {
509
+			$userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) {
510 510
 				\OC_Hook::emit('OC_User', 'pre_createUser', ['run' => true, 'uid' => $uid, 'password' => $password]);
511 511
 
512 512
 				/** @var IEventDispatcher $dispatcher */
513 513
 				$dispatcher = $this->query(IEventDispatcher::class);
514 514
 				$dispatcher->dispatchTyped(new BeforeUserCreatedEvent($uid, $password));
515 515
 			});
516
-			$userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) {
516
+			$userSession->listen('\OC\User', 'postCreateUser', function($user, $password) {
517 517
 				/** @var $user \OC\User\User */
518 518
 				\OC_Hook::emit('OC_User', 'post_createUser', ['uid' => $user->getUID(), 'password' => $password]);
519 519
 
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
 				$dispatcher = $this->query(IEventDispatcher::class);
522 522
 				$dispatcher->dispatchTyped(new UserCreatedEvent($user, $password));
523 523
 			});
524
-			$userSession->listen('\OC\User', 'preDelete', function ($user) use ($legacyDispatcher) {
524
+			$userSession->listen('\OC\User', 'preDelete', function($user) use ($legacyDispatcher) {
525 525
 				/** @var $user \OC\User\User */
526 526
 				\OC_Hook::emit('OC_User', 'pre_deleteUser', ['run' => true, 'uid' => $user->getUID()]);
527 527
 				$legacyDispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user));
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
 				$dispatcher = $this->query(IEventDispatcher::class);
531 531
 				$dispatcher->dispatchTyped(new BeforeUserDeletedEvent($user));
532 532
 			});
533
-			$userSession->listen('\OC\User', 'postDelete', function ($user) {
533
+			$userSession->listen('\OC\User', 'postDelete', function($user) {
534 534
 				/** @var $user \OC\User\User */
535 535
 				\OC_Hook::emit('OC_User', 'post_deleteUser', ['uid' => $user->getUID()]);
536 536
 
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
 				$dispatcher = $this->query(IEventDispatcher::class);
539 539
 				$dispatcher->dispatchTyped(new UserDeletedEvent($user));
540 540
 			});
541
-			$userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) {
541
+			$userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) {
542 542
 				/** @var $user \OC\User\User */
543 543
 				\OC_Hook::emit('OC_User', 'pre_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]);
544 544
 
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
 				$dispatcher = $this->query(IEventDispatcher::class);
547 547
 				$dispatcher->dispatchTyped(new BeforePasswordUpdatedEvent($user, $password, $recoveryPassword));
548 548
 			});
549
-			$userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) {
549
+			$userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) {
550 550
 				/** @var $user \OC\User\User */
551 551
 				\OC_Hook::emit('OC_User', 'post_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]);
552 552
 
@@ -554,14 +554,14 @@  discard block
 block discarded – undo
554 554
 				$dispatcher = $this->query(IEventDispatcher::class);
555 555
 				$dispatcher->dispatchTyped(new PasswordUpdatedEvent($user, $password, $recoveryPassword));
556 556
 			});
557
-			$userSession->listen('\OC\User', 'preLogin', function ($uid, $password) {
557
+			$userSession->listen('\OC\User', 'preLogin', function($uid, $password) {
558 558
 				\OC_Hook::emit('OC_User', 'pre_login', ['run' => true, 'uid' => $uid, 'password' => $password]);
559 559
 
560 560
 				/** @var IEventDispatcher $dispatcher */
561 561
 				$dispatcher = $this->query(IEventDispatcher::class);
562 562
 				$dispatcher->dispatchTyped(new BeforeUserLoggedInEvent($uid, $password));
563 563
 			});
564
-			$userSession->listen('\OC\User', 'postLogin', function ($user, $password, $isTokenLogin) {
564
+			$userSession->listen('\OC\User', 'postLogin', function($user, $password, $isTokenLogin) {
565 565
 				/** @var $user \OC\User\User */
566 566
 				\OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'isTokenLogin' => $isTokenLogin]);
567 567
 
@@ -569,12 +569,12 @@  discard block
 block discarded – undo
569 569
 				$dispatcher = $this->query(IEventDispatcher::class);
570 570
 				$dispatcher->dispatchTyped(new UserLoggedInEvent($user, $password, $isTokenLogin));
571 571
 			});
572
-			$userSession->listen('\OC\User', 'preRememberedLogin', function ($uid) {
572
+			$userSession->listen('\OC\User', 'preRememberedLogin', function($uid) {
573 573
 				/** @var IEventDispatcher $dispatcher */
574 574
 				$dispatcher = $this->query(IEventDispatcher::class);
575 575
 				$dispatcher->dispatchTyped(new BeforeUserLoggedInWithCookieEvent($uid));
576 576
 			});
577
-			$userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) {
577
+			$userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) {
578 578
 				/** @var $user \OC\User\User */
579 579
 				\OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'password' => $password]);
580 580
 
@@ -582,19 +582,19 @@  discard block
 block discarded – undo
582 582
 				$dispatcher = $this->query(IEventDispatcher::class);
583 583
 				$dispatcher->dispatchTyped(new UserLoggedInWithCookieEvent($user, $password));
584 584
 			});
585
-			$userSession->listen('\OC\User', 'logout', function ($user) {
585
+			$userSession->listen('\OC\User', 'logout', function($user) {
586 586
 				\OC_Hook::emit('OC_User', 'logout', []);
587 587
 
588 588
 				/** @var IEventDispatcher $dispatcher */
589 589
 				$dispatcher = $this->query(IEventDispatcher::class);
590 590
 				$dispatcher->dispatchTyped(new BeforeUserLoggedOutEvent($user));
591 591
 			});
592
-			$userSession->listen('\OC\User', 'postLogout', function ($user) {
592
+			$userSession->listen('\OC\User', 'postLogout', function($user) {
593 593
 				/** @var IEventDispatcher $dispatcher */
594 594
 				$dispatcher = $this->query(IEventDispatcher::class);
595 595
 				$dispatcher->dispatchTyped(new UserLoggedOutEvent($user));
596 596
 			});
597
-			$userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) {
597
+			$userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) {
598 598
 				/** @var $user \OC\User\User */
599 599
 				\OC_Hook::emit('OC_User', 'changeUser', ['run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue]);
600 600
 
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
 		$this->registerAlias(INavigationManager::class, \OC\NavigationManager::class);
613 613
 		$this->registerDeprecatedAlias('NavigationManager', INavigationManager::class);
614 614
 
615
-		$this->registerService(\OC\AllConfig::class, function (Server $c) {
615
+		$this->registerService(\OC\AllConfig::class, function(Server $c) {
616 616
 			return new \OC\AllConfig(
617 617
 				$c->getSystemConfig()
618 618
 			);
@@ -620,18 +620,18 @@  discard block
 block discarded – undo
620 620
 		$this->registerDeprecatedAlias('AllConfig', \OC\AllConfig::class);
621 621
 		$this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class);
622 622
 
623
-		$this->registerService(\OC\SystemConfig::class, function ($c) use ($config) {
623
+		$this->registerService(\OC\SystemConfig::class, function($c) use ($config) {
624 624
 			return new \OC\SystemConfig($config);
625 625
 		});
626 626
 		$this->registerDeprecatedAlias('SystemConfig', \OC\SystemConfig::class);
627 627
 
628
-		$this->registerService(\OC\AppConfig::class, function (Server $c) {
628
+		$this->registerService(\OC\AppConfig::class, function(Server $c) {
629 629
 			return new \OC\AppConfig($c->getDatabaseConnection());
630 630
 		});
631 631
 		$this->registerDeprecatedAlias('AppConfig', \OC\AppConfig::class);
632 632
 		$this->registerAlias(IAppConfig::class, \OC\AppConfig::class);
633 633
 
634
-		$this->registerService(IFactory::class, function (Server $c) {
634
+		$this->registerService(IFactory::class, function(Server $c) {
635 635
 			return new \OC\L10N\Factory(
636 636
 				$c->getConfig(),
637 637
 				$c->getRequest(),
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
 		});
642 642
 		$this->registerDeprecatedAlias('L10NFactory', IFactory::class);
643 643
 
644
-		$this->registerService(IURLGenerator::class, function (Server $c) {
644
+		$this->registerService(IURLGenerator::class, function(Server $c) {
645 645
 			$config = $c->getConfig();
646 646
 			$cacheFactory = $c->getMemCacheFactory();
647 647
 			$request = $c->getRequest();
@@ -656,12 +656,12 @@  discard block
 block discarded – undo
656 656
 		$this->registerDeprecatedAlias('AppFetcher', AppFetcher::class);
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
 		$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),
@@ -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->getSystemConfig();
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
 			return new \OC\Activity\Manager(
697 697
 				$c->getRequest(),
698 698
 				$c->getUserSession(),
@@ -702,14 +702,14 @@  discard block
 block discarded – undo
702 702
 		});
703 703
 		$this->registerDeprecatedAlias('ActivityManager', \OCP\Activity\IManager::class);
704 704
 
705
-		$this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) {
705
+		$this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) {
706 706
 			return new \OC\Activity\EventMerger(
707 707
 				$c->getL10N('lib')
708 708
 			);
709 709
 		});
710 710
 		$this->registerAlias(IValidator::class, Validator::class);
711 711
 
712
-		$this->registerService(AvatarManager::class, function (Server $c) {
712
+		$this->registerService(AvatarManager::class, function(Server $c) {
713 713
 			return new AvatarManager(
714 714
 				$c->query(\OC\User\Manager::class),
715 715
 				$c->getAppDataDir('avatar'),
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
 		$this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class);
725 725
 		$this->registerAlias(\OCP\Support\Subscription\IRegistry::class, \OC\Support\Subscription\Registry::class);
726 726
 
727
-		$this->registerService(\OC\Log::class, function (Server $c) {
727
+		$this->registerService(\OC\Log::class, function(Server $c) {
728 728
 			$logType = $c->query(AllConfig::class)->getSystemValue('log_type', 'file');
729 729
 			$factory = new LogFactory($c, $this->getSystemConfig());
730 730
 			$logger = $factory->get($logType);
@@ -737,11 +737,11 @@  discard block
 block discarded – undo
737 737
 		// PSR-3 logger
738 738
 		$this->registerAlias(LoggerInterface::class, PsrLoggerAdapter::class);
739 739
 
740
-		$this->registerService(ILogFactory::class, function (Server $c) {
740
+		$this->registerService(ILogFactory::class, function(Server $c) {
741 741
 			return new LogFactory($c, $this->getSystemConfig());
742 742
 		});
743 743
 
744
-		$this->registerService(IJobList::class, function (Server $c) {
744
+		$this->registerService(IJobList::class, function(Server $c) {
745 745
 			$config = $c->getConfig();
746 746
 			return new \OC\BackgroundJob\JobList(
747 747
 				$c->getDatabaseConnection(),
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
 		});
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()) {
@@ -763,39 +763,39 @@  discard block
 block discarded – undo
763 763
 		});
764 764
 		$this->registerDeprecatedAlias('Router', IRouter::class);
765 765
 
766
-		$this->registerService(ISearch::class, function ($c) {
766
+		$this->registerService(ISearch::class, function($c) {
767 767
 			return new Search();
768 768
 		});
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()
775 775
 			);
776 776
 		});
777 777
 
778
-		$this->registerService(\OCP\Security\ISecureRandom::class, function ($c) {
778
+		$this->registerService(\OCP\Security\ISecureRandom::class, function($c) {
779 779
 			return new SecureRandom();
780 780
 		});
781 781
 		$this->registerDeprecatedAlias('SecureRandom', \OCP\Security\ISecureRandom::class);
782 782
 
783
-		$this->registerService(ICrypto::class, function (Server $c) {
783
+		$this->registerService(ICrypto::class, function(Server $c) {
784 784
 			return new Crypto($c->getConfig(), $c->getSecureRandom());
785 785
 		});
786 786
 		$this->registerDeprecatedAlias('Crypto', ICrypto::class);
787 787
 
788
-		$this->registerService(IHasher::class, function (Server $c) {
788
+		$this->registerService(IHasher::class, function(Server $c) {
789 789
 			return new Hasher($c->getConfig());
790 790
 		});
791 791
 		$this->registerDeprecatedAlias('Hasher', IHasher::class);
792 792
 
793
-		$this->registerService(ICredentialsManager::class, function (Server $c) {
793
+		$this->registerService(ICredentialsManager::class, function(Server $c) {
794 794
 			return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection());
795 795
 		});
796 796
 		$this->registerDeprecatedAlias('CredentialsManager', ICredentialsManager::class);
797 797
 
798
-		$this->registerService(IDBConnection::class, function (Server $c) {
798
+		$this->registerService(IDBConnection::class, function(Server $c) {
799 799
 			$systemConfig = $c->getSystemConfig();
800 800
 			$factory = new \OC\DB\ConnectionFactory($systemConfig);
801 801
 			$type = $systemConfig->getValue('dbtype', 'sqlite');
@@ -810,7 +810,7 @@  discard block
 block discarded – undo
810 810
 		$this->registerDeprecatedAlias('DatabaseConnection', IDBConnection::class);
811 811
 
812 812
 
813
-		$this->registerService(IClientService::class, function (Server $c) {
813
+		$this->registerService(IClientService::class, function(Server $c) {
814 814
 			$user = \OC_User::getUser();
815 815
 			$uid = $user ? $user : null;
816 816
 			return new ClientService(
@@ -826,7 +826,7 @@  discard block
 block discarded – undo
826 826
 			);
827 827
 		});
828 828
 		$this->registerDeprecatedAlias('HttpClientService', IClientService::class);
829
-		$this->registerService(IEventLogger::class, function (Server $c) {
829
+		$this->registerService(IEventLogger::class, function(Server $c) {
830 830
 			$eventLogger = new EventLogger();
831 831
 			if ($c->getSystemConfig()->getValue('debug', false)) {
832 832
 				// In debug mode, module is being activated by default
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
 		});
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
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
 		});
847 847
 		$this->registerDeprecatedAlias('QueryLogger', IQueryLogger::class);
848 848
 
849
-		$this->registerService(TempManager::class, function (Server $c) {
849
+		$this->registerService(TempManager::class, function(Server $c) {
850 850
 			return new TempManager(
851 851
 				$c->getLogger(),
852 852
 				$c->getConfig()
@@ -855,7 +855,7 @@  discard block
 block discarded – undo
855 855
 		$this->registerDeprecatedAlias('TempManager', TempManager::class);
856 856
 		$this->registerAlias(ITempManager::class, TempManager::class);
857 857
 
858
-		$this->registerService(AppManager::class, function (Server $c) {
858
+		$this->registerService(AppManager::class, function(Server $c) {
859 859
 			return new \OC\App\AppManager(
860 860
 				$c->getUserSession(),
861 861
 				$c->getConfig(),
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
 		$this->registerDeprecatedAlias('AppManager', AppManager::class);
870 870
 		$this->registerAlias(IAppManager::class, AppManager::class);
871 871
 
872
-		$this->registerService(IDateTimeZone::class, function (Server $c) {
872
+		$this->registerService(IDateTimeZone::class, function(Server $c) {
873 873
 			return new DateTimeZone(
874 874
 				$c->getConfig(),
875 875
 				$c->getSession()
@@ -877,7 +877,7 @@  discard block
 block discarded – undo
877 877
 		});
878 878
 		$this->registerDeprecatedAlias('DateTimeZone', IDateTimeZone::class);
879 879
 
880
-		$this->registerService(IDateTimeFormatter::class, function (Server $c) {
880
+		$this->registerService(IDateTimeFormatter::class, function(Server $c) {
881 881
 			$language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null);
882 882
 
883 883
 			return new DateTimeFormatter(
@@ -887,7 +887,7 @@  discard block
 block discarded – undo
887 887
 		});
888 888
 		$this->registerDeprecatedAlias('DateTimeFormatter', IDateTimeFormatter::class);
889 889
 
890
-		$this->registerService(IUserMountCache::class, function (Server $c) {
890
+		$this->registerService(IUserMountCache::class, function(Server $c) {
891 891
 			$mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger());
892 892
 			$listener = new UserMountCacheListener($mountCache);
893 893
 			$listener->listen($c->getUserManager());
@@ -895,7 +895,7 @@  discard block
 block discarded – undo
895 895
 		});
896 896
 		$this->registerDeprecatedAlias('UserMountCache', IUserMountCache::class);
897 897
 
898
-		$this->registerService(IMountProviderCollection::class, function (Server $c) {
898
+		$this->registerService(IMountProviderCollection::class, function(Server $c) {
899 899
 			$loader = \OC\Files\Filesystem::getLoader();
900 900
 			$mountCache = $c->query(IUserMountCache::class);
901 901
 			$manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache);
@@ -911,10 +911,10 @@  discard block
 block discarded – undo
911 911
 		});
912 912
 		$this->registerDeprecatedAlias('MountConfigManager', IMountProviderCollection::class);
913 913
 
914
-		$this->registerService('IniWrapper', function ($c) {
914
+		$this->registerService('IniWrapper', function($c) {
915 915
 			return new IniGetWrapper();
916 916
 		});
917
-		$this->registerService('AsyncCommandBus', function (Server $c) {
917
+		$this->registerService('AsyncCommandBus', function(Server $c) {
918 918
 			$busClass = $c->getConfig()->getSystemValue('commandbus');
919 919
 			if ($busClass) {
920 920
 				list($app, $class) = explode('::', $busClass, 2);
@@ -929,10 +929,10 @@  discard block
 block discarded – undo
929 929
 				return new CronBus($jobList);
930 930
 			}
931 931
 		});
932
-		$this->registerService('TrustedDomainHelper', function ($c) {
932
+		$this->registerService('TrustedDomainHelper', function($c) {
933 933
 			return new TrustedDomainHelper($this->getConfig());
934 934
 		});
935
-		$this->registerService(Throttler::class, function (Server $c) {
935
+		$this->registerService(Throttler::class, function(Server $c) {
936 936
 			return new Throttler(
937 937
 				$c->getDatabaseConnection(),
938 938
 				new TimeFactory(),
@@ -941,7 +941,7 @@  discard block
 block discarded – undo
941 941
 			);
942 942
 		});
943 943
 		$this->registerDeprecatedAlias('Throttler', Throttler::class);
944
-		$this->registerService('IntegrityCodeChecker', function (Server $c) {
944
+		$this->registerService('IntegrityCodeChecker', function(Server $c) {
945 945
 			// IConfig and IAppManager requires a working database. This code
946 946
 			// might however be called when ownCloud is not yet setup.
947 947
 			if (\OC::$server->getSystemConfig()->getValue('installed', false)) {
@@ -963,7 +963,7 @@  discard block
 block discarded – undo
963 963
 				$c->getMimeTypeDetector()
964 964
 			);
965 965
 		});
966
-		$this->registerService(\OCP\IRequest::class, function ($c) {
966
+		$this->registerService(\OCP\IRequest::class, function($c) {
967 967
 			if (isset($this['urlParams'])) {
968 968
 				$urlParams = $this['urlParams'];
969 969
 			} else {
@@ -999,7 +999,7 @@  discard block
 block discarded – undo
999 999
 		});
1000 1000
 		$this->registerDeprecatedAlias('Request', \OCP\IRequest::class);
1001 1001
 
1002
-		$this->registerService(IMailer::class, function (Server $c) {
1002
+		$this->registerService(IMailer::class, function(Server $c) {
1003 1003
 			return new Mailer(
1004 1004
 				$c->getConfig(),
1005 1005
 				$c->getLogger(),
@@ -1012,7 +1012,7 @@  discard block
 block discarded – undo
1012 1012
 		});
1013 1013
 		$this->registerDeprecatedAlias('Mailer', IMailer::class);
1014 1014
 
1015
-		$this->registerService('LDAPProvider', function (Server $c) {
1015
+		$this->registerService('LDAPProvider', function(Server $c) {
1016 1016
 			$config = $c->getConfig();
1017 1017
 			$factoryClass = $config->getSystemValue('ldapProviderFactory', null);
1018 1018
 			if (is_null($factoryClass)) {
@@ -1022,7 +1022,7 @@  discard block
 block discarded – undo
1022 1022
 			$factory = new $factoryClass($this);
1023 1023
 			return $factory->getLDAPProvider();
1024 1024
 		});
1025
-		$this->registerService(ILockingProvider::class, function (Server $c) {
1025
+		$this->registerService(ILockingProvider::class, function(Server $c) {
1026 1026
 			$ini = $c->getIniWrapper();
1027 1027
 			$config = $c->getConfig();
1028 1028
 			$ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time')));
@@ -1045,31 +1045,31 @@  discard block
 block discarded – undo
1045 1045
 		});
1046 1046
 		$this->registerDeprecatedAlias('LockingProvider', ILockingProvider::class);
1047 1047
 
1048
-		$this->registerService(IMountManager::class, function () {
1048
+		$this->registerService(IMountManager::class, function() {
1049 1049
 			return new \OC\Files\Mount\Manager();
1050 1050
 		});
1051 1051
 		$this->registerDeprecatedAlias('MountManager', IMountManager::class);
1052 1052
 
1053
-		$this->registerService(IMimeTypeDetector::class, function (Server $c) {
1053
+		$this->registerService(IMimeTypeDetector::class, function(Server $c) {
1054 1054
 			return new \OC\Files\Type\Detection(
1055 1055
 				$c->getURLGenerator(),
1056 1056
 				$c->getLogger(),
1057 1057
 				\OC::$configDir,
1058
-				\OC::$SERVERROOT . '/resources/config/'
1058
+				\OC::$SERVERROOT.'/resources/config/'
1059 1059
 			);
1060 1060
 		});
1061 1061
 		$this->registerDeprecatedAlias('MimeTypeDetector', IMimeTypeDetector::class);
1062 1062
 
1063
-		$this->registerService(IMimeTypeLoader::class, function (Server $c) {
1063
+		$this->registerService(IMimeTypeLoader::class, function(Server $c) {
1064 1064
 			return new \OC\Files\Type\Loader(
1065 1065
 				$c->getDatabaseConnection()
1066 1066
 			);
1067 1067
 		});
1068 1068
 		$this->registerDeprecatedAlias('MimeTypeLoader', IMimeTypeLoader::class);
1069
-		$this->registerService(BundleFetcher::class, function () {
1069
+		$this->registerService(BundleFetcher::class, function() {
1070 1070
 			return new BundleFetcher($this->getL10N('lib'));
1071 1071
 		});
1072
-		$this->registerService(\OCP\Notification\IManager::class, function (Server $c) {
1072
+		$this->registerService(\OCP\Notification\IManager::class, function(Server $c) {
1073 1073
 			return new Manager(
1074 1074
 				$c->query(IValidator::class),
1075 1075
 				$c->getLogger()
@@ -1077,26 +1077,26 @@  discard block
 block discarded – undo
1077 1077
 		});
1078 1078
 		$this->registerDeprecatedAlias('NotificationManager', \OCP\Notification\IManager::class);
1079 1079
 
1080
-		$this->registerService(CapabilitiesManager::class, function (Server $c) {
1080
+		$this->registerService(CapabilitiesManager::class, function(Server $c) {
1081 1081
 			$manager = new CapabilitiesManager($c->getLogger());
1082
-			$manager->registerCapability(function () use ($c) {
1082
+			$manager->registerCapability(function() use ($c) {
1083 1083
 				return new \OC\OCS\CoreCapabilities($c->getConfig());
1084 1084
 			});
1085
-			$manager->registerCapability(function () use ($c) {
1085
+			$manager->registerCapability(function() use ($c) {
1086 1086
 				return $c->query(\OC\Security\Bruteforce\Capabilities::class);
1087 1087
 			});
1088 1088
 			return $manager;
1089 1089
 		});
1090 1090
 		$this->registerDeprecatedAlias('CapabilitiesManager', CapabilitiesManager::class);
1091 1091
 
1092
-		$this->registerService(ICommentsManager::class, function (Server $c) {
1092
+		$this->registerService(ICommentsManager::class, function(Server $c) {
1093 1093
 			$config = $c->getConfig();
1094 1094
 			$factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class);
1095 1095
 			/** @var \OCP\Comments\ICommentsManagerFactory $factory */
1096 1096
 			$factory = new $factoryClass($this);
1097 1097
 			$manager = $factory->getManager();
1098 1098
 
1099
-			$manager->registerDisplayNameResolver('user', function ($id) use ($c) {
1099
+			$manager->registerDisplayNameResolver('user', function($id) use ($c) {
1100 1100
 				$manager = $c->getUserManager();
1101 1101
 				$user = $manager->get($id);
1102 1102
 				if (is_null($user)) {
@@ -1112,7 +1112,7 @@  discard block
 block discarded – undo
1112 1112
 		});
1113 1113
 		$this->registerDeprecatedAlias('CommentsManager', ICommentsManager::class);
1114 1114
 
1115
-		$this->registerService('ThemingDefaults', function (Server $c) {
1115
+		$this->registerService('ThemingDefaults', function(Server $c) {
1116 1116
 			/*
1117 1117
 			 * Dark magic for autoloader.
1118 1118
 			 * If we do a class_exists it will try to load the class which will
@@ -1140,7 +1140,7 @@  discard block
 block discarded – undo
1140 1140
 			}
1141 1141
 			return new \OC_Defaults();
1142 1142
 		});
1143
-		$this->registerService(SCSSCacher::class, function (Server $c) {
1143
+		$this->registerService(SCSSCacher::class, function(Server $c) {
1144 1144
 			return new SCSSCacher(
1145 1145
 				$c->getLogger(),
1146 1146
 				$c->query(\OC\Files\AppData\Factory::class),
@@ -1153,7 +1153,7 @@  discard block
 block discarded – undo
1153 1153
 				new TimeFactory()
1154 1154
 			);
1155 1155
 		});
1156
-		$this->registerService(JSCombiner::class, function (Server $c) {
1156
+		$this->registerService(JSCombiner::class, function(Server $c) {
1157 1157
 			return new JSCombiner(
1158 1158
 				$c->getAppDataDir('js'),
1159 1159
 				$c->getURLGenerator(),
@@ -1166,7 +1166,7 @@  discard block
 block discarded – undo
1166 1166
 		$this->registerDeprecatedAlias('EventDispatcher', \OC\EventDispatcher\SymfonyAdapter::class);
1167 1167
 		$this->registerAlias(EventDispatcherInterface::class, \OC\EventDispatcher\SymfonyAdapter::class);
1168 1168
 
1169
-		$this->registerService('CryptoWrapper', function (Server $c) {
1169
+		$this->registerService('CryptoWrapper', function(Server $c) {
1170 1170
 			// FIXME: Instantiiated here due to cyclic dependency
1171 1171
 			$request = new Request(
1172 1172
 				[
@@ -1191,7 +1191,7 @@  discard block
 block discarded – undo
1191 1191
 				$request
1192 1192
 			);
1193 1193
 		});
1194
-		$this->registerService(CsrfTokenManager::class, function (Server $c) {
1194
+		$this->registerService(CsrfTokenManager::class, function(Server $c) {
1195 1195
 			$tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom());
1196 1196
 
1197 1197
 			return new CsrfTokenManager(
@@ -1200,20 +1200,20 @@  discard block
 block discarded – undo
1200 1200
 			);
1201 1201
 		});
1202 1202
 		$this->registerDeprecatedAlias('CsrfTokenManager', CsrfTokenManager::class);
1203
-		$this->registerService(SessionStorage::class, function (Server $c) {
1203
+		$this->registerService(SessionStorage::class, function(Server $c) {
1204 1204
 			return new SessionStorage($c->getSession());
1205 1205
 		});
1206 1206
 		$this->registerAlias(\OCP\Security\IContentSecurityPolicyManager::class, ContentSecurityPolicyManager::class);
1207 1207
 		$this->registerDeprecatedAlias('ContentSecurityPolicyManager', ContentSecurityPolicyManager::class);
1208 1208
 
1209
-		$this->registerService('ContentSecurityPolicyNonceManager', function (Server $c) {
1209
+		$this->registerService('ContentSecurityPolicyNonceManager', function(Server $c) {
1210 1210
 			return new ContentSecurityPolicyNonceManager(
1211 1211
 				$c->getCsrfTokenManager(),
1212 1212
 				$c->getRequest()
1213 1213
 			);
1214 1214
 		});
1215 1215
 
1216
-		$this->registerService(\OCP\Share\IManager::class, function (Server $c) {
1216
+		$this->registerService(\OCP\Share\IManager::class, function(Server $c) {
1217 1217
 			$config = $c->getConfig();
1218 1218
 			$factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class);
1219 1219
 			/** @var \OCP\Share\IProviderFactory $factory */
@@ -1242,7 +1242,7 @@  discard block
 block discarded – undo
1242 1242
 		});
1243 1243
 		$this->registerDeprecatedAlias('ShareManager', \OCP\Share\IManager::class);
1244 1244
 
1245
-		$this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function (Server $c) {
1245
+		$this->registerService(\OCP\Collaboration\Collaborators\ISearch::class, function(Server $c) {
1246 1246
 			$instance = new Collaboration\Collaborators\Search($c);
1247 1247
 
1248 1248
 			// register default plugins
@@ -1262,7 +1262,7 @@  discard block
 block discarded – undo
1262 1262
 		$this->registerAlias(\OCP\Collaboration\Resources\IProviderManager::class, \OC\Collaboration\Resources\ProviderManager::class);
1263 1263
 		$this->registerAlias(\OCP\Collaboration\Resources\IManager::class, \OC\Collaboration\Resources\Manager::class);
1264 1264
 
1265
-		$this->registerService('SettingsManager', function (Server $c) {
1265
+		$this->registerService('SettingsManager', function(Server $c) {
1266 1266
 			$manager = new \OC\Settings\Manager(
1267 1267
 				$c->getLogger(),
1268 1268
 				$c->getL10NFactory(),
@@ -1271,34 +1271,34 @@  discard block
 block discarded – undo
1271 1271
 			);
1272 1272
 			return $manager;
1273 1273
 		});
1274
-		$this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) {
1274
+		$this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) {
1275 1275
 			return new \OC\Files\AppData\Factory(
1276 1276
 				$c->getRootFolder(),
1277 1277
 				$c->getSystemConfig()
1278 1278
 			);
1279 1279
 		});
1280 1280
 
1281
-		$this->registerService('LockdownManager', function (Server $c) {
1282
-			return new LockdownManager(function () use ($c) {
1281
+		$this->registerService('LockdownManager', function(Server $c) {
1282
+			return new LockdownManager(function() use ($c) {
1283 1283
 				return $c->getSession();
1284 1284
 			});
1285 1285
 		});
1286 1286
 
1287
-		$this->registerService(\OCP\OCS\IDiscoveryService::class, function (Server $c) {
1287
+		$this->registerService(\OCP\OCS\IDiscoveryService::class, function(Server $c) {
1288 1288
 			return new DiscoveryService($c->getMemCacheFactory(), $c->getHTTPClientService());
1289 1289
 		});
1290 1290
 
1291
-		$this->registerService(ICloudIdManager::class, function (Server $c) {
1291
+		$this->registerService(ICloudIdManager::class, function(Server $c) {
1292 1292
 			return new CloudIdManager();
1293 1293
 		});
1294 1294
 
1295 1295
 		$this->registerAlias(\OCP\GlobalScale\IConfig::class, \OC\GlobalScale\Config::class);
1296 1296
 
1297
-		$this->registerService(ICloudFederationProviderManager::class, function (Server $c) {
1297
+		$this->registerService(ICloudFederationProviderManager::class, function(Server $c) {
1298 1298
 			return new CloudFederationProviderManager($c->getAppManager(), $c->getHTTPClientService(), $c->getCloudIdManager(), $c->getLogger());
1299 1299
 		});
1300 1300
 
1301
-		$this->registerService(ICloudFederationFactory::class, function (Server $c) {
1301
+		$this->registerService(ICloudFederationFactory::class, function(Server $c) {
1302 1302
 			return new CloudFederationFactory();
1303 1303
 		});
1304 1304
 
@@ -1308,24 +1308,24 @@  discard block
 block discarded – undo
1308 1308
 		$this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class);
1309 1309
 		$this->registerDeprecatedAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class);
1310 1310
 
1311
-		$this->registerService(Defaults::class, function (Server $c) {
1311
+		$this->registerService(Defaults::class, function(Server $c) {
1312 1312
 			return new Defaults(
1313 1313
 				$c->getThemingDefaults()
1314 1314
 			);
1315 1315
 		});
1316 1316
 		$this->registerDeprecatedAlias('Defaults', \OCP\Defaults::class);
1317 1317
 
1318
-		$this->registerService(\OCP\ISession::class, function (SimpleContainer $c) {
1318
+		$this->registerService(\OCP\ISession::class, function(SimpleContainer $c) {
1319 1319
 			return $c->query(\OCP\IUserSession::class)->getSession();
1320 1320
 		});
1321 1321
 
1322
-		$this->registerService(IShareHelper::class, function (Server $c) {
1322
+		$this->registerService(IShareHelper::class, function(Server $c) {
1323 1323
 			return new ShareHelper(
1324 1324
 				$c->query(\OCP\Share\IManager::class)
1325 1325
 			);
1326 1326
 		});
1327 1327
 
1328
-		$this->registerService(Installer::class, function (Server $c) {
1328
+		$this->registerService(Installer::class, function(Server $c) {
1329 1329
 			return new Installer(
1330 1330
 				$c->getAppFetcher(),
1331 1331
 				$c->getHTTPClientService(),
@@ -1336,16 +1336,16 @@  discard block
 block discarded – undo
1336 1336
 			);
1337 1337
 		});
1338 1338
 
1339
-		$this->registerService(IApiFactory::class, function (Server $c) {
1339
+		$this->registerService(IApiFactory::class, function(Server $c) {
1340 1340
 			return new ApiFactory($c->getHTTPClientService());
1341 1341
 		});
1342 1342
 
1343
-		$this->registerService(IInstanceFactory::class, function (Server $c) {
1343
+		$this->registerService(IInstanceFactory::class, function(Server $c) {
1344 1344
 			$memcacheFactory = $c->getMemCacheFactory();
1345 1345
 			return new InstanceFactory($memcacheFactory->createLocal('remoteinstance.'), $c->getHTTPClientService());
1346 1346
 		});
1347 1347
 
1348
-		$this->registerService(IContactsStore::class, function (Server $c) {
1348
+		$this->registerService(IContactsStore::class, function(Server $c) {
1349 1349
 			return new ContactsStore(
1350 1350
 				$c->getContactsManager(),
1351 1351
 				$c->getConfig(),
@@ -1356,7 +1356,7 @@  discard block
 block discarded – undo
1356 1356
 		$this->registerAlias(IContactsStore::class, ContactsStore::class);
1357 1357
 		$this->registerAlias(IAccountManager::class, AccountManager::class);
1358 1358
 
1359
-		$this->registerService(IStorageFactory::class, function () {
1359
+		$this->registerService(IStorageFactory::class, function() {
1360 1360
 			return new StorageFactory();
1361 1361
 		});
1362 1362
 
@@ -1402,7 +1402,7 @@  discard block
 block discarded – undo
1402 1402
 		$dispatcher = $this->getEventDispatcher();
1403 1403
 
1404 1404
 		// Delete avatar on user deletion
1405
-		$dispatcher->addListener('OCP\IUser::preDelete', function (GenericEvent $e) {
1405
+		$dispatcher->addListener('OCP\IUser::preDelete', function(GenericEvent $e) {
1406 1406
 			$logger = $this->getLogger();
1407 1407
 			$manager = $this->getAvatarManager();
1408 1408
 			/** @var IUser $user */
@@ -1415,11 +1415,11 @@  discard block
 block discarded – undo
1415 1415
 				// no avatar to remove
1416 1416
 			} catch (\Exception $e) {
1417 1417
 				// Ignore exceptions
1418
-				$logger->info('Could not cleanup avatar of ' . $user->getUID());
1418
+				$logger->info('Could not cleanup avatar of '.$user->getUID());
1419 1419
 			}
1420 1420
 		});
1421 1421
 
1422
-		$dispatcher->addListener('OCP\IUser::changeUser', function (GenericEvent $e) {
1422
+		$dispatcher->addListener('OCP\IUser::changeUser', function(GenericEvent $e) {
1423 1423
 			$manager = $this->getAvatarManager();
1424 1424
 			/** @var IUser $user */
1425 1425
 			$user = $e->getSubject();
@@ -2236,11 +2236,11 @@  discard block
 block discarded – undo
2236 2236
 	}
2237 2237
 
2238 2238
 	private function registerDeprecatedAlias(string $alias, string $target) {
2239
-		$this->registerService($alias, function (ContainerInterface $container) use ($target, $alias) {
2239
+		$this->registerService($alias, function(ContainerInterface $container) use ($target, $alias) {
2240 2240
 			try {
2241 2241
 				/** @var ILogger $logger */
2242 2242
 				$logger = $container->get(ILogger::class);
2243
-				$logger->debug('The requested alias "' . $alias . '" is depreacted. Please request "' . $target . '" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']);
2243
+				$logger->debug('The requested alias "'.$alias.'" is depreacted. Please request "'.$target.'" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']);
2244 2244
 			} catch (ContainerExceptionInterface $e) {
2245 2245
 				// Could not get logger. Continue
2246 2246
 			}
Please login to merge, or discard this patch.
lib/private/AppFramework/DependencyInjection/DIContainer.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -112,62 +112,62 @@  discard block
 block discarded – undo
112 112
 		/**
113 113
 		 * Core services
114 114
 		 */
115
-		$this->registerService(IOutput::class, function () {
115
+		$this->registerService(IOutput::class, function() {
116 116
 			return new Output($this->getServer()->getWebRoot());
117 117
 		});
118 118
 
119
-		$this->registerService(Folder::class, function () {
119
+		$this->registerService(Folder::class, function() {
120 120
 			return $this->getServer()->getUserFolder();
121 121
 		});
122 122
 
123
-		$this->registerService(IAppData::class, function (ContainerInterface $c) {
123
+		$this->registerService(IAppData::class, function(ContainerInterface $c) {
124 124
 			return $this->getServer()->getAppDataDir($c->get('AppName'));
125 125
 		});
126 126
 
127
-		$this->registerService(IL10N::class, function (ContainerInterface $c) {
127
+		$this->registerService(IL10N::class, function(ContainerInterface $c) {
128 128
 			return $this->getServer()->getL10N($c->get('AppName'));
129 129
 		});
130 130
 
131 131
 		// Log wrapper
132
-		$this->registerService(ILogger::class, function (ContainerInterface $c) {
132
+		$this->registerService(ILogger::class, function(ContainerInterface $c) {
133 133
 			return new OC\AppFramework\Logger($this->server->query(ILogger::class), $c->get('AppName'));
134 134
 		});
135 135
 
136
-		$this->registerService(IServerContainer::class, function () {
136
+		$this->registerService(IServerContainer::class, function() {
137 137
 			return $this->getServer();
138 138
 		});
139 139
 		$this->registerAlias('ServerContainer', IServerContainer::class);
140 140
 
141
-		$this->registerService(\OCP\WorkflowEngine\IManager::class, function (ContainerInterface $c) {
141
+		$this->registerService(\OCP\WorkflowEngine\IManager::class, function(ContainerInterface $c) {
142 142
 			return $c->get(Manager::class);
143 143
 		});
144 144
 
145
-		$this->registerService(ContainerInterface::class, function (ContainerInterface $c) {
145
+		$this->registerService(ContainerInterface::class, function(ContainerInterface $c) {
146 146
 			return $c;
147 147
 		});
148 148
 		$this->registerAlias(IAppContainer::class, ContainerInterface::class);
149 149
 
150 150
 		// commonly used attributes
151
-		$this->registerService('UserId', function (ContainerInterface $c) {
151
+		$this->registerService('UserId', function(ContainerInterface $c) {
152 152
 			return $c->get(IUserSession::class)->getSession()->get('user_id');
153 153
 		});
154 154
 
155
-		$this->registerService('WebRoot', function (ContainerInterface $c) {
155
+		$this->registerService('WebRoot', function(ContainerInterface $c) {
156 156
 			return $c->get(IServerContainer::class)->getWebRoot();
157 157
 		});
158 158
 
159
-		$this->registerService('OC_Defaults', function (ContainerInterface $c) {
159
+		$this->registerService('OC_Defaults', function(ContainerInterface $c) {
160 160
 			return $c->get(IServerContainer::class)->getThemingDefaults();
161 161
 		});
162 162
 
163
-		$this->registerService('Protocol', function (ContainerInterface $c) {
163
+		$this->registerService('Protocol', function(ContainerInterface $c) {
164 164
 			/** @var \OC\Server $server */
165 165
 			$server = $c->get(IServerContainer::class);
166 166
 			$protocol = $server->getRequest()->getHttpProtocol();
167 167
 			return new Http($_SERVER, $protocol);
168 168
 		});
169 169
 
170
-		$this->registerService('Dispatcher', function (ContainerInterface $c) {
170
+		$this->registerService('Dispatcher', function(ContainerInterface $c) {
171 171
 			return new Dispatcher(
172 172
 				$c->get('Protocol'),
173 173
 				$c->get(MiddlewareDispatcher::class),
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 		 * Middleware
188 188
 		 */
189 189
 		$this->registerAlias('MiddlewareDispatcher', MiddlewareDispatcher::class);
190
-		$this->registerService(MiddlewareDispatcher::class, function (ContainerInterface $c) {
190
+		$this->registerService(MiddlewareDispatcher::class, function(ContainerInterface $c) {
191 191
 			$server = $this->getServer();
192 192
 
193 193
 			$dispatcher = new MiddlewareDispatcher();
@@ -303,13 +303,13 @@  discard block
 block discarded – undo
303 303
 			return $dispatcher;
304 304
 		});
305 305
 
306
-		$this->registerService(IAppConfig::class, function (ContainerInterface $c) {
306
+		$this->registerService(IAppConfig::class, function(ContainerInterface $c) {
307 307
 			return new OC\AppFramework\Services\AppConfig(
308 308
 				$c->get(IConfig::class),
309 309
 				$c->get('AppName')
310 310
 			);
311 311
 		});
312
-		$this->registerService(IInitialState::class, function (ContainerInterface $c) {
312
+		$this->registerService(IInitialState::class, function(ContainerInterface $c) {
313 313
 			return new OC\AppFramework\Services\InitialState(
314 314
 				$c->get(IInitialStateService::class),
315 315
 				$c->get('AppName')
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
 	 * @param string $serviceName e.g. 'OCA\Files\Capabilities'
398 398
 	 */
399 399
 	public function registerCapability($serviceName) {
400
-		$this->query('OC\CapabilitiesManager')->registerCapability(function () use ($serviceName) {
400
+		$this->query('OC\CapabilitiesManager')->registerCapability(function() use ($serviceName) {
401 401
 			return $this->query($serviceName);
402 402
 		});
403 403
 	}
@@ -443,11 +443,11 @@  discard block
 block discarded – undo
443 443
 			return parent::query($name);
444 444
 		} elseif ($this['AppName'] === 'core' && strpos($name, 'OC\\Core\\') === 0) {
445 445
 			return parent::query($name);
446
-		} elseif (strpos($name, \OC\AppFramework\App::buildAppNamespace($this['AppName']) . '\\') === 0) {
446
+		} elseif (strpos($name, \OC\AppFramework\App::buildAppNamespace($this['AppName']).'\\') === 0) {
447 447
 			return parent::query($name);
448 448
 		}
449 449
 
450
-		throw new QueryException('Could not resolve ' . $name . '!' .
450
+		throw new QueryException('Could not resolve '.$name.'!'.
451 451
 			' Class can not be instantiated', 1);
452 452
 	}
453 453
 }
Please login to merge, or discard this patch.
lib/private/AppFramework/Utility/SimpleContainer.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 			return $class->newInstance();
74 74
 		}
75 75
 
76
-		return $class->newInstanceArgs(array_map(function (ReflectionParameter $parameter) {
76
+		return $class->newInstanceArgs(array_map(function(ReflectionParameter $parameter) {
77 77
 			$parameterClass = $parameter->getClass();
78 78
 
79 79
 			// try to find out if it is a class or a simple parameter
@@ -103,17 +103,17 @@  discard block
 block discarded – undo
103 103
 	}
104 104
 
105 105
 	public function resolve($name) {
106
-		$baseMsg = 'Could not resolve ' . $name . '!';
106
+		$baseMsg = 'Could not resolve '.$name.'!';
107 107
 		try {
108 108
 			$class = new ReflectionClass($name);
109 109
 			if ($class->isInstantiable()) {
110 110
 				return $this->buildClass($class);
111 111
 			} else {
112
-				throw new QueryException($baseMsg .
112
+				throw new QueryException($baseMsg.
113 113
 					' Class can not be instantiated');
114 114
 			}
115 115
 		} catch (ReflectionException $e) {
116
-			throw new QueryException($baseMsg . ' ' . $e->getMessage());
116
+			throw new QueryException($baseMsg.' '.$e->getMessage());
117 117
 		}
118 118
 	}
119 119
 
@@ -125,13 +125,13 @@  discard block
 block discarded – undo
125 125
 
126 126
 		if ($autoload) {
127 127
 			$object = $this->resolve($name);
128
-			$this->registerService($name, function () use ($object) {
128
+			$this->registerService($name, function() use ($object) {
129 129
 				return $object;
130 130
 			});
131 131
 			return $object;
132 132
 		}
133 133
 
134
-		throw new QueryException('Could not resolve ' . $name . '!');
134
+		throw new QueryException('Could not resolve '.$name.'!');
135 135
 	}
136 136
 
137 137
 	/**
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 	 * @param bool $shared
153 153
 	 */
154 154
 	public function registerService($name, Closure $closure, $shared = true) {
155
-		$wrapped = function () use ($closure) {
155
+		$wrapped = function() use ($closure) {
156 156
 			return $closure($this);
157 157
 		};
158 158
 		$name = $this->sanitizeName($name);
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 	 * @param string $target the target that should be resolved instead
175 175
 	 */
176 176
 	public function registerAlias($alias, $target) {
177
-		$this->registerService($alias, function (ContainerInterface $container) use ($target) {
177
+		$this->registerService($alias, function(ContainerInterface $container) use ($target) {
178 178
 			return $container->get($target);
179 179
 		}, false);
180 180
 	}
Please login to merge, or discard this patch.