Passed
Push — master ( d60bd9...2ac01c )
by Blizzz
11:06 queued 10s
created
lib/private/Server.php 1 patch
Spacing   +113 added lines, -113 removed lines patch added patch discarded remove patch
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 		// To find out if we are running from CLI or not
184 184
 		$this->registerParameter('isCLI', \OC::$CLI);
185 185
 
186
-		$this->registerService(\OCP\IServerContainer::class, function (IServerContainer $c) {
186
+		$this->registerService(\OCP\IServerContainer::class, function(IServerContainer $c) {
187 187
 			return $c;
188 188
 		});
189 189
 
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 		$this->registerAlias(IActionFactory::class, ActionFactory::class);
203 203
 
204 204
 
205
-		$this->registerService(\OCP\IPreview::class, function (Server $c) {
205
+		$this->registerService(\OCP\IPreview::class, function(Server $c) {
206 206
 			return new PreviewManager(
207 207
 				$c->getConfig(),
208 208
 				$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();
@@ -389,45 +389,45 @@  discard block
 block discarded – undo
389 389
 				$c->getLogger(),
390 390
 				$c->query(IEventDispatcher::class)
391 391
 			);
392
-			$userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) {
392
+			$userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) {
393 393
 				\OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password));
394 394
 			});
395
-			$userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) {
395
+			$userSession->listen('\OC\User', 'postCreateUser', function($user, $password) {
396 396
 				/** @var $user \OC\User\User */
397 397
 				\OC_Hook::emit('OC_User', 'post_createUser', array('uid' => $user->getUID(), 'password' => $password));
398 398
 			});
399
-			$userSession->listen('\OC\User', 'preDelete', function ($user) use ($dispatcher) {
399
+			$userSession->listen('\OC\User', 'preDelete', function($user) use ($dispatcher) {
400 400
 				/** @var $user \OC\User\User */
401 401
 				\OC_Hook::emit('OC_User', 'pre_deleteUser', array('run' => true, 'uid' => $user->getUID()));
402 402
 				$dispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user));
403 403
 			});
404
-			$userSession->listen('\OC\User', 'postDelete', function ($user) {
404
+			$userSession->listen('\OC\User', 'postDelete', function($user) {
405 405
 				/** @var $user \OC\User\User */
406 406
 				\OC_Hook::emit('OC_User', 'post_deleteUser', array('uid' => $user->getUID()));
407 407
 			});
408
-			$userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) {
408
+			$userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) {
409 409
 				/** @var $user \OC\User\User */
410 410
 				\OC_Hook::emit('OC_User', 'pre_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword));
411 411
 			});
412
-			$userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) {
412
+			$userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) {
413 413
 				/** @var $user \OC\User\User */
414 414
 				\OC_Hook::emit('OC_User', 'post_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword));
415 415
 			});
416
-			$userSession->listen('\OC\User', 'preLogin', function ($uid, $password) {
416
+			$userSession->listen('\OC\User', 'preLogin', function($uid, $password) {
417 417
 				\OC_Hook::emit('OC_User', 'pre_login', array('run' => true, 'uid' => $uid, 'password' => $password));
418 418
 			});
419
-			$userSession->listen('\OC\User', 'postLogin', function ($user, $password, $isTokenLogin) {
419
+			$userSession->listen('\OC\User', 'postLogin', function($user, $password, $isTokenLogin) {
420 420
 				/** @var $user \OC\User\User */
421 421
 				\OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'isTokenLogin' => $isTokenLogin));
422 422
 			});
423
-			$userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) {
423
+			$userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) {
424 424
 				/** @var $user \OC\User\User */
425 425
 				\OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password));
426 426
 			});
427
-			$userSession->listen('\OC\User', 'logout', function () {
427
+			$userSession->listen('\OC\User', 'logout', function() {
428 428
 				\OC_Hook::emit('OC_User', 'logout', array());
429 429
 			});
430
-			$userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) {
430
+			$userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) {
431 431
 				/** @var $user \OC\User\User */
432 432
 				\OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue));
433 433
 			});
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
 		$this->registerAlias(\OCP\INavigationManager::class, \OC\NavigationManager::class);
442 442
 		$this->registerAlias('NavigationManager', \OCP\INavigationManager::class);
443 443
 
