Passed
Push — master ( 226415...74ad4c )
by Morris
12:11
created
lib/private/Server.php 1 patch
Spacing   +115 added lines, -115 removed lines patch added patch discarded remove patch
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 		// To find out if we are running from CLI or not
185 185
 		$this->registerParameter('isCLI', \OC::$CLI);
186 186
 
187
-		$this->registerService(\OCP\IServerContainer::class, function (IServerContainer $c) {
187
+		$this->registerService(\OCP\IServerContainer::class, function(IServerContainer $c) {
188 188
 			return $c;
189 189
 		});
190 190
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 		$this->registerAlias(IActionFactory::class, ActionFactory::class);
204 204
 
205 205
 
206
-		$this->registerService(\OCP\IPreview::class, function (Server $c) {
206
+		$this->registerService(\OCP\IPreview::class, function(Server $c) {
207 207
 			return new PreviewManager(
208 208
 				$c->getConfig(),
209 209
 				$c->getRootFolder(),
@@ -214,13 +214,13 @@  discard block
 block discarded – undo
214 214
 		});
215 215
 		$this->registerAlias('PreviewManager', \OCP\IPreview::class);
216 216
 
217
-		$this->registerService(\OC\Preview\Watcher::class, function (Server $c) {
217
+		$this->registerService(\OC\Preview\Watcher::class, function(Server $c) {
218 218
 			return new \OC\Preview\Watcher(
219 219
 				$c->getAppDataDir('preview')
220 220
 			);
221 221
 		});
222 222
 
223
-		$this->registerService(\OCP\Encryption\IManager::class, function (Server $c) {
223
+		$this->registerService(\OCP\Encryption\IManager::class, function(Server $c) {
224 224
 			$view = new View();
225 225
 			$util = new Encryption\Util(
226 226
 				$view,
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 		});
240 240
 		$this->registerAlias('EncryptionManager', \OCP\Encryption\IManager::class);
241 241
 
242
-		$this->registerService('EncryptionFileHelper', function (Server $c) {
242
+		$this->registerService('EncryptionFileHelper', function(Server $c) {
243 243
 			$util = new Encryption\Util(
244 244
 				new View(),
245 245
 				$c->getUserManager(),
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 			);
254 254
 		});
255 255
 
256
-		$this->registerService('EncryptionKeyStorage', function (Server $c) {
256
+		$this->registerService('EncryptionKeyStorage', function(Server $c) {
257 257
 			$view = new View();
258 258
 			$util = new Encryption\Util(
259 259
 				$view,
@@ -264,30 +264,30 @@  discard block
 block discarded – undo
264 264
 
265 265
 			return new Encryption\Keys\Storage($view, $util);
266 266
 		});
267
-		$this->registerService('TagMapper', function (Server $c) {
267
+		$this->registerService('TagMapper', function(Server $c) {
268 268
 			return new TagMapper($c->getDatabaseConnection());
269 269
 		});
270 270
 
271
-		$this->registerService(\OCP\ITagManager::class, function (Server $c) {
271
+		$this->registerService(\OCP\ITagManager::class, function(Server $c) {
272 272
 			$tagMapper = $c->query('TagMapper');
273 273
 			return new TagManager($tagMapper, $c->getUserSession());
274 274
 		});
275 275
 		$this->registerAlias('TagManager', \OCP\ITagManager::class);
276 276
 
277
-		$this->registerService('SystemTagManagerFactory', function (Server $c) {
277
+		$this->registerService('SystemTagManagerFactory', function(Server $c) {
278 278
 			$config = $c->getConfig();
279 279
 			$factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class);
280 280
 			return new $factoryClass($this);
281 281
 		});
282
-		$this->registerService(\OCP\SystemTag\ISystemTagManager::class, function (Server $c) {
282
+		$this->registerService(\OCP\SystemTag\ISystemTagManager::class, function(Server $c) {
283 283
 			return $c->query('SystemTagManagerFactory')->getManager();
284 284
 		});
285 285
 		$this->registerAlias('SystemTagManager', \OCP\SystemTag\ISystemTagManager::class);
286 286
 
287
-		$this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function (Server $c) {
287
+		$this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function(Server $c) {
288 288
 			return $c->query('SystemTagManagerFactory')->getObjectMapper();
289 289
 		});
290
-		$this->registerService('RootFolder', function (Server $c) {
290
+		$this->registerService('RootFolder', function(Server $c) {
291 291
 			$manager = \OC\Files\Filesystem::getMountManager(null);
292 292
 			$view = new View();
293 293
 			$root = new Root(
@@ -308,37 +308,37 @@  discard block
 block discarded – undo
308 308
 		});
309 309
 		$this->registerAlias('SystemTagObjectMapper', \OCP\SystemTag\ISystemTagObjectMapper::class);
310 310
 
311
-		$this->registerService(\OCP\Files\IRootFolder::class, function (Server $c) {
312
-			return new LazyRoot(function () use ($c) {
311
+		$this->registerService(\OCP\Files\IRootFolder::class, function(Server $c) {
312
+			return new LazyRoot(function() use ($c) {
313 313
 				return $c->query('RootFolder');
314 314
 			});
315 315
 		});
316 316
 		$this->registerAlias('LazyRootFolder', \OCP\Files\IRootFolder::class);
317 317
 
318
-		$this->registerService(\OC\User\Manager::class, function (Server $c) {
318
+		$this->registerService(\OC\User\Manager::class, function(Server $c) {
319 319
 			return new \OC\User\Manager($c->getConfig(), $c->getEventDispatcher());
320 320
 		});
321 321
 		$this->registerAlias('UserManager', \OC\User\Manager::class);
322 322
 		$this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class);
323 323
 
324
-		$this->registerService(\OCP\IGroupManager::class, function (Server $c) {
324
+		$this->registerService(\OCP\IGroupManager::class, function(Server $c) {
325 325
 			$groupManager = new \OC\Group\Manager($this->getUserManager(), $c->getEventDispatcher(), $this->getLogger());
326
-			$groupManager->listen('\OC\Group', 'preCreate', function ($gid) {
326
+			$groupManager->listen('\OC\Group', 'preCreate', function($gid) {
327 327
 				\OC_Hook::emit('OC_Group', 'pre_createGroup', array('run' => true, 'gid' => $gid));
328 328
 			});
329
-			$groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $gid) {
329
+			$groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $gid) {
330 330
 				\OC_Hook::emit('OC_User', 'post_createGroup', array('gid' => $gid->getGID()));
331 331
 			});
332
-			$groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) {
332
+			$groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) {
333 333
 				\OC_Hook::emit('OC_Group', 'pre_deleteGroup', array('run' => true, 'gid' => $group->getGID()));
334 334
 			});
335
-			$groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) {
335
+			$groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) {
336 336
 				\OC_Hook::emit('OC_User', 'post_deleteGroup', array('gid' => $group->getGID()));
337 337
 			});
338
-			$groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
338
+			$groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) {
339 339
 				\OC_Hook::emit('OC_Group', 'pre_addToGroup', array('run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID()));
340 340
 			});
341
-			$groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
341
+			$groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) {
342 342
 				\OC_Hook::emit('OC_Group', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID()));
343 343
 				//Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks
344 344
 				\OC_Hook::emit('OC_User', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID()));
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 		});
348 348
 		$this->registerAlias('GroupManager', \OCP\IGroupManager::class);
349 349
 
350
-		$this->registerService(Store::class, function (Server $c) {
350
+		$this->registerService(Store::class, function(Server $c) {
351 351
 			$session = $c->getSession();
352 352
 			if (\OC::$server->getSystemConfig()->getValue('installed', false)) {
353 353
 				$tokenProvider = $c->query(IProvider::class);
@@ -358,13 +358,13 @@  discard block
 block discarded – undo
358 358
 			return new Store($session, $logger, $tokenProvider);
359 359
 		});
360 360
 		$this->registerAlias(IStore::class, Store::class);
361
-		$this->registerService(Authentication\Token\DefaultTokenMapper::class, function (Server $c) {
361
+		$this->registerService(Authentication\Token\DefaultTokenMapper::class, function(Server $c) {
362 362
 			$dbConnection = $c->getDatabaseConnection();
363 363
 			return new Authentication\Token\DefaultTokenMapper($dbConnection);
364 364
 		});
365 365
 		$this->registerAlias(IProvider::class, Authentication\Token\Manager::class);
366 366
 
367
-		$this->registerService(\OC\User\Session::class, function (Server $c) {
367
+		$this->registerService(\OC\User\Session::class, function(Server $c) {
368 368
 			$manager = $c->getUserManager();
369 369
 			$session = new \OC\Session\Memory('');
370 370
 			$timeFactory = new TimeFactory();
@@ -388,45 +388,45 @@  discard block
 block discarded – undo
388 388
 				$c->getLockdownManager(),
389 389
 				$c->getLogger()
390 390
 			);
391
-			$userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) {
391
+			$userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) {
392 392
 				\OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password));
393 393
 			});
394
-			$userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) {
394
+			$userSession->listen('\OC\User', 'postCreateUser', function($user, $password) {
395 395
 				/** @var $user \OC\User\User */
396 396
 				\OC_Hook::emit('OC_User', 'post_createUser', array('uid' => $user->getUID(), 'password' => $password));
397 397
 			});
398
-			$userSession->listen('\OC\User', 'preDelete', function ($user) use ($dispatcher) {
398
+			$userSession->listen('\OC\User', 'preDelete', function($user) use ($dispatcher) {
399 399
 				/** @var $user \OC\User\User */
400 400
 				\OC_Hook::emit('OC_User', 'pre_deleteUser', array('run' => true, 'uid' => $user->getUID()));
401 401
 				$dispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user));
402 402
 			});
403
-			$userSession->listen('\OC\User', 'postDelete', function ($user) {
403
+			$userSession->listen('\OC\User', 'postDelete', function($user) {
404 404
 				/** @var $user \OC\User\User */
405 405
 				\OC_Hook::emit('OC_User', 'post_deleteUser', array('uid' => $user->getUID()));
406 406
 			});
407
-			$userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) {
407
+			$userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) {
408 408
 				/** @var $user \OC\User\User */
409 409
 				\OC_Hook::emit('OC_User', 'pre_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword));
410 410
 			});
411
-			$userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) {
411
+			$userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) {
412 412
 				/** @var $user \OC\User\User */
413 413
 				\OC_Hook::emit('OC_User', 'post_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword));
414 414
 			});
415
-			$userSession->listen('\OC\User', 'preLogin', function ($uid, $password) {
415
+			$userSession->listen('\OC\User', 'preLogin', function($uid, $password) {
416 416
 				\OC_Hook::emit('OC_User', 'pre_login', array('run' => true, 'uid' => $uid, 'password' => $password));
417 417
 			});
418
-			$userSession->listen('\OC\User', 'postLogin', function ($user, $password, $isTokenLogin) {
418
+			$userSession->listen('\OC\User', 'postLogin', function($user, $password, $isTokenLogin) {
419 419
 				/** @var $user \OC\User\User */
420 420
 				\OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'isTokenLogin' => $isTokenLogin));
421 421
 			});
422
-			$userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) {
422
+			$userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) {
423 423
 				/** @var $user \OC\User\User */
424 424
 				\OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password));
425 425
 			});
426
-			$userSession->listen('\OC\User', 'logout', function () {
426
+			$userSession->listen('\OC\User', 'logout', function() {
427 427
 				\OC_Hook::emit('OC_User', 'logout', array());
428 428
 			});
429
-			$userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) {
429
+			$userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) {
430 430
 				/** @var $user \OC\User\User */
431 431
 				\OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue));
432 432
 			});
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
 		$this->registerAlias(\OCP\INavigationManager::class, \OC\NavigationManager::class);
441 441
 		$this->registerAlias('NavigationManager', \OCP\INavigationManager::class);
442 442
 
443
-		$this->registerService(\OC\AllConfig::class, function (Server $c) {
443
+		$this->registerService(\OC\AllConfig::class, function(Server $c) {
444 444
 			return new \OC\AllConfig(
445 445
 				$c->getSystemConfig()
446 446
 			);
@@ -448,17 +448,17 @@  discard block
 block discarded – undo
448 448
 		$this->registerAlias('AllConfig', \OC\AllConfig::class);
449 449
 		$this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class);
450 450
 
451
-		$this->registerService('SystemConfig', function ($c) use ($config) {
451
+		$this->registerService('SystemConfig', function($c) use ($config) {
452 452
 			return new \OC\SystemConfig($config);
453 453
 		});
454 454
 
455
-		$this->registerService(\OC\AppConfig::class, function (Server $c) {
455
+		$this->registerService(\OC\AppConfig::class, function(Server $c) {
456 456
 			return new \OC\AppConfig($c->getDatabaseConnection());
457 457
 		});
458 458
 		$this->registerAlias('AppConfig', \OC\AppConfig::class);
459 459
 		$this->registerAlias(\OCP\IAppConfig::class, \OC\AppConfig::class);
460 460
 
461
-		$this->registerService(\OCP\L10N\IFactory::class, function (Server $c) {
461
+		$this->registerService(\OCP\L10N\IFactory::class, function(Server $c) {
462 462
 			return new \OC\L10N\Factory(
463 463
 				$c->getConfig(),
464 464
 				$c->getRequest(),
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
 		});
469 469
 		$this->registerAlias('L10NFactory', \OCP\L10N\IFactory::class);
470 470
 
471
-		$this->registerService(\OCP\IURLGenerator::class, function (Server $c) {
471
+		$this->registerService(\OCP\IURLGenerator::class, function(Server $c) {
472 472
 			$config = $c->getConfig();
473 473
 			$cacheFactory = $c->getMemCacheFactory();
474 474
 			$request = $c->getRequest();
@@ -483,12 +483,12 @@  discard block
 block discarded – undo
483 483
 		$this->registerAlias('AppFetcher', AppFetcher::class);
484 484
 		$this->registerAlias('CategoryFetcher', CategoryFetcher::class);
485 485
 
486
-		$this->registerService(\OCP\ICache::class, function ($c) {
486
+		$this->registerService(\OCP\ICache::class, function($c) {
487 487
 			return new Cache\File();
488 488
 		});
489 489
 		$this->registerAlias('UserCache', \OCP\ICache::class);
490 490
 
491
-		$this->registerService(Factory::class, function (Server $c) {
491
+		$this->registerService(Factory::class, function(Server $c) {
492 492
 
493 493
 			$arrayCacheFactory = new \OC\Memcache\Factory('', $c->getLogger(),
494 494
 				ArrayCache::class,
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
 				$version = implode(',', $v);
504 504
 				$instanceId = \OC_Util::getInstanceId();
505 505
 				$path = \OC::$SERVERROOT;
506
-				$prefix = md5($instanceId . '-' . $version . '-' . $path);
506
+				$prefix = md5($instanceId.'-'.$version.'-'.$path);
507 507
 				return new \OC\Memcache\Factory($prefix, $c->getLogger(),
508 508
 					$config->getSystemValue('memcache.local', null),
509 509
 					$config->getSystemValue('memcache.distributed', null),
@@ -516,12 +516,12 @@  discard block
 block discarded – undo
516 516
 		$this->registerAlias('MemCacheFactory', Factory::class);
517 517
 		$this->registerAlias(ICacheFactory::class, Factory::class);
518 518
 
519
-		$this->registerService('RedisFactory', function (Server $c) {
519
+		$this->registerService('RedisFactory', function(Server $c) {
520 520
 			$systemConfig = $c->getSystemConfig();
521 521
 			return new RedisFactory($systemConfig);
522 522
 		});
523 523
 
524
-		$this->registerService(\OCP\Activity\IManager::class, function (Server $c) {
524
+		$this->registerService(\OCP\Activity\IManager::class, function(Server $c) {
525 525
 			return new \OC\Activity\Manager(
526 526
 				$c->getRequest(),
527 527
 				$c->getUserSession(),
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
 		});
532 532
 		$this->registerAlias('ActivityManager', \OCP\Activity\IManager::class);
533 533
 
534
-		$this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) {
534
+		$this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) {
535 535
 			return new \OC\Activity\EventMerger(
536 536
 				$c->getL10N('lib')
537 537
 			);
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
 		$this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class);
554 554
 		$this->registerAlias(\OCP\Support\Subscription\IRegistry::class, \OC\Support\Subscription\Registry::class);
555 555
 
556
-		$this->registerService(\OC\Log::class, function (Server $c) {
556
+		$this->registerService(\OC\Log::class, function(Server $c) {
557 557
 			$logType = $c->query('AllConfig')->getSystemValue('log_type', 'file');
558 558
 			$factory = new LogFactory($c, $this->getSystemConfig());
559 559
 			$logger = $factory->get($logType);
@@ -564,11 +564,11 @@  discard block
 block discarded – undo
564 564
 		$this->registerAlias(\OCP\ILogger::class, \OC\Log::class);
565 565
 		$this->registerAlias('Logger', \OC\Log::class);
566 566
 
567
-		$this->registerService(ILogFactory::class, function (Server $c) {
567
+		$this->registerService(ILogFactory::class, function(Server $c) {
568 568
 			return new LogFactory($c, $this->getSystemConfig());
569 569
 		});
570 570
 
571
-		$this->registerService(\OCP\BackgroundJob\IJobList::class, function (Server $c) {
571
+		$this->registerService(\OCP\BackgroundJob\IJobList::class, function(Server $c) {
572 572
 			$config = $c->getConfig();
573 573
 			return new \OC\BackgroundJob\JobList(
574 574
 				$c->getDatabaseConnection(),
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
 		});
579 579
 		$this->registerAlias('JobList', \OCP\BackgroundJob\IJobList::class);
580 580
 
581
-		$this->registerService(\OCP\Route\IRouter::class, function (Server $c) {
581
+		$this->registerService(\OCP\Route\IRouter::class, function(Server $c) {
582 582
 			$cacheFactory = $c->getMemCacheFactory();
583 583
 			$logger = $c->getLogger();
584 584
 			if ($cacheFactory->isLocalCacheAvailable()) {
@@ -590,12 +590,12 @@  discard block
 block discarded – undo
590 590
 		});
591 591
 		$this->registerAlias('Router', \OCP\Route\IRouter::class);
592 592
 
593
-		$this->registerService(\OCP\ISearch::class, function ($c) {
593
+		$this->registerService(\OCP\ISearch::class, function($c) {
594 594
 			return new Search();
595 595
 		});
596 596
 		$this->registerAlias('Search', \OCP\ISearch::class);
597 597
 
598
-		$this->registerService(\OC\Security\RateLimiting\Limiter::class, function (Server $c) {
598
+		$this->registerService(\OC\Security\RateLimiting\Limiter::class, function(Server $c) {
599 599
 			return new \OC\Security\RateLimiting\Limiter(
600 600
 				$this->getUserSession(),
601 601
 				$this->getRequest(),
@@ -603,34 +603,34 @@  discard block
 block discarded – undo
603 603
 				$c->query(\OC\Security\RateLimiting\Backend\IBackend::class)
604 604
 			);
605 605
 		});
606
-		$this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) {
606
+		$this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) {
607 607
 			return new \OC\Security\RateLimiting\Backend\MemoryCache(
608 608
 				$this->getMemCacheFactory(),
609 609
 				new \OC\AppFramework\Utility\TimeFactory()
610 610
 			);
611 611
 		});
612 612
 
613
-		$this->registerService(\OCP\Security\ISecureRandom::class, function ($c) {
613
+		$this->registerService(\OCP\Security\ISecureRandom::class, function($c) {
614 614
 			return new SecureRandom();
615 615
 		});
616 616
 		$this->registerAlias('SecureRandom', \OCP\Security\ISecureRandom::class);
617 617
 
618
-		$this->registerService(\OCP\Security\ICrypto::class, function (Server $c) {
618
+		$this->registerService(\OCP\Security\ICrypto::class, function(Server $c) {
619 619
 			return new Crypto($c->getConfig(), $c->getSecureRandom());
620 620
 		});
621 621
 		$this->registerAlias('Crypto', \OCP\Security\ICrypto::class);
622 622
 
623
-		$this->registerService(\OCP\Security\IHasher::class, function (Server $c) {
623
+		$this->registerService(\OCP\Security\IHasher::class, function(Server $c) {
624 624
 			return new Hasher($c->getConfig());
625 625
 		});
626 626
 		$this->registerAlias('Hasher', \OCP\Security\IHasher::class);
627 627
 
628
-		$this->registerService(\OCP\Security\ICredentialsManager::class, function (Server $c) {
628
+		$this->registerService(\OCP\Security\ICredentialsManager::class, function(Server $c) {
629 629
 			return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection());
630 630
 		});
631 631
 		$this->registerAlias('CredentialsManager', \OCP\Security\ICredentialsManager::class);
632 632
 
633
-		$this->registerService(IDBConnection::class, function (Server $c) {
633
+		$this->registerService(IDBConnection::class, function(Server $c) {
634 634
 			$systemConfig = $c->getSystemConfig();
635 635
 			$factory = new \OC\DB\ConnectionFactory($systemConfig);
636 636
 			$type = $systemConfig->getValue('dbtype', 'sqlite');
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
 		$this->registerAlias('DatabaseConnection', IDBConnection::class);
646 646
 
647 647
 
648
-		$this->registerService(\OCP\Http\Client\IClientService::class, function (Server $c) {
648
+		$this->registerService(\OCP\Http\Client\IClientService::class, function(Server $c) {
649 649
 			$user = \OC_User::getUser();
650 650
 			$uid = $user ? $user : null;
651 651
 			return new ClientService(
@@ -660,7 +660,7 @@  discard block
 block discarded – undo
660 660
 			);
661 661
 		});
662 662
 		$this->registerAlias('HttpClientService', \OCP\Http\Client\IClientService::class);
663
-		$this->registerService(\OCP\Diagnostics\IEventLogger::class, function (Server $c) {
663
+		$this->registerService(\OCP\Diagnostics\IEventLogger::class, function(Server $c) {
664 664
 			$eventLogger = new EventLogger();
665 665
 			if ($c->getSystemConfig()->getValue('debug', false)) {
666 666
 				// In debug mode, module is being activated by default
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
 		});
671 671
 		$this->registerAlias('EventLogger', \OCP\Diagnostics\IEventLogger::class);
672 672
 
673
-		$this->registerService(\OCP\Diagnostics\IQueryLogger::class, function (Server $c) {
673
+		$this->registerService(\OCP\Diagnostics\IQueryLogger::class, function(Server $c) {
674 674
 			$queryLogger = new QueryLogger();
675 675
 			if ($c->getSystemConfig()->getValue('debug', false)) {
676 676
 				// In debug mode, module is being activated by default
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
 		});
681 681
 		$this->registerAlias('QueryLogger', \OCP\Diagnostics\IQueryLogger::class);
682 682
 
683
-		$this->registerService(TempManager::class, function (Server $c) {
683
+		$this->registerService(TempManager::class, function(Server $c) {
684 684
 			return new TempManager(
685 685
 				$c->getLogger(),
686 686
 				$c->getConfig()
@@ -689,7 +689,7 @@  discard block
 block discarded – undo
689 689
 		$this->registerAlias('TempManager', TempManager::class);
690 690
 		$this->registerAlias(ITempManager::class, TempManager::class);
691 691
 
692
-		$this->registerService(AppManager::class, function (Server $c) {
692
+		$this->registerService(AppManager::class, function(Server $c) {
693 693
 			return new \OC\App\AppManager(
694 694
 				$c->getUserSession(),
695 695
 				$c->query(\OC\AppConfig::class),
@@ -701,7 +701,7 @@  discard block
 block discarded – undo
701 701
 		$this->registerAlias('AppManager', AppManager::class);
702 702
 		$this->registerAlias(IAppManager::class, AppManager::class);
703 703
 
704
-		$this->registerService(\OCP\IDateTimeZone::class, function (Server $c) {
704
+		$this->registerService(\OCP\IDateTimeZone::class, function(Server $c) {
705 705
 			return new DateTimeZone(
706 706
 				$c->getConfig(),
707 707
 				$c->getSession()
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
 		});
710 710
 		$this->registerAlias('DateTimeZone', \OCP\IDateTimeZone::class);
711 711
 
712
-		$this->registerService(\OCP\IDateTimeFormatter::class, function (Server $c) {
712
+		$this->registerService(\OCP\IDateTimeFormatter::class, function(Server $c) {
713 713
 			$language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null);
714 714
 
715 715
 			return new DateTimeFormatter(
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
 		});
720 720
 		$this->registerAlias('DateTimeFormatter', \OCP\IDateTimeFormatter::class);
721 721
 
722
-		$this->registerService(\OCP\Files\Config\IUserMountCache::class, function (Server $c) {
722
+		$this->registerService(\OCP\Files\Config\IUserMountCache::class, function(Server $c) {
723 723
 			$mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger());
724 724
 			$listener = new UserMountCacheListener($mountCache);
725 725
 			$listener->listen($c->getUserManager());
@@ -727,7 +727,7 @@  discard block
 block discarded – undo
727 727
 		});
728 728
 		$this->registerAlias('UserMountCache', \OCP\Files\Config\IUserMountCache::class);
729 729
 
730
-		$this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function (Server $c) {
730
+		$this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function(Server $c) {
731 731
 			$loader = \OC\Files\Filesystem::getLoader();
732 732
 			$mountCache = $c->query('UserMountCache');
733 733
 			$manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache);
@@ -743,10 +743,10 @@  discard block
 block discarded – undo
743 743
 		});
744 744
 		$this->registerAlias('MountConfigManager', \OCP\Files\Config\IMountProviderCollection::class);
745 745
 
746
-		$this->registerService('IniWrapper', function ($c) {
746
+		$this->registerService('IniWrapper', function($c) {
747 747
 			return new IniGetWrapper();
748 748
 		});
749
-		$this->registerService('AsyncCommandBus', function (Server $c) {
749
+		$this->registerService('AsyncCommandBus', function(Server $c) {
750 750
 			$busClass = $c->getConfig()->getSystemValue('commandbus');
751 751
 			if ($busClass) {
752 752
 				list($app, $class) = explode('::', $busClass, 2);
@@ -761,10 +761,10 @@  discard block
 block discarded – undo
761 761
 				return new CronBus($jobList);
762 762
 			}
763 763
 		});
764
-		$this->registerService('TrustedDomainHelper', function ($c) {
764
+		$this->registerService('TrustedDomainHelper', function($c) {
765 765
 			return new TrustedDomainHelper($this->getConfig());
766 766
 		});
767
-		$this->registerService(Throttler::class, function (Server $c) {
767
+		$this->registerService(Throttler::class, function(Server $c) {
768 768
 			return new Throttler(
769 769
 				$c->getDatabaseConnection(),
770 770
 				new TimeFactory(),
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
 			);
774 774
 		});
775 775
 		$this->registerAlias('Throttler', Throttler::class);
776
-		$this->registerService('IntegrityCodeChecker', function (Server $c) {
776
+		$this->registerService('IntegrityCodeChecker', function(Server $c) {
777 777
 			// IConfig and IAppManager requires a working database. This code
778 778
 			// might however be called when ownCloud is not yet setup.
779 779
 			if (\OC::$server->getSystemConfig()->getValue('installed', false)) {
@@ -794,7 +794,7 @@  discard block
 block discarded – undo
794 794
 				$c->getTempManager()
795 795
 			);
796 796
 		});
797
-		$this->registerService(\OCP\IRequest::class, function ($c) {
797
+		$this->registerService(\OCP\IRequest::class, function($c) {
798 798
 			if (isset($this['urlParams'])) {
799 799
 				$urlParams = $this['urlParams'];
800 800
 			} else {
@@ -830,7 +830,7 @@  discard block
 block discarded – undo
830 830
 		});
831 831
 		$this->registerAlias('Request', \OCP\IRequest::class);
832 832
 
833
-		$this->registerService(\OCP\Mail\IMailer::class, function (Server $c) {
833
+		$this->registerService(\OCP\Mail\IMailer::class, function(Server $c) {
834 834
 			return new Mailer(
835 835
 				$c->getConfig(),
836 836
 				$c->getLogger(),
@@ -841,7 +841,7 @@  discard block
 block discarded – undo
841 841
 		});
842 842
 		$this->registerAlias('Mailer', \OCP\Mail\IMailer::class);
843 843
 
844
-		$this->registerService('LDAPProvider', function (Server $c) {
844
+		$this->registerService('LDAPProvider', function(Server $c) {
845 845
 			$config = $c->getConfig();
846 846
 			$factoryClass = $config->getSystemValue('ldapProviderFactory', null);
847 847
 			if (is_null($factoryClass)) {
@@ -851,7 +851,7 @@  discard block
 block discarded – undo
851 851
 			$factory = new $factoryClass($this);
852 852
 			return $factory->getLDAPProvider();
853 853
 		});
854
-		$this->registerService(ILockingProvider::class, function (Server $c) {
854
+		$this->registerService(ILockingProvider::class, function(Server $c) {
855 855
 			$ini = $c->getIniWrapper();
856 856
 			$config = $c->getConfig();
857 857
 			$ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time')));
@@ -874,49 +874,49 @@  discard block
 block discarded – undo
874 874
 		});
875 875
 		$this->registerAlias('LockingProvider', ILockingProvider::class);
876 876
 
877
-		$this->registerService(\OCP\Files\Mount\IMountManager::class, function () {
877
+		$this->registerService(\OCP\Files\Mount\IMountManager::class, function() {
878 878
 			return new \OC\Files\Mount\Manager();
879 879
 		});
880 880
 		$this->registerAlias('MountManager', \OCP\Files\Mount\IMountManager::class);
881 881
 
882
-		$this->registerService(\OCP\Files\IMimeTypeDetector::class, function (Server $c) {
882
+		$this->registerService(\OCP\Files\IMimeTypeDetector::class, function(Server $c) {
883 883
 			return new \OC\Files\Type\Detection(
884 884
 				$c->getURLGenerator(),
885 885
 				\OC::$configDir,
886
-				\OC::$SERVERROOT . '/resources/config/'
886
+				\OC::$SERVERROOT.'/resources/config/'
887 887
 			);
888 888
 		});
889 889
 		$this->registerAlias('MimeTypeDetector', \OCP\Files\IMimeTypeDetector::class);
890 890
 
891
-		$this->registerService(\OCP\Files\IMimeTypeLoader::class, function (Server $c) {
891
+		$this->registerService(\OCP\Files\IMimeTypeLoader::class, function(Server $c) {
892 892
 			return new \OC\Files\Type\Loader(
893 893
 				$c->getDatabaseConnection()
894 894
 			);
895 895
 		});
896 896
 		$this->registerAlias('MimeTypeLoader', \OCP\Files\IMimeTypeLoader::class);
897
-		$this->registerService(BundleFetcher::class, function () {
897
+		$this->registerService(BundleFetcher::class, function() {
898 898
 			return new BundleFetcher($this->getL10N('lib'));
899 899
 		});
900
-		$this->registerService(\OCP\Notification\IManager::class, function (Server $c) {
900
+		$this->registerService(\OCP\Notification\IManager::class, function(Server $c) {
901 901
 			return new Manager(
902 902
 				$c->query(IValidator::class)
903 903
 			);
904 904
 		});
905 905
 		$this->registerAlias('NotificationManager', \OCP\Notification\IManager::class);
906 906
 
907
-		$this->registerService(\OC\CapabilitiesManager::class, function (Server $c) {
907
+		$this->registerService(\OC\CapabilitiesManager::class, function(Server $c) {
908 908
 			$manager = new \OC\CapabilitiesManager($c->getLogger());
909
-			$manager->registerCapability(function () use ($c) {
909
+			$manager->registerCapability(function() use ($c) {
910 910
 				return new \OC\OCS\CoreCapabilities($c->getConfig());
911 911
 			});
912
-			$manager->registerCapability(function () use ($c) {
912
+			$manager->registerCapability(function() use ($c) {
913 913
 				return $c->query(\OC\Security\Bruteforce\Capabilities::class);
914 914
 			});
915 915
 			return $manager;
916 916
 		});
917 917
 		$this->registerAlias('CapabilitiesManager', \OC\CapabilitiesManager::class);
918 918
 
919
-		$this->registerService(\OCP\Comments\ICommentsManager::class, function (Server $c) {
919
+		$this->registerService(\OCP\Comments\ICommentsManager::class, function(Server $c) {
920 920
 			$config = $c->getConfig();
921 921
 			$factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class);
922 922
 			/** @var \OCP\Comments\ICommentsManagerFactory $factory */
@@ -926,7 +926,7 @@  discard block
 block discarded – undo
926 926
 			$manager->registerDisplayNameResolver('user', function($id) use ($c) {
927 927
 				$manager = $c->getUserManager();
928 928
 				$user = $manager->get($id);
929
-				if(is_null($user)) {
929
+				if (is_null($user)) {
930 930
 					$l = $c->getL10N('core');
931 931
 					$displayName = $l->t('Unknown user');
932 932
 				} else {
@@ -939,7 +939,7 @@  discard block
 block discarded – undo
939 939
 		});
940 940
 		$this->registerAlias('CommentsManager', \OCP\Comments\ICommentsManager::class);
941 941
 
942
-		$this->registerService('ThemingDefaults', function (Server $c) {
942
+		$this->registerService('ThemingDefaults', function(Server $c) {
943 943
 			/*
944 944
 			 * Dark magic for autoloader.
945 945
 			 * If we do a class_exists it will try to load the class which will
@@ -967,7 +967,7 @@  discard block
 block discarded – undo
967 967
 			}
968 968
 			return new \OC_Defaults();
969 969
 		});
970
-		$this->registerService(SCSSCacher::class, function (Server $c) {
970
+		$this->registerService(SCSSCacher::class, function(Server $c) {
971 971
 			return new SCSSCacher(
972 972
 				$c->getLogger(),
973 973
 				$c->query(\OC\Files\AppData\Factory::class),
@@ -980,7 +980,7 @@  discard block
 block discarded – undo
980 980
 				new TimeFactory()
981 981
 			);
982 982
 		});
983
-		$this->registerService(JSCombiner::class, function (Server $c) {
983
+		$this->registerService(JSCombiner::class, function(Server $c) {
984 984
 			return new JSCombiner(
985 985
 				$c->getAppDataDir('js'),
986 986
 				$c->getURLGenerator(),
@@ -989,13 +989,13 @@  discard block
 block discarded – undo
989 989
 				$c->getLogger()
990 990
 			);
991 991
 		});
992
-		$this->registerService(EventDispatcher::class, function () {
992
+		$this->registerService(EventDispatcher::class, function() {
993 993
 			return new EventDispatcher();
994 994
 		});
995 995
 		$this->registerAlias('EventDispatcher', EventDispatcher::class);
996 996
 		$this->registerAlias(EventDispatcherInterface::class, EventDispatcher::class);
997 997
 
998
-		$this->registerService('CryptoWrapper', function (Server $c) {
998
+		$this->registerService('CryptoWrapper', function(Server $c) {
999 999
 			// FIXME: Instantiiated here due to cyclic dependency
1000 1000
 			$request = new Request(
1001 1001
 				[
@@ -1020,7 +1020,7 @@  discard block
 block discarded – undo
1020 1020
 				$request
1021 1021
 			);
1022 1022
 		});
1023
-		$this->registerService('CsrfTokenManager', function (Server $c) {
1023
+		$this->registerService('CsrfTokenManager', function(Server $c) {
1024 1024
 			$tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom());
1025 1025
 
1026 1026
 			return new CsrfTokenManager(
@@ -1028,22 +1028,22 @@  discard block
 block discarded – undo
1028 1028
 				$c->query(SessionStorage::class)
1029 1029
 			);
1030 1030
 		});
1031
-		$this->registerService(SessionStorage::class, function (Server $c) {
1031
+		$this->registerService(SessionStorage::class, function(Server $c) {
1032 1032
 			return new SessionStorage($c->getSession());
1033 1033
 		});
1034
-		$this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function (Server $c) {
1034
+		$this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function(Server $c) {
1035 1035
 			return new ContentSecurityPolicyManager();
1036 1036
 		});
1037 1037
 		$this->registerAlias('ContentSecurityPolicyManager', \OCP\Security\IContentSecurityPolicyManager::class);
1038 1038
 
1039
-		$this->registerService('ContentSecurityPolicyNonceManager', function (Server $c) {
1039
+		$this->registerService('ContentSecurityPolicyNonceManager', function(Server $c) {
1040 1040
 			return new ContentSecurityPolicyNonceManager(
1041 1041
 				$c->getCsrfTokenManager(),
1042 1042
 				$c->getRequest()
1043 1043
 			);
1044 1044
 		});
1045 1045
 
1046
-		$this->registerService(\OCP\Share\IManager::class, function (Server $c) {
1046
+		$this->registerService(\OCP\Share\IManager::class, function(Server $c) {
1047 1047
 			$config = $c->getConfig();
1048 1048
 			$factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class);
1049 1049
 			/** @var \OCP\Share\IProviderFactory $factory */
@@ -1090,7 +1090,7 @@  discard block
 block discarded – undo
1090 1090
 
1091 1091
 		$this->registerAlias(\OCP\Collaboration\Resources\IManager::class, \OC\Collaboration\Resources\Manager::class);
1092 1092
 
1093
-		$this->registerService('SettingsManager', function (Server $c) {
1093
+		$this->registerService('SettingsManager', function(Server $c) {
1094 1094
 			$manager = new \OC\Settings\Manager(
1095 1095
 				$c->getLogger(),
1096 1096
 				$c->getL10N('lib'),
@@ -1099,36 +1099,36 @@  discard block
 block discarded – undo
1099 1099
 			);
1100 1100
 			return $manager;
1101 1101
 		});
1102
-		$this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) {
1102
+		$this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) {
1103 1103
 			return new \OC\Files\AppData\Factory(
1104 1104
 				$c->getRootFolder(),
1105 1105
 				$c->getSystemConfig()
1106 1106
 			);
1107 1107
 		});
1108 1108
 
1109
-		$this->registerService('LockdownManager', function (Server $c) {
1110
-			return new LockdownManager(function () use ($c) {
1109
+		$this->registerService('LockdownManager', function(Server $c) {
1110
+			return new LockdownManager(function() use ($c) {
1111 1111
 				return $c->getSession();
1112 1112
 			});
1113 1113
 		});
1114 1114
 
1115
-		$this->registerService(\OCP\OCS\IDiscoveryService::class, function (Server $c) {
1115
+		$this->registerService(\OCP\OCS\IDiscoveryService::class, function(Server $c) {
1116 1116
 			return new DiscoveryService($c->getMemCacheFactory(), $c->getHTTPClientService());
1117 1117
 		});
1118 1118
 
1119
-		$this->registerService(ICloudIdManager::class, function (Server $c) {
1119
+		$this->registerService(ICloudIdManager::class, function(Server $c) {
1120 1120
 			return new CloudIdManager();
1121 1121
 		});
1122 1122
 
1123
-		$this->registerService(IConfig::class, function (Server $c) {
1123
+		$this->registerService(IConfig::class, function(Server $c) {
1124 1124
 			return new GlobalScale\Config($c->getConfig());
1125 1125
 		});
1126 1126
 
1127
-		$this->registerService(ICloudFederationProviderManager::class, function (Server $c) {
1127
+		$this->registerService(ICloudFederationProviderManager::class, function(Server $c) {
1128 1128
 			return new CloudFederationProviderManager($c->getAppManager(), $c->getHTTPClientService(), $c->getCloudIdManager(), $c->getLogger());
1129 1129
 		});
1130 1130
 
1131
-		$this->registerService(ICloudFederationFactory::class, function (Server $c) {
1131
+		$this->registerService(ICloudFederationFactory::class, function(Server $c) {
1132 1132
 			return new CloudFederationFactory();
1133 1133
 		});
1134 1134
 
@@ -1138,18 +1138,18 @@  discard block
 block discarded – undo
1138 1138
 		$this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class);
1139 1139
 		$this->registerAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class);
1140 1140
 
1141
-		$this->registerService(Defaults::class, function (Server $c) {
1141
+		$this->registerService(Defaults::class, function(Server $c) {
1142 1142
 			return new Defaults(
1143 1143
 				$c->getThemingDefaults()
1144 1144
 			);
1145 1145
 		});
1146 1146
 		$this->registerAlias('Defaults', \OCP\Defaults::class);
1147 1147
 
1148
-		$this->registerService(\OCP\ISession::class, function (SimpleContainer $c) {
1148
+		$this->registerService(\OCP\ISession::class, function(SimpleContainer $c) {
1149 1149
 			return $c->query(\OCP\IUserSession::class)->getSession();
1150 1150
 		});
1151 1151
 
1152
-		$this->registerService(IShareHelper::class, function (Server $c) {
1152
+		$this->registerService(IShareHelper::class, function(Server $c) {
1153 1153
 			return new ShareHelper(
1154 1154
 				$c->query(\OCP\Share\IManager::class)
1155 1155
 			);
@@ -1192,7 +1192,7 @@  discard block
 block discarded – undo
1192 1192
 		$this->registerAlias(IDashboardManager::class, DashboardManager::class);
1193 1193
 		$this->registerAlias(IFullTextSearchManager::class, FullTextSearchManager::class);
1194 1194
 
1195
-		$this->registerService(\OC\Security\IdentityProof\Manager::class, function (Server $c) {
1195
+		$this->registerService(\OC\Security\IdentityProof\Manager::class, function(Server $c) {
1196 1196
 			return new \OC\Security\IdentityProof\Manager(
1197 1197
 				$c->query(\OC\Files\AppData\Factory::class),
1198 1198
 				$c->getCrypto(),
@@ -1245,11 +1245,11 @@  discard block
 block discarded – undo
1245 1245
 				// no avatar to remove
1246 1246
 			} catch (\Exception $e) {
1247 1247
 				// Ignore exceptions
1248
-				$logger->info('Could not cleanup avatar of ' . $user->getUID());
1248
+				$logger->info('Could not cleanup avatar of '.$user->getUID());
1249 1249
 			}
1250 1250
 		});
1251 1251
 
1252
-		$dispatcher->addListener('OCP\IUser::changeUser', function (GenericEvent $e) {
1252
+		$dispatcher->addListener('OCP\IUser::changeUser', function(GenericEvent $e) {
1253 1253
 			$manager = $this->getAvatarManager();
1254 1254
 			/** @var IUser $user */
1255 1255
 			$user = $e->getSubject();
@@ -1405,7 +1405,7 @@  discard block
 block discarded – undo
1405 1405
 	 * @deprecated since 9.2.0 use IAppData
1406 1406
 	 */
1407 1407
 	public function getAppFolder() {
1408
-		$dir = '/' . \OC_App::getCurrentApp();
1408
+		$dir = '/'.\OC_App::getCurrentApp();
1409 1409
 		$root = $this->getRootFolder();
1410 1410
 		if (!$root->nodeExists($dir)) {
1411 1411
 			$folder = $root->newFolder($dir);
@@ -1980,7 +1980,7 @@  discard block
 block discarded – undo
1980 1980
 	/**
1981 1981
 	 * @return \OCP\Collaboration\AutoComplete\IManager
1982 1982
 	 */
1983
-	public function getAutoCompleteManager(){
1983
+	public function getAutoCompleteManager() {
1984 1984
 		return $this->query(IManager::class);
1985 1985
 	}
1986 1986
 
Please login to merge, or discard this patch.