444
-		$this->registerService(\OC\AllConfig::class, function (Server $c) {
444
+		$this->registerService(\OC\AllConfig::class, function(Server $c) {
445 445
 			return new \OC\AllConfig(
446 446
 				$c->getSystemConfig()
447 447
 			);
@@ -449,18 +449,18 @@  discard block
 block discarded – undo
449 449
 		$this->registerAlias('AllConfig', \OC\AllConfig::class);
450 450
 		$this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class);
451 451
 
452
-		$this->registerService(\OC\SystemConfig::class, function ($c) use ($config) {
452
+		$this->registerService(\OC\SystemConfig::class, function($c) use ($config) {
453 453
 			return new \OC\SystemConfig($config);
454 454
 		});
455 455
 		$this->registerAlias('SystemConfig', \OC\SystemConfig::class);
456 456
 
457
-		$this->registerService(\OC\AppConfig::class, function (Server $c) {
457
+		$this->registerService(\OC\AppConfig::class, function(Server $c) {
458 458
 			return new \OC\AppConfig($c->getDatabaseConnection());
459 459
 		});
460 460
 		$this->registerAlias('AppConfig', \OC\AppConfig::class);
461 461
 		$this->registerAlias(\OCP\IAppConfig::class, \OC\AppConfig::class);
462 462
 
463
-		$this->registerService(\OCP\L10N\IFactory::class, function (Server $c) {
463
+		$this->registerService(\OCP\L10N\IFactory::class, function(Server $c) {
464 464
 			return new \OC\L10N\Factory(
465 465
 				$c->getConfig(),
466 466
 				$c->getRequest(),
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
 		});
471 471
 		$this->registerAlias('L10NFactory', \OCP\L10N\IFactory::class);
472 472
 
473
-		$this->registerService(\OCP\IURLGenerator::class, function (Server $c) {
473
+		$this->registerService(\OCP\IURLGenerator::class, function(Server $c) {
474 474
 			$config = $c->getConfig();
475 475
 			$cacheFactory = $c->getMemCacheFactory();
476 476
 			$request = $c->getRequest();
@@ -485,12 +485,12 @@  discard block
 block discarded – undo
485 485
 		$this->registerAlias('AppFetcher', AppFetcher::class);
486 486
 		$this->registerAlias('CategoryFetcher', CategoryFetcher::class);
487 487
 
488
-		$this->registerService(\OCP\ICache::class, function ($c) {
488
+		$this->registerService(\OCP\ICache::class, function($c) {
489 489
 			return new Cache\File();
490 490
 		});
491 491
 		$this->registerAlias('UserCache', \OCP\ICache::class);
492 492
 
493
-		$this->registerService(Factory::class, function (Server $c) {
493
+		$this->registerService(Factory::class, function(Server $c) {
494 494
 
495 495
 			$arrayCacheFactory = new \OC\Memcache\Factory('', $c->getLogger(),
496 496
 				ArrayCache::class,
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
 				$version = implode(',', $v);
506 506
 				$instanceId = \OC_Util::getInstanceId();
507 507
 				$path = \OC::$SERVERROOT;
508
-				$prefix = md5($instanceId . '-' . $version . '-' . $path);
508
+				$prefix = md5($instanceId.'-'.$version.'-'.$path);
509 509
 				return new \OC\Memcache\Factory($prefix, $c->getLogger(),
510 510
 					$config->getSystemValue('memcache.local', null),
511 511
 					$config->getSystemValue('memcache.distributed', null),
@@ -518,12 +518,12 @@  discard block
 block discarded – undo
518 518
 		$this->registerAlias('MemCacheFactory', Factory::class);
519 519
 		$this->registerAlias(ICacheFactory::class, Factory::class);
520 520
 
521
-		$this->registerService('RedisFactory', function (Server $c) {
521
+		$this->registerService('RedisFactory', function(Server $c) {
522 522
 			$systemConfig = $c->getSystemConfig();
523 523
 			return new RedisFactory($systemConfig);
524 524
 		});
525 525
 
526
-		$this->registerService(\OCP\Activity\IManager::class, function (Server $c) {
526
+		$this->registerService(\OCP\Activity\IManager::class, function(Server $c) {
527 527
 			return new \OC\Activity\Manager(
528 528
 				$c->getRequest(),
529 529
 				$c->getUserSession(),
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
 		});
534 534
 		$this->registerAlias('ActivityManager', \OCP\Activity\IManager::class);
535 535
 
536
-		$this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) {
536
+		$this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) {
537 537
 			return new \OC\Activity\EventMerger(
538 538
 				$c->getL10N('lib')
539 539
 			);
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
 		$this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class);
556 556
 		$this->registerAlias(\OCP\Support\Subscription\IRegistry::class, \OC\Support\Subscription\Registry::class);
557 557
 
558
-		$this->registerService(\OC\Log::class, function (Server $c) {
558
+		$this->registerService(\OC\Log::class, function(Server $c) {
559 559
 			$logType = $c->query('AllConfig')->getSystemValue('log_type', 'file');
560 560
 			$factory = new LogFactory($c, $this->getSystemConfig());
561 561
 			$logger = $factory->get($logType);
@@ -566,11 +566,11 @@  discard block
 block discarded – undo
566 566
 		$this->registerAlias(\OCP\ILogger::class, \OC\Log::class);
567 567
 		$this->registerAlias('Logger', \OC\Log::class);
568 568
 
569
-		$this->registerService(ILogFactory::class, function (Server $c) {
569
+		$this->registerService(ILogFactory::class, function(Server $c) {
570 570
 			return new LogFactory($c, $this->getSystemConfig());
571 571
 		});
572 572
 
573
-		$this->registerService(\OCP\BackgroundJob\IJobList::class, function (Server $c) {
573
+		$this->registerService(\OCP\BackgroundJob\IJobList::class, function(Server $c) {
574 574
 			$config = $c->getConfig();
575 575
 			return new \OC\BackgroundJob\JobList(
576 576
 				$c->getDatabaseConnection(),
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
 		});
581 581
 		$this->registerAlias('JobList', \OCP\BackgroundJob\IJobList::class);
582 582
 
583
-		$this->registerService(\OCP\Route\IRouter::class, function (Server $c) {
583
+		$this->registerService(\OCP\Route\IRouter::class, function(Server $c) {
584 584
 			$cacheFactory = $c->getMemCacheFactory();
585 585
 			$logger = $c->getLogger();
586 586
 			if ($cacheFactory->isLocalCacheAvailable()) {
@@ -592,12 +592,12 @@  discard block
 block discarded – undo
592 592
 		});
593 593
 		$this->registerAlias('Router', \OCP\Route\IRouter::class);
594 594
 
595
-		$this->registerService(\OCP\ISearch::class, function ($c) {
595
+		$this->registerService(\OCP\ISearch::class, function($c) {
596 596
 			return new Search();
597 597
 		});
598 598
 		$this->registerAlias('Search', \OCP\ISearch::class);
599 599
 
600
-		$this->registerService(\OC\Security\RateLimiting\Limiter::class, function (Server $c) {
600
+		$this->registerService(\OC\Security\RateLimiting\Limiter::class, function(Server $c) {
601 601
 			return new \OC\Security\RateLimiting\Limiter(
602 602
 				$this->getUserSession(),
603 603
 				$this->getRequest(),
@@ -605,34 +605,34 @@  discard block
 block discarded – undo
605 605
 				$c->query(\OC\Security\RateLimiting\Backend\IBackend::class)
606 606
 			);
607 607
 		});
608
-		$this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) {
608
+		$this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) {
609 609
 			return new \OC\Security\RateLimiting\Backend\MemoryCache(
610 610
 				$this->getMemCacheFactory(),
611 611
 				new \OC\AppFramework\Utility\TimeFactory()
612 612
 			);
613 613
 		});
614 614
 
615
-		$this->registerService(\OCP\Security\ISecureRandom::class, function ($c) {
615
+		$this->registerService(\OCP\Security\ISecureRandom::class, function($c) {
616 616
 			return new SecureRandom();
617 617
 		});
618 618
 		$this->registerAlias('SecureRandom', \OCP\Security\ISecureRandom::class);
619 619
 
620
-		$this->registerService(\OCP\Security\ICrypto::class, function (Server $c) {
620
+		$this->registerService(\OCP\Security\ICrypto::class, function(Server $c) {
621 621
 			return new Crypto($c->getConfig(), $c->getSecureRandom());
622 622
 		});
623 623
 		$this->registerAlias('Crypto', \OCP\Security\ICrypto::class);
624 624
 
625
-		$this->registerService(\OCP\Security\IHasher::class, function (Server $c) {
625
+		$this->registerService(\OCP\Security\IHasher::class, function(Server $c) {
626 626
 			return new Hasher($c->getConfig());
627 627
 		});
628 628
 		$this->registerAlias('Hasher', \OCP\Security\IHasher::class);
629 629
 
630
-		$this->registerService(\OCP\Security\ICredentialsManager::class, function (Server $c) {
630
+		$this->registerService(\OCP\Security\ICredentialsManager::class, function(Server $c) {
631 631
 			return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection());
632 632
 		});
633 633
 		$this->registerAlias('CredentialsManager', \OCP\Security\ICredentialsManager::class);
634 634
 
635
-		$this->registerService(IDBConnection::class, function (Server $c) {
635
+		$this->registerService(IDBConnection::class, function(Server $c) {
636 636
 			$systemConfig = $c->getSystemConfig();
637 637
 			$factory = new \OC\DB\ConnectionFactory($systemConfig);
638 638
 			$type = $systemConfig->getValue('dbtype', 'sqlite');
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
 		$this->registerAlias('DatabaseConnection', IDBConnection::class);
648 648
 
649 649
 
650
-		$this->registerService(\OCP\Http\Client\IClientService::class, function (Server $c) {
650
+		$this->registerService(\OCP\Http\Client\IClientService::class, function(Server $c) {
651 651
 			$user = \OC_User::getUser();
652 652
 			$uid = $user ? $user : null;
653 653
 			return new ClientService(
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
 			);
663 663
 		});
664 664
 		$this->registerAlias('HttpClientService', \OCP\Http\Client\IClientService::class);
665
-		$this->registerService(\OCP\Diagnostics\IEventLogger::class, function (Server $c) {
665
+		$this->registerService(\OCP\Diagnostics\IEventLogger::class, function(Server $c) {
666 666
 			$eventLogger = new EventLogger();
667 667
 			if ($c->getSystemConfig()->getValue('debug', false)) {
668 668
 				// In debug mode, module is being activated by default
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
 		});
673 673
 		$this->registerAlias('EventLogger', \OCP\Diagnostics\IEventLogger::class);
674 674
 
675
-		$this->registerService(\OCP\Diagnostics\IQueryLogger::class, function (Server $c) {
675
+		$this->registerService(\OCP\Diagnostics\IQueryLogger::class, function(Server $c) {
676 676
 			$queryLogger = new QueryLogger();
677 677
 			if ($c->getSystemConfig()->getValue('debug', false)) {
678 678
 				// In debug mode, module is being activated by default
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
 		});
683 683
 		$this->registerAlias('QueryLogger', \OCP\Diagnostics\IQueryLogger::class);
684 684
 
685
-		$this->registerService(TempManager::class, function (Server $c) {
685
+		$this->registerService(TempManager::class, function(Server $c) {
686 686
 			return new TempManager(
687 687
 				$c->getLogger(),
688 688
 				$c->getConfig()
@@ -691,7 +691,7 @@  discard block
 block discarded – undo
691 691
 		$this->registerAlias('TempManager', TempManager::class);
692 692
 		$this->registerAlias(ITempManager::class, TempManager::class);
693 693
 
694
-		$this->registerService(AppManager::class, function (Server $c) {
694
+		$this->registerService(AppManager::class, function(Server $c) {
695 695
 			return new \OC\App\AppManager(
696 696
 				$c->getUserSession(),
697 697
 				$c->query(\OC\AppConfig::class),
@@ -704,7 +704,7 @@  discard block
 block discarded – undo
704 704
 		$this->registerAlias('AppManager', AppManager::class);
705 705
 		$this->registerAlias(IAppManager::class, AppManager::class);
706 706
 
707
-		$this->registerService(\OCP\IDateTimeZone::class, function (Server $c) {
707
+		$this->registerService(\OCP\IDateTimeZone::class, function(Server $c) {
708 708
 			return new DateTimeZone(
709 709
 				$c->getConfig(),
710 710
 				$c->getSession()
@@ -712,7 +712,7 @@  discard block
 block discarded – undo
712 712
 		});
713 713
 		$this->registerAlias('DateTimeZone', \OCP\IDateTimeZone::class);
714 714
 
715
-		$this->registerService(\OCP\IDateTimeFormatter::class, function (Server $c) {
715
+		$this->registerService(\OCP\IDateTimeFormatter::class, function(Server $c) {
716 716
 			$language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null);
717 717
 
718 718
 			return new DateTimeFormatter(
@@ -722,7 +722,7 @@  discard block
 block discarded – undo
722 722
 		});
723 723
 		$this->registerAlias('DateTimeFormatter', \OCP\IDateTimeFormatter::class);
724 724
 
725
-		$this->registerService(\OCP\Files\Config\IUserMountCache::class, function (Server $c) {
725
+		$this->registerService(\OCP\Files\Config\IUserMountCache::class, function(Server $c) {
726 726
 			$mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger());
727 727
 			$listener = new UserMountCacheListener($mountCache);
728 728
 			$listener->listen($c->getUserManager());
@@ -730,7 +730,7 @@  discard block
 block discarded – undo
730 730
 		});
731 731
 		$this->registerAlias('UserMountCache', \OCP\Files\Config\IUserMountCache::class);
732 732
 
733
-		$this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function (Server $c) {
733
+		$this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function(Server $c) {
734 734
 			$loader = \OC\Files\Filesystem::getLoader();
735 735
 			$mountCache = $c->query('UserMountCache');
736 736
 			$manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache);
@@ -746,10 +746,10 @@  discard block
 block discarded – undo
746 746
 		});
747 747
 		$this->registerAlias('MountConfigManager', \OCP\Files\Config\IMountProviderCollection::class);
748 748
 
749
-		$this->registerService('IniWrapper', function ($c) {
749
+		$this->registerService('IniWrapper', function($c) {
750 750
 			return new IniGetWrapper();
751 751
 		});
752
-		$this->registerService('AsyncCommandBus', function (Server $c) {
752
+		$this->registerService('AsyncCommandBus', function(Server $c) {
753 753
 			$busClass = $c->getConfig()->getSystemValue('commandbus');
754 754
 			if ($busClass) {
755 755
 				list($app, $class) = explode('::', $busClass, 2);
@@ -764,10 +764,10 @@  discard block
 block discarded – undo
764 764
 				return new CronBus($jobList);
765 765
 			}
766 766
 		});
767
-		$this->registerService('TrustedDomainHelper', function ($c) {
767
+		$this->registerService('TrustedDomainHelper', function($c) {
768 768
 			return new TrustedDomainHelper($this->getConfig());
769 769
 		});
770
-		$this->registerService(Throttler::class, function (Server $c) {
770
+		$this->registerService(Throttler::class, function(Server $c) {
771 771
 			return new Throttler(
772 772
 				$c->getDatabaseConnection(),
773 773
 				new TimeFactory(),
@@ -776,7 +776,7 @@  discard block
 block discarded – undo
776 776
 			);
777 777
 		});
778 778
 		$this->registerAlias('Throttler', Throttler::class);
779
-		$this->registerService('IntegrityCodeChecker', function (Server $c) {
779
+		$this->registerService('IntegrityCodeChecker', function(Server $c) {
780 780
 			// IConfig and IAppManager requires a working database. This code
781 781
 			// might however be called when ownCloud is not yet setup.
782 782
 			if (\OC::$server->getSystemConfig()->getValue('installed', false)) {
@@ -798,7 +798,7 @@  discard block
 block discarded – undo
798 798
 				$c->getMimeTypeDetector()
799 799
 			);
800 800
 		});
801
-		$this->registerService(\OCP\IRequest::class, function ($c) {
801
+		$this->registerService(\OCP\IRequest::class, function($c) {
802 802
 			if (isset($this['urlParams'])) {
803 803
 				$urlParams = $this['urlParams'];
804 804
 			} else {
@@ -834,7 +834,7 @@  discard block
 block discarded – undo
834 834
 		});
835 835
 		$this->registerAlias('Request', \OCP\IRequest::class);
836 836
 
837
-		$this->registerService(\OCP\Mail\IMailer::class, function (Server $c) {
837
+		$this->registerService(\OCP\Mail\IMailer::class, function(Server $c) {
838 838
 			return new Mailer(
839 839
 				$c->getConfig(),
840 840
 				$c->getLogger(),
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
 		});
846 846
 		$this->registerAlias('Mailer', \OCP\Mail\IMailer::class);
847 847
 
848
-		$this->registerService('LDAPProvider', function (Server $c) {
848
+		$this->registerService('LDAPProvider', function(Server $c) {
849 849
 			$config = $c->getConfig();
850 850
 			$factoryClass = $config->getSystemValue('ldapProviderFactory', null);
851 851
 			if (is_null($factoryClass)) {
@@ -855,7 +855,7 @@  discard block
 block discarded – undo
855 855
 			$factory = new $factoryClass($this);
856 856
 			return $factory->getLDAPProvider();
857 857
 		});
858
-		$this->registerService(ILockingProvider::class, function (Server $c) {
858
+		$this->registerService(ILockingProvider::class, function(Server $c) {
859 859
 			$ini = $c->getIniWrapper();
860 860
 			$config = $c->getConfig();
861 861
 			$ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time')));
@@ -878,30 +878,30 @@  discard block
 block discarded – undo
878 878
 		});
879 879
 		$this->registerAlias('LockingProvider', ILockingProvider::class);
880 880
 
881
-		$this->registerService(\OCP\Files\Mount\IMountManager::class, function () {
881
+		$this->registerService(\OCP\Files\Mount\IMountManager::class, function() {
882 882
 			return new \OC\Files\Mount\Manager();
883 883
 		});
884 884
 		$this->registerAlias('MountManager', \OCP\Files\Mount\IMountManager::class);
885 885
 
886
-		$this->registerService(\OCP\Files\IMimeTypeDetector::class, function (Server $c) {
886
+		$this->registerService(\OCP\Files\IMimeTypeDetector::class, function(Server $c) {
887 887
 			return new \OC\Files\Type\Detection(
888 888
 				$c->getURLGenerator(),
889 889
 				\OC::$configDir,
890
-				\OC::$SERVERROOT . '/resources/config/'
890
+				\OC::$SERVERROOT.'/resources/config/'
891 891
 			);
892 892
 		});
893 893
 		$this->registerAlias('MimeTypeDetector', \OCP\Files\IMimeTypeDetector::class);
894 894
 
895
-		$this->registerService(\OCP\Files\IMimeTypeLoader::class, function (Server $c) {
895
+		$this->registerService(\OCP\Files\IMimeTypeLoader::class, function(Server $c) {
896 896
 			return new \OC\Files\Type\Loader(
897 897
 				$c->getDatabaseConnection()
898 898
 			);
899 899
 		});
900 900
 		$this->registerAlias('MimeTypeLoader', \OCP\Files\IMimeTypeLoader::class);
901
-		$this->registerService(BundleFetcher::class, function () {
901
+		$this->registerService(BundleFetcher::class, function() {
902 902
 			return new BundleFetcher($this->getL10N('lib'));
903 903
 		});
904
-		$this->registerService(\OCP\Notification\IManager::class, function (Server $c) {
904
+		$this->registerService(\OCP\Notification\IManager::class, function(Server $c) {
905 905
 			return new Manager(
906 906
 				$c->query(IValidator::class),
907 907
 				$c->getLogger()
@@ -909,19 +909,19 @@  discard block
 block discarded – undo
909 909
 		});
910 910
 		$this->registerAlias('NotificationManager', \OCP\Notification\IManager::class);
911 911
 
912
-		$this->registerService(\OC\CapabilitiesManager::class, function (Server $c) {
912
+		$this->registerService(\OC\CapabilitiesManager::class, function(Server $c) {
913 913
 			$manager = new \OC\CapabilitiesManager($c->getLogger());
914
-			$manager->registerCapability(function () use ($c) {
914
+			$manager->registerCapability(function() use ($c) {
915 915
 				return new \OC\OCS\CoreCapabilities($c->getConfig());
916 916
 			});
917
-			$manager->registerCapability(function () use ($c) {
917
+			$manager->registerCapability(function() use ($c) {
918 918
 				return $c->query(\OC\Security\Bruteforce\Capabilities::class);
919 919
 			});
920 920
 			return $manager;
921 921
 		});
922 922
 		$this->registerAlias('CapabilitiesManager', \OC\CapabilitiesManager::class);
923 923
 
924
-		$this->registerService(\OCP\Comments\ICommentsManager::class, function (Server $c) {
924
+		$this->registerService(\OCP\Comments\ICommentsManager::class, function(Server $c) {
925 925
 			$config = $c->getConfig();
926 926
 			$factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class);
927 927
 			/** @var \OCP\Comments\ICommentsManagerFactory $factory */
@@ -931,7 +931,7 @@  discard block
 block discarded – undo
931 931
 			$manager->registerDisplayNameResolver('user', function($id) use ($c) {
932 932
 				$manager = $c->getUserManager();
933 933
 				$user = $manager->get($id);
934
-				if(is_null($user)) {
934
+				if (is_null($user)) {
935 935
 					$l = $c->getL10N('core');
936 936
 					$displayName = $l->t('Unknown user');
937 937
 				} else {
@@ -944,7 +944,7 @@  discard block
 block discarded – undo
944 944
 		});
945 945
 		$this->registerAlias('CommentsManager', \OCP\Comments\ICommentsManager::class);
946 946
 
947
-		$this->registerService('ThemingDefaults', function (Server $c) {
947
+		$this->registerService('ThemingDefaults', function(Server $c) {
948 948
 			/*
949 949
 			 * Dark magic for autoloader.
950 950
 			 * If we do a class_exists it will try to load the class which will
@@ -972,7 +972,7 @@  discard block
 block discarded – undo
972 972
 			}
973 973
 			return new \OC_Defaults();
974 974
 		});
975
-		$this->registerService(SCSSCacher::class, function (Server $c) {
975
+		$this->registerService(SCSSCacher::class, function(Server $c) {
976 976
 			return new SCSSCacher(
977 977
 				$c->getLogger(),
978 978
 				$c->query(\OC\Files\AppData\Factory::class),
@@ -985,7 +985,7 @@  discard block
 block discarded – undo
985 985
 				new TimeFactory()
986 986
 			);
987 987
 		});
988
-		$this->registerService(JSCombiner::class, function (Server $c) {
988
+		$this->registerService(JSCombiner::class, function(Server $c) {
989 989
 			return new JSCombiner(
990 990
 				$c->getAppDataDir('js'),
991 991
 				$c->getURLGenerator(),
@@ -998,7 +998,7 @@  discard block
 block discarded – undo
998 998
 		$this->registerAlias('EventDispatcher', \OC\EventDispatcher\SymfonyAdapter::class);
999 999
 		$this->registerAlias(EventDispatcherInterface::class, \OC\EventDispatcher\SymfonyAdapter::class);
1000 1000
 
1001
-		$this->registerService('CryptoWrapper', function (Server $c) {
1001
+		$this->registerService('CryptoWrapper', function(Server $c) {
1002 1002
 			// FIXME: Instantiiated here due to cyclic dependency
1003 1003
 			$request = new Request(
1004 1004
 				[
@@ -1023,7 +1023,7 @@  discard block
 block discarded – undo
1023 1023
 				$request
1024 1024
 			);
1025 1025
 		});
1026
-		$this->registerService(CsrfTokenManager::class, function (Server $c) {
1026
+		$this->registerService(CsrfTokenManager::class, function(Server $c) {
1027 1027
 			$tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom());
1028 1028
 
1029 1029
 			return new CsrfTokenManager(
@@ -1032,20 +1032,20 @@  discard block
 block discarded – undo
1032 1032
 			);
1033 1033
 		});
1034 1034
 		$this->registerAlias('CsrfTokenManager', CsrfTokenManager::class);
1035
-		$this->registerService(SessionStorage::class, function (Server $c) {
1035
+		$this->registerService(SessionStorage::class, function(Server $c) {
1036 1036
 			return new SessionStorage($c->getSession());
1037 1037
 		});
1038 1038
 		$this->registerAlias(\OCP\Security\IContentSecurityPolicyManager::class, \OC\Security\CSP\ContentSecurityPolicyManager::class);
1039 1039
 		$this->registerAlias('ContentSecurityPolicyManager', \OC\Security\CSP\ContentSecurityPolicyManager::class);
1040 1040
 
1041
-		$this->registerService('ContentSecurityPolicyNonceManager', function (Server $c) {
1041
+		$this->registerService('ContentSecurityPolicyNonceManager', function(Server $c) {
1042 1042
 			return new ContentSecurityPolicyNonceManager(
1043 1043
 				$c->getCsrfTokenManager(),
1044 1044
 				$c->getRequest()
1045 1045
 			);
1046 1046
 		});
1047 1047
 
1048
-		$this->registerService(\OCP\Share\IManager::class, function (Server $c) {
1048
+		$this->registerService(\OCP\Share\IManager::class, function(Server $c) {
1049 1049
 			$config = $c->getConfig();
1050 1050
 			$factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class);
1051 1051
 			/** @var \OCP\Share\IProviderFactory $factory */
@@ -1092,7 +1092,7 @@  discard block
 block discarded – undo
1092 1092
 
1093 1093
 		$this->registerAlias(\OCP\Collaboration\Resources\IManager::class, \OC\Collaboration\Resources\Manager::class);
1094 1094
 
1095
-		$this->registerService('SettingsManager', function (Server $c) {
1095
+		$this->registerService('SettingsManager', function(Server $c) {
1096 1096
 			$manager = new \OC\Settings\Manager(
1097 1097
 				$c->getLogger(),
1098 1098
 				$c->getL10NFactory(),
@@ -1101,36 +1101,36 @@  discard block
 block discarded – undo
1101 1101
 			);
1102 1102
 			return $manager;
1103 1103
 		});
1104
-		$this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) {
1104
+		$this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) {
1105 1105
 			return new \OC\Files\AppData\Factory(
1106 1106
 				$c->getRootFolder(),
1107 1107
 				$c->getSystemConfig()
1108 1108
 			);
1109 1109
 		});
1110 1110
 
1111
-		$this->registerService('LockdownManager', function (Server $c) {
1112
-			return new LockdownManager(function () use ($c) {
1111
+		$this->registerService('LockdownManager', function(Server $c) {
1112
+			return new LockdownManager(function() use ($c) {
1113 1113
 				return $c->getSession();
1114 1114
 			});
1115 1115
 		});
1116 1116
 
1117
-		$this->registerService(\OCP\OCS\IDiscoveryService::class, function (Server $c) {
1117
+		$this->registerService(\OCP\OCS\IDiscoveryService::class, function(Server $c) {
1118 1118
 			return new DiscoveryService($c->getMemCacheFactory(), $c->getHTTPClientService());
1119 1119
 		});
1120 1120
 
1121
-		$this->registerService(ICloudIdManager::class, function (Server $c) {
1121
+		$this->registerService(ICloudIdManager::class, function(Server $c) {
1122 1122
 			return new CloudIdManager();
1123 1123
 		});
1124 1124
 
1125
-		$this->registerService(IConfig::class, function (Server $c) {
1125
+		$this->registerService(IConfig::class, function(Server $c) {
1126 1126
 			return new GlobalScale\Config($c->getConfig());
1127 1127
 		});
1128 1128
 
1129
-		$this->registerService(ICloudFederationProviderManager::class, function (Server $c) {
1129
+		$this->registerService(ICloudFederationProviderManager::class, function(Server $c) {
1130 1130
 			return new CloudFederationProviderManager($c->getAppManager(), $c->getHTTPClientService(), $c->getCloudIdManager(), $c->getLogger());
1131 1131
 		});
1132 1132
 
1133
-		$this->registerService(ICloudFederationFactory::class, function (Server $c) {
1133
+		$this->registerService(ICloudFederationFactory::class, function(Server $c) {
1134 1134
 			return new CloudFederationFactory();
1135 1135
 		});
1136 1136
 
@@ -1140,18 +1140,18 @@  discard block
 block discarded – undo
1140 1140
 		$this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class);
1141 1141
 		$this->registerAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class);
1142 1142
 
1143
-		$this->registerService(Defaults::class, function (Server $c) {
1143
+		$this->registerService(Defaults::class, function(Server $c) {
1144 1144
 			return new Defaults(
1145 1145
 				$c->getThemingDefaults()
1146 1146
 			);
1147 1147
 		});
1148 1148
 		$this->registerAlias('Defaults', \OCP\Defaults::class);
1149 1149
 
1150
-		$this->registerService(\OCP\ISession::class, function (SimpleContainer $c) {
1150
+		$this->registerService(\OCP\ISession::class, function(SimpleContainer $c) {
1151 1151
 			return $c->query(\OCP\IUserSession::class)->getSession();
1152 1152
 		});
1153 1153
 
1154
-		$this->registerService(IShareHelper::class, function (Server $c) {
1154
+		$this->registerService(IShareHelper::class, function(Server $c) {
1155 1155
 			return new ShareHelper(
1156 1156
 				$c->query(\OCP\Share\IManager::class)
1157 1157
 			);
@@ -1194,7 +1194,7 @@  discard block
 block discarded – undo
1194 1194
 		$this->registerAlias(IDashboardManager::class, DashboardManager::class);
1195 1195
 		$this->registerAlias(IFullTextSearchManager::class, FullTextSearchManager::class);
1196 1196
 
1197
-		$this->registerService(\OC\Security\IdentityProof\Manager::class, function (Server $c) {
1197
+		$this->registerService(\OC\Security\IdentityProof\Manager::class, function(Server $c) {
1198 1198
 			return new \OC\Security\IdentityProof\Manager(
1199 1199
 				$c->query(\OC\Files\AppData\Factory::class),
1200 1200
 				$c->getCrypto(),
@@ -1247,11 +1247,11 @@  discard block
 block discarded – undo
1247 1247
 				// no avatar to remove
1248 1248
 			} catch (\Exception $e) {
1249 1249
 				// Ignore exceptions
1250
-				$logger->info('Could not cleanup avatar of ' . $user->getUID());
1250
+				$logger->info('Could not cleanup avatar of '.$user->getUID());
1251 1251
 			}
1252 1252
 		});
1253 1253
 
1254
-		$dispatcher->addListener('OCP\IUser::changeUser', function (GenericEvent $e) {
1254
+		$dispatcher->addListener('OCP\IUser::changeUser', function(GenericEvent $e) {
1255 1255
 			$manager = $this->getAvatarManager();
1256 1256
 			/** @var IUser $user */
1257 1257
 			$user = $e->getSubject();
@@ -1407,7 +1407,7 @@  discard block
 block discarded – undo
1407 1407
 	 * @deprecated since 9.2.0 use IAppData
1408 1408
 	 */
1409 1409
 	public function getAppFolder() {
1410
-		$dir = '/' . \OC_App::getCurrentApp();
1410
+		$dir = '/'.\OC_App::getCurrentApp();
1411 1411
 		$root = $this->getRootFolder();
1412 1412
 		if (!$root->nodeExists($dir)) {
1413 1413
 			$folder = $root->newFolder($dir);
@@ -1982,7 +1982,7 @@  discard block
 block discarded – undo
1982 1982
 	/**
1983 1983
 	 * @return \OCP\Collaboration\AutoComplete\IManager
1984 1984
 	 */
1985
-	public function getAutoCompleteManager(){
1985
+	public function getAutoCompleteManager() {
1986 1986
 		return $this->query(IManager::class);
1987 1987
 	}
1988 1988
 
Please login to merge, or discard this patch.