Completed
Push — master ( ede723...76d23a )
by Blizzz
38s
created
lib/private/Server.php 1 patch
Spacing   +114 added lines, -114 removed lines patch added patch discarded remove patch
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 		parent::__construct();
162 162
 		$this->webRoot = $webRoot;
163 163
 
164
-		$this->registerService(\OCP\IServerContainer::class, function (IServerContainer $c) {
164
+		$this->registerService(\OCP\IServerContainer::class, function(IServerContainer $c) {
165 165
 			return $c;
166 166
 		});
167 167
 
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 		$this->registerAlias(IActionFactory::class, ActionFactory::class);
175 175
 
176 176
 
177
-		$this->registerService(\OCP\IPreview::class, function (Server $c) {
177
+		$this->registerService(\OCP\IPreview::class, function(Server $c) {
178 178
 			return new PreviewManager(
179 179
 				$c->getConfig(),
180 180
 				$c->getRootFolder(),
@@ -185,13 +185,13 @@  discard block
 block discarded – undo
185 185
 		});
186 186
 		$this->registerAlias('PreviewManager', \OCP\IPreview::class);
187 187
 
188
-		$this->registerService(\OC\Preview\Watcher::class, function (Server $c) {
188
+		$this->registerService(\OC\Preview\Watcher::class, function(Server $c) {
189 189
 			return new \OC\Preview\Watcher(
190 190
 				$c->getAppDataDir('preview')
191 191
 			);
192 192
 		});
193 193
 
194
-		$this->registerService('EncryptionManager', function (Server $c) {
194
+		$this->registerService('EncryptionManager', function(Server $c) {
195 195
 			$view = new View();
196 196
 			$util = new Encryption\Util(
197 197
 				$view,
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 			);
210 210
 		});
211 211
 
212
-		$this->registerService('EncryptionFileHelper', function (Server $c) {
212
+		$this->registerService('EncryptionFileHelper', function(Server $c) {
213 213
 			$util = new Encryption\Util(
214 214
 				new View(),
215 215
 				$c->getUserManager(),
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 			);
224 224
 		});
225 225
 
226
-		$this->registerService('EncryptionKeyStorage', function (Server $c) {
226
+		$this->registerService('EncryptionKeyStorage', function(Server $c) {
227 227
 			$view = new View();
228 228
 			$util = new Encryption\Util(
229 229
 				$view,
@@ -234,30 +234,30 @@  discard block
 block discarded – undo
234 234
 
235 235
 			return new Encryption\Keys\Storage($view, $util);
236 236
 		});
237
-		$this->registerService('TagMapper', function (Server $c) {
237
+		$this->registerService('TagMapper', function(Server $c) {
238 238
 			return new TagMapper($c->getDatabaseConnection());
239 239
 		});
240 240
 
241
-		$this->registerService(\OCP\ITagManager::class, function (Server $c) {
241
+		$this->registerService(\OCP\ITagManager::class, function(Server $c) {
242 242
 			$tagMapper = $c->query('TagMapper');
243 243
 			return new TagManager($tagMapper, $c->getUserSession());
244 244
 		});
245 245
 		$this->registerAlias('TagManager', \OCP\ITagManager::class);
246 246
 
247
-		$this->registerService('SystemTagManagerFactory', function (Server $c) {
247
+		$this->registerService('SystemTagManagerFactory', function(Server $c) {
248 248
 			$config = $c->getConfig();
249 249
 			$factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class);
250 250
 			return new $factoryClass($this);
251 251
 		});
252
-		$this->registerService(\OCP\SystemTag\ISystemTagManager::class, function (Server $c) {
252
+		$this->registerService(\OCP\SystemTag\ISystemTagManager::class, function(Server $c) {
253 253
 			return $c->query('SystemTagManagerFactory')->getManager();
254 254
 		});
255 255
 		$this->registerAlias('SystemTagManager', \OCP\SystemTag\ISystemTagManager::class);
256 256
 
257
-		$this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function (Server $c) {
257
+		$this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function(Server $c) {
258 258
 			return $c->query('SystemTagManagerFactory')->getObjectMapper();
259 259
 		});
260
-		$this->registerService('RootFolder', function (Server $c) {
260
+		$this->registerService('RootFolder', function(Server $c) {
261 261
 			$manager = \OC\Files\Filesystem::getMountManager(null);
262 262
 			$view = new View();
263 263
 			$root = new Root(
@@ -278,38 +278,38 @@  discard block
 block discarded – undo
278 278
 		});
279 279
 		$this->registerAlias('SystemTagObjectMapper', \OCP\SystemTag\ISystemTagObjectMapper::class);
280 280
 
281
-		$this->registerService(\OCP\Files\IRootFolder::class, function (Server $c) {
282
-			return new LazyRoot(function () use ($c) {
281
+		$this->registerService(\OCP\Files\IRootFolder::class, function(Server $c) {
282
+			return new LazyRoot(function() use ($c) {
283 283
 				return $c->query('RootFolder');
284 284
 			});
285 285
 		});
286 286
 		$this->registerAlias('LazyRootFolder', \OCP\Files\IRootFolder::class);
287 287
 
288
-		$this->registerService(\OC\User\Manager::class, function (Server $c) {
288
+		$this->registerService(\OC\User\Manager::class, function(Server $c) {
289 289
 			$config = $c->getConfig();
290 290
 			return new \OC\User\Manager($config);
291 291
 		});
292 292
 		$this->registerAlias('UserManager', \OC\User\Manager::class);
293 293
 		$this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class);
294 294
 
295
-		$this->registerService(\OCP\IGroupManager::class, function (Server $c) {
295
+		$this->registerService(\OCP\IGroupManager::class, function(Server $c) {
296 296
 			$groupManager = new \OC\Group\Manager($this->getUserManager(), $this->getLogger());
297
-			$groupManager->listen('\OC\Group', 'preCreate', function ($gid) {
297
+			$groupManager->listen('\OC\Group', 'preCreate', function($gid) {
298 298
 				\OC_Hook::emit('OC_Group', 'pre_createGroup', array('run' => true, 'gid' => $gid));
299 299
 			});
300
-			$groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $gid) {
300
+			$groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $gid) {
301 301
 				\OC_Hook::emit('OC_User', 'post_createGroup', array('gid' => $gid->getGID()));
302 302
 			});
303
-			$groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) {
303
+			$groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) {
304 304
 				\OC_Hook::emit('OC_Group', 'pre_deleteGroup', array('run' => true, 'gid' => $group->getGID()));
305 305
 			});
306
-			$groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) {
306
+			$groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) {
307 307
 				\OC_Hook::emit('OC_User', 'post_deleteGroup', array('gid' => $group->getGID()));
308 308
 			});
309
-			$groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
309
+			$groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) {
310 310
 				\OC_Hook::emit('OC_Group', 'pre_addToGroup', array('run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID()));
311 311
 			});
312
-			$groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
312
+			$groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) {
313 313
 				\OC_Hook::emit('OC_Group', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID()));
314 314
 				//Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks
315 315
 				\OC_Hook::emit('OC_User', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID()));
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 		});
319 319
 		$this->registerAlias('GroupManager', \OCP\IGroupManager::class);
320 320
 
321
-		$this->registerService(Store::class, function (Server $c) {
321
+		$this->registerService(Store::class, function(Server $c) {
322 322
 			$session = $c->getSession();
323 323
 			if (\OC::$server->getSystemConfig()->getValue('installed', false)) {
324 324
 				$tokenProvider = $c->query(IProvider::class);
@@ -329,11 +329,11 @@  discard block
 block discarded – undo
329 329
 			return new Store($session, $logger, $tokenProvider);
330 330
 		});
331 331
 		$this->registerAlias(IStore::class, Store::class);
332
-		$this->registerService(Authentication\Token\DefaultTokenMapper::class, function (Server $c) {
332
+		$this->registerService(Authentication\Token\DefaultTokenMapper::class, function(Server $c) {
333 333
 			$dbConnection = $c->getDatabaseConnection();
334 334
 			return new Authentication\Token\DefaultTokenMapper($dbConnection);
335 335
 		});
336
-		$this->registerService(Authentication\Token\DefaultTokenProvider::class, function (Server $c) {
336
+		$this->registerService(Authentication\Token\DefaultTokenProvider::class, function(Server $c) {
337 337
 			$mapper = $c->query(Authentication\Token\DefaultTokenMapper::class);
338 338
 			$crypto = $c->getCrypto();
339 339
 			$config = $c->getConfig();
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
 		});
344 344
 		$this->registerAlias(IProvider::class, Authentication\Token\DefaultTokenProvider::class);
345 345
 
346
-		$this->registerService(\OCP\IUserSession::class, function (Server $c) {
346
+		$this->registerService(\OCP\IUserSession::class, function(Server $c) {
347 347
 			$manager = $c->getUserManager();
348 348
 			$session = new \OC\Session\Memory('');
349 349
 			$timeFactory = new TimeFactory();
@@ -367,45 +367,45 @@  discard block
 block discarded – undo
367 367
 				$c->getLockdownManager(),
368 368
 				$c->getLogger()
369 369
 			);
370
-			$userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) {
370
+			$userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) {
371 371
 				\OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password));
372 372
 			});
373
-			$userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) {
373
+			$userSession->listen('\OC\User', 'postCreateUser', function($user, $password) {
374 374
 				/** @var $user \OC\User\User */
375 375
 				\OC_Hook::emit('OC_User', 'post_createUser', array('uid' => $user->getUID(), 'password' => $password));
376 376
 			});
377
-			$userSession->listen('\OC\User', 'preDelete', function ($user) use ($dispatcher) {
377
+			$userSession->listen('\OC\User', 'preDelete', function($user) use ($dispatcher) {
378 378
 				/** @var $user \OC\User\User */
379 379
 				\OC_Hook::emit('OC_User', 'pre_deleteUser', array('run' => true, 'uid' => $user->getUID()));
380 380
 				$dispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user));
381 381
 			});
382
-			$userSession->listen('\OC\User', 'postDelete', function ($user) {
382
+			$userSession->listen('\OC\User', 'postDelete', function($user) {
383 383
 				/** @var $user \OC\User\User */
384 384
 				\OC_Hook::emit('OC_User', 'post_deleteUser', array('uid' => $user->getUID()));
385 385
 			});
386
-			$userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) {
386
+			$userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) {
387 387
 				/** @var $user \OC\User\User */
388 388
 				\OC_Hook::emit('OC_User', 'pre_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword));
389 389
 			});
390
-			$userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) {
390
+			$userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) {
391 391
 				/** @var $user \OC\User\User */
392 392
 				\OC_Hook::emit('OC_User', 'post_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword));
393 393
 			});
394
-			$userSession->listen('\OC\User', 'preLogin', function ($uid, $password) {
394
+			$userSession->listen('\OC\User', 'preLogin', function($uid, $password) {
395 395
 				\OC_Hook::emit('OC_User', 'pre_login', array('run' => true, 'uid' => $uid, 'password' => $password));
396 396
 			});
397
-			$userSession->listen('\OC\User', 'postLogin', function ($user, $password) {
397
+			$userSession->listen('\OC\User', 'postLogin', function($user, $password) {
398 398
 				/** @var $user \OC\User\User */
399 399
 				\OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password));
400 400
 			});
401
-			$userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) {
401
+			$userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) {
402 402
 				/** @var $user \OC\User\User */
403 403
 				\OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password));
404 404
 			});
405
-			$userSession->listen('\OC\User', 'logout', function () {
405
+			$userSession->listen('\OC\User', 'logout', function() {
406 406
 				\OC_Hook::emit('OC_User', 'logout', array());
407 407
 			});
408
-			$userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) use ($dispatcher) {
408
+			$userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) use ($dispatcher) {
409 409
 				/** @var $user \OC\User\User */
410 410
 				\OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue));
411 411
 				$dispatcher->dispatch('OCP\IUser::changeUser', new GenericEvent($user, ['feature' => $feature, 'oldValue' => $oldValue, 'value' => $value]));
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 		});
415 415
 		$this->registerAlias('UserSession', \OCP\IUserSession::class);
416 416
 
417
-		$this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function (Server $c) {
417
+		$this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function(Server $c) {
418 418
 			return new \OC\Authentication\TwoFactorAuth\Manager(
419 419
 				$c->getAppManager(),
420 420
 				$c->getSession(),
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
 		$this->registerAlias(\OCP\INavigationManager::class, \OC\NavigationManager::class);
431 431
 		$this->registerAlias('NavigationManager', \OCP\INavigationManager::class);
432 432
 
433
-		$this->registerService(\OC\AllConfig::class, function (Server $c) {
433
+		$this->registerService(\OC\AllConfig::class, function(Server $c) {
434 434
 			return new \OC\AllConfig(
435 435
 				$c->getSystemConfig()
436 436
 			);
@@ -438,17 +438,17 @@  discard block
 block discarded – undo
438 438
 		$this->registerAlias('AllConfig', \OC\AllConfig::class);
439 439
 		$this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class);
440 440
 
441
-		$this->registerService('SystemConfig', function ($c) use ($config) {
441
+		$this->registerService('SystemConfig', function($c) use ($config) {
442 442
 			return new \OC\SystemConfig($config);
443 443
 		});
444 444
 
445
-		$this->registerService(\OC\AppConfig::class, function (Server $c) {
445
+		$this->registerService(\OC\AppConfig::class, function(Server $c) {
446 446
 			return new \OC\AppConfig($c->getDatabaseConnection());
447 447
 		});
448 448
 		$this->registerAlias('AppConfig', \OC\AppConfig::class);
449 449
 		$this->registerAlias(\OCP\IAppConfig::class, \OC\AppConfig::class);
450 450
 
451
-		$this->registerService(\OCP\L10N\IFactory::class, function (Server $c) {
451
+		$this->registerService(\OCP\L10N\IFactory::class, function(Server $c) {
452 452
 			return new \OC\L10N\Factory(
453 453
 				$c->getConfig(),
454 454
 				$c->getRequest(),
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
 		});
459 459
 		$this->registerAlias('L10NFactory', \OCP\L10N\IFactory::class);
460 460
 
461
-		$this->registerService(\OCP\IURLGenerator::class, function (Server $c) {
461
+		$this->registerService(\OCP\IURLGenerator::class, function(Server $c) {
462 462
 			$config = $c->getConfig();
463 463
 			$cacheFactory = $c->getMemCacheFactory();
464 464
 			$request = $c->getRequest();
@@ -473,12 +473,12 @@  discard block
 block discarded – undo
473 473
 		$this->registerAlias('AppFetcher', AppFetcher::class);
474 474
 		$this->registerAlias('CategoryFetcher', CategoryFetcher::class);
475 475
 
476
-		$this->registerService(\OCP\ICache::class, function ($c) {
476
+		$this->registerService(\OCP\ICache::class, function($c) {
477 477
 			return new Cache\File();
478 478
 		});
479 479
 		$this->registerAlias('UserCache', \OCP\ICache::class);
480 480
 
481
-		$this->registerService(Factory::class, function (Server $c) {
481
+		$this->registerService(Factory::class, function(Server $c) {
482 482
 
483 483
 			$arrayCacheFactory = new \OC\Memcache\Factory('', $c->getLogger(),
484 484
 				ArrayCache::class,
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
 				$version = implode(',', $v);
496 496
 				$instanceId = \OC_Util::getInstanceId();
497 497
 				$path = \OC::$SERVERROOT;
498
-				$prefix = md5($instanceId . '-' . $version . '-' . $path);
498
+				$prefix = md5($instanceId.'-'.$version.'-'.$path);
499 499
 				return new \OC\Memcache\Factory($prefix, $c->getLogger(),
500 500
 					$config->getSystemValue('memcache.local', null),
501 501
 					$config->getSystemValue('memcache.distributed', null),
@@ -508,12 +508,12 @@  discard block
 block discarded – undo
508 508
 		$this->registerAlias('MemCacheFactory', Factory::class);
509 509
 		$this->registerAlias(ICacheFactory::class, Factory::class);
510 510
 
511
-		$this->registerService('RedisFactory', function (Server $c) {
511
+		$this->registerService('RedisFactory', function(Server $c) {
512 512
 			$systemConfig = $c->getSystemConfig();
513 513
 			return new RedisFactory($systemConfig);
514 514
 		});
515 515
 
516
-		$this->registerService(\OCP\Activity\IManager::class, function (Server $c) {
516
+		$this->registerService(\OCP\Activity\IManager::class, function(Server $c) {
517 517
 			return new \OC\Activity\Manager(
518 518
 				$c->getRequest(),
519 519
 				$c->getUserSession(),
@@ -523,14 +523,14 @@  discard block
 block discarded – undo
523 523
 		});
524 524
 		$this->registerAlias('ActivityManager', \OCP\Activity\IManager::class);
525 525
 
526
-		$this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) {
526
+		$this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) {
527 527
 			return new \OC\Activity\EventMerger(
528 528
 				$c->getL10N('lib')
529 529
 			);
530 530
 		});
531 531
 		$this->registerAlias(IValidator::class, Validator::class);
532 532
 
533
-		$this->registerService(\OCP\IAvatarManager::class, function (Server $c) {
533
+		$this->registerService(\OCP\IAvatarManager::class, function(Server $c) {
534 534
 			return new AvatarManager(
535 535
 				$c->query(\OC\User\Manager::class),
536 536
 				$c->getAppDataDir('avatar'),
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 
544 544
 		$this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class);
545 545
 
546
-		$this->registerService(\OCP\ILogger::class, function (Server $c) {
546
+		$this->registerService(\OCP\ILogger::class, function(Server $c) {
547 547
 			$logType = $c->query('AllConfig')->getSystemValue('log_type', 'file');
548 548
 			$logger = Log::getLogClass($logType);
549 549
 			call_user_func(array($logger, 'init'));
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 		});
555 555
 		$this->registerAlias('Logger', \OCP\ILogger::class);
556 556
 
557
-		$this->registerService(\OCP\BackgroundJob\IJobList::class, function (Server $c) {
557
+		$this->registerService(\OCP\BackgroundJob\IJobList::class, function(Server $c) {
558 558
 			$config = $c->getConfig();
559 559
 			return new \OC\BackgroundJob\JobList(
560 560
 				$c->getDatabaseConnection(),
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
 		});
565 565
 		$this->registerAlias('JobList', \OCP\BackgroundJob\IJobList::class);
566 566
 
567
-		$this->registerService(\OCP\Route\IRouter::class, function (Server $c) {
567
+		$this->registerService(\OCP\Route\IRouter::class, function(Server $c) {
568 568
 			$cacheFactory = $c->getMemCacheFactory();
569 569
 			$logger = $c->getLogger();
570 570
 			if ($cacheFactory->isLocalCacheAvailable()) {
@@ -576,12 +576,12 @@  discard block
 block discarded – undo
576 576
 		});
577 577
 		$this->registerAlias('Router', \OCP\Route\IRouter::class);
578 578
 
579
-		$this->registerService(\OCP\ISearch::class, function ($c) {
579
+		$this->registerService(\OCP\ISearch::class, function($c) {
580 580
 			return new Search();
581 581
 		});
582 582
 		$this->registerAlias('Search', \OCP\ISearch::class);
583 583
 
584
-		$this->registerService(\OC\Security\RateLimiting\Limiter::class, function (Server $c) {
584
+		$this->registerService(\OC\Security\RateLimiting\Limiter::class, function(Server $c) {
585 585
 			return new \OC\Security\RateLimiting\Limiter(
586 586
 				$this->getUserSession(),
587 587
 				$this->getRequest(),
@@ -589,34 +589,34 @@  discard block
 block discarded – undo
589 589
 				$c->query(\OC\Security\RateLimiting\Backend\IBackend::class)
590 590
 			);
591 591
 		});
592
-		$this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) {
592
+		$this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) {
593 593
 			return new \OC\Security\RateLimiting\Backend\MemoryCache(
594 594
 				$this->getMemCacheFactory(),
595 595
 				new \OC\AppFramework\Utility\TimeFactory()
596 596
 			);
597 597
 		});
598 598
 
599
-		$this->registerService(\OCP\Security\ISecureRandom::class, function ($c) {
599
+		$this->registerService(\OCP\Security\ISecureRandom::class, function($c) {
600 600
 			return new SecureRandom();
601 601
 		});
602 602
 		$this->registerAlias('SecureRandom', \OCP\Security\ISecureRandom::class);
603 603
 
604
-		$this->registerService(\OCP\Security\ICrypto::class, function (Server $c) {
604
+		$this->registerService(\OCP\Security\ICrypto::class, function(Server $c) {
605 605
 			return new Crypto($c->getConfig(), $c->getSecureRandom());
606 606
 		});
607 607
 		$this->registerAlias('Crypto', \OCP\Security\ICrypto::class);
608 608
 
609
-		$this->registerService(\OCP\Security\IHasher::class, function (Server $c) {
609
+		$this->registerService(\OCP\Security\IHasher::class, function(Server $c) {
610 610
 			return new Hasher($c->getConfig());
611 611
 		});
612 612
 		$this->registerAlias('Hasher', \OCP\Security\IHasher::class);
613 613
 
614
-		$this->registerService(\OCP\Security\ICredentialsManager::class, function (Server $c) {
614
+		$this->registerService(\OCP\Security\ICredentialsManager::class, function(Server $c) {
615 615
 			return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection());
616 616
 		});
617 617
 		$this->registerAlias('CredentialsManager', \OCP\Security\ICredentialsManager::class);
618 618
 
619
-		$this->registerService(IDBConnection::class, function (Server $c) {
619
+		$this->registerService(IDBConnection::class, function(Server $c) {
620 620
 			$systemConfig = $c->getSystemConfig();
621 621
 			$factory = new \OC\DB\ConnectionFactory($systemConfig);
622 622
 			$type = $systemConfig->getValue('dbtype', 'sqlite');
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
 		});
631 631
 		$this->registerAlias('DatabaseConnection', IDBConnection::class);
632 632
 
633
-		$this->registerService('HTTPHelper', function (Server $c) {
633
+		$this->registerService('HTTPHelper', function(Server $c) {
634 634
 			$config = $c->getConfig();
635 635
 			return new HTTPHelper(
636 636
 				$config,
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
 			);
639 639
 		});
640 640
 
641
-		$this->registerService(\OCP\Http\Client\IClientService::class, function (Server $c) {
641
+		$this->registerService(\OCP\Http\Client\IClientService::class, function(Server $c) {
642 642
 			$user = \OC_User::getUser();
643 643
 			$uid = $user ? $user : null;
644 644
 			return new ClientService(
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
 			);
654 654
 		});
655 655
 		$this->registerAlias('HttpClientService', \OCP\Http\Client\IClientService::class);
656
-		$this->registerService(\OCP\Diagnostics\IEventLogger::class, function (Server $c) {
656
+		$this->registerService(\OCP\Diagnostics\IEventLogger::class, function(Server $c) {
657 657
 			$eventLogger = new EventLogger();
658 658
 			if ($c->getSystemConfig()->getValue('debug', false)) {
659 659
 				// In debug mode, module is being activated by default
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
 		});
664 664
 		$this->registerAlias('EventLogger', \OCP\Diagnostics\IEventLogger::class);
665 665
 
666
-		$this->registerService(\OCP\Diagnostics\IQueryLogger::class, function (Server $c) {
666
+		$this->registerService(\OCP\Diagnostics\IQueryLogger::class, function(Server $c) {
667 667
 			$queryLogger = new QueryLogger();
668 668
 			if ($c->getSystemConfig()->getValue('debug', false)) {
669 669
 				// In debug mode, module is being activated by default
@@ -673,7 +673,7 @@  discard block
 block discarded – undo
673 673
 		});
674 674
 		$this->registerAlias('QueryLogger', \OCP\Diagnostics\IQueryLogger::class);
675 675
 
676
-		$this->registerService(TempManager::class, function (Server $c) {
676
+		$this->registerService(TempManager::class, function(Server $c) {
677 677
 			return new TempManager(
678 678
 				$c->getLogger(),
679 679
 				$c->getConfig()
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
 		$this->registerAlias('TempManager', TempManager::class);
683 683
 		$this->registerAlias(ITempManager::class, TempManager::class);
684 684
 
685
-		$this->registerService(AppManager::class, function (Server $c) {
685
+		$this->registerService(AppManager::class, function(Server $c) {
686 686
 			return new \OC\App\AppManager(
687 687
 				$c->getUserSession(),
688 688
 				$c->query(\OC\AppConfig::class),
@@ -694,7 +694,7 @@  discard block
 block discarded – undo
694 694
 		$this->registerAlias('AppManager', AppManager::class);
695 695
 		$this->registerAlias(IAppManager::class, AppManager::class);
696 696
 
697
-		$this->registerService(\OCP\IDateTimeZone::class, function (Server $c) {
697
+		$this->registerService(\OCP\IDateTimeZone::class, function(Server $c) {
698 698
 			return new DateTimeZone(
699 699
 				$c->getConfig(),
700 700
 				$c->getSession()
@@ -702,7 +702,7 @@  discard block
 block discarded – undo
702 702
 		});
703 703
 		$this->registerAlias('DateTimeZone', \OCP\IDateTimeZone::class);
704 704
 
705
-		$this->registerService(\OCP\IDateTimeFormatter::class, function (Server $c) {
705
+		$this->registerService(\OCP\IDateTimeFormatter::class, function(Server $c) {
706 706
 			$language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null);
707 707
 
708 708
 			return new DateTimeFormatter(
@@ -712,7 +712,7 @@  discard block
 block discarded – undo
712 712
 		});
713 713
 		$this->registerAlias('DateTimeFormatter', \OCP\IDateTimeFormatter::class);
714 714
 
715
-		$this->registerService(\OCP\Files\Config\IUserMountCache::class, function (Server $c) {
715
+		$this->registerService(\OCP\Files\Config\IUserMountCache::class, function(Server $c) {
716 716
 			$mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger());
717 717
 			$listener = new UserMountCacheListener($mountCache);
718 718
 			$listener->listen($c->getUserManager());
@@ -720,7 +720,7 @@  discard block
 block discarded – undo
720 720
 		});
721 721
 		$this->registerAlias('UserMountCache', \OCP\Files\Config\IUserMountCache::class);
722 722
 
723
-		$this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function (Server $c) {
723
+		$this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function(Server $c) {
724 724
 			$loader = \OC\Files\Filesystem::getLoader();
725 725
 			$mountCache = $c->query('UserMountCache');
726 726
 			$manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache);
@@ -736,10 +736,10 @@  discard block
 block discarded – undo
736 736
 		});
737 737
 		$this->registerAlias('MountConfigManager', \OCP\Files\Config\IMountProviderCollection::class);
738 738
 
739
-		$this->registerService('IniWrapper', function ($c) {
739
+		$this->registerService('IniWrapper', function($c) {
740 740
 			return new IniGetWrapper();
741 741
 		});
742
-		$this->registerService('AsyncCommandBus', function (Server $c) {
742
+		$this->registerService('AsyncCommandBus', function(Server $c) {
743 743
 			$busClass = $c->getConfig()->getSystemValue('commandbus');
744 744
 			if ($busClass) {
745 745
 				list($app, $class) = explode('::', $busClass, 2);
@@ -754,10 +754,10 @@  discard block
 block discarded – undo
754 754
 				return new CronBus($jobList);
755 755
 			}
756 756
 		});
757
-		$this->registerService('TrustedDomainHelper', function ($c) {
757
+		$this->registerService('TrustedDomainHelper', function($c) {
758 758
 			return new TrustedDomainHelper($this->getConfig());
759 759
 		});
760
-		$this->registerService('Throttler', function (Server $c) {
760
+		$this->registerService('Throttler', function(Server $c) {
761 761
 			return new Throttler(
762 762
 				$c->getDatabaseConnection(),
763 763
 				new TimeFactory(),
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
 				$c->getConfig()
766 766
 			);
767 767
 		});
768
-		$this->registerService('IntegrityCodeChecker', function (Server $c) {
768
+		$this->registerService('IntegrityCodeChecker', function(Server $c) {
769 769
 			// IConfig and IAppManager requires a working database. This code
770 770
 			// might however be called when ownCloud is not yet setup.
771 771
 			if (\OC::$server->getSystemConfig()->getValue('installed', false)) {
@@ -786,7 +786,7 @@  discard block
 block discarded – undo
786 786
 				$c->getTempManager()
787 787
 			);
788 788
 		});
789
-		$this->registerService(\OCP\IRequest::class, function ($c) {
789
+		$this->registerService(\OCP\IRequest::class, function($c) {
790 790
 			if (isset($this['urlParams'])) {
791 791
 				$urlParams = $this['urlParams'];
792 792
 			} else {
@@ -822,7 +822,7 @@  discard block
 block discarded – undo
822 822
 		});
823 823
 		$this->registerAlias('Request', \OCP\IRequest::class);
824 824
 
825
-		$this->registerService(\OCP\Mail\IMailer::class, function (Server $c) {
825
+		$this->registerService(\OCP\Mail\IMailer::class, function(Server $c) {
826 826
 			return new Mailer(
827 827
 				$c->getConfig(),
828 828
 				$c->getLogger(),
@@ -833,7 +833,7 @@  discard block
 block discarded – undo
833 833
 		});
834 834
 		$this->registerAlias('Mailer', \OCP\Mail\IMailer::class);
835 835
 
836
-		$this->registerService('LDAPProvider', function (Server $c) {
836
+		$this->registerService('LDAPProvider', function(Server $c) {
837 837
 			$config = $c->getConfig();
838 838
 			$factoryClass = $config->getSystemValue('ldapProviderFactory', null);
839 839
 			if (is_null($factoryClass)) {
@@ -843,7 +843,7 @@  discard block
 block discarded – undo
843 843
 			$factory = new $factoryClass($this);
844 844
 			return $factory->getLDAPProvider();
845 845
 		});
846
-		$this->registerService(ILockingProvider::class, function (Server $c) {
846
+		$this->registerService(ILockingProvider::class, function(Server $c) {
847 847
 			$ini = $c->getIniWrapper();
848 848
 			$config = $c->getConfig();
849 849
 			$ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time')));
@@ -860,49 +860,49 @@  discard block
 block discarded – undo
860 860
 		});
861 861
 		$this->registerAlias('LockingProvider', ILockingProvider::class);
862 862
 
863
-		$this->registerService(\OCP\Files\Mount\IMountManager::class, function () {
863
+		$this->registerService(\OCP\Files\Mount\IMountManager::class, function() {
864 864
 			return new \OC\Files\Mount\Manager();
865 865
 		});
866 866
 		$this->registerAlias('MountManager', \OCP\Files\Mount\IMountManager::class);
867 867
 
868
-		$this->registerService(\OCP\Files\IMimeTypeDetector::class, function (Server $c) {
868
+		$this->registerService(\OCP\Files\IMimeTypeDetector::class, function(Server $c) {
869 869
 			return new \OC\Files\Type\Detection(
870 870
 				$c->getURLGenerator(),
871 871
 				\OC::$configDir,
872
-				\OC::$SERVERROOT . '/resources/config/'
872
+				\OC::$SERVERROOT.'/resources/config/'
873 873
 			);
874 874
 		});
875 875
 		$this->registerAlias('MimeTypeDetector', \OCP\Files\IMimeTypeDetector::class);
876 876
 
877
-		$this->registerService(\OCP\Files\IMimeTypeLoader::class, function (Server $c) {
877
+		$this->registerService(\OCP\Files\IMimeTypeLoader::class, function(Server $c) {
878 878
 			return new \OC\Files\Type\Loader(
879 879
 				$c->getDatabaseConnection()
880 880
 			);
881 881
 		});
882 882
 		$this->registerAlias('MimeTypeLoader', \OCP\Files\IMimeTypeLoader::class);
883
-		$this->registerService(BundleFetcher::class, function () {
883
+		$this->registerService(BundleFetcher::class, function() {
884 884
 			return new BundleFetcher($this->getL10N('lib'));
885 885
 		});
886
-		$this->registerService(\OCP\Notification\IManager::class, function (Server $c) {
886
+		$this->registerService(\OCP\Notification\IManager::class, function(Server $c) {
887 887
 			return new Manager(
888 888
 				$c->query(IValidator::class)
889 889
 			);
890 890
 		});
891 891
 		$this->registerAlias('NotificationManager', \OCP\Notification\IManager::class);
892 892
 
893
-		$this->registerService(\OC\CapabilitiesManager::class, function (Server $c) {
893
+		$this->registerService(\OC\CapabilitiesManager::class, function(Server $c) {
894 894
 			$manager = new \OC\CapabilitiesManager($c->getLogger());
895
-			$manager->registerCapability(function () use ($c) {
895
+			$manager->registerCapability(function() use ($c) {
896 896
 				return new \OC\OCS\CoreCapabilities($c->getConfig());
897 897
 			});
898
-			$manager->registerCapability(function () use ($c) {
898
+			$manager->registerCapability(function() use ($c) {
899 899
 				return $c->query(\OC\Security\Bruteforce\Capabilities::class);
900 900
 			});
901 901
 			return $manager;
902 902
 		});
903 903
 		$this->registerAlias('CapabilitiesManager', \OC\CapabilitiesManager::class);
904 904
 
905
-		$this->registerService(\OCP\Comments\ICommentsManager::class, function (Server $c) {
905
+		$this->registerService(\OCP\Comments\ICommentsManager::class, function(Server $c) {
906 906
 			$config = $c->getConfig();
907 907
 			$factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class);
908 908
 			/** @var \OCP\Comments\ICommentsManagerFactory $factory */
@@ -912,7 +912,7 @@  discard block
 block discarded – undo
912 912
 			$manager->registerDisplayNameResolver('user', function($id) use ($c) {
913 913
 				$manager = $c->getUserManager();
914 914
 				$user = $manager->get($id);
915
-				if(is_null($user)) {
915
+				if (is_null($user)) {
916 916
 					$l = $c->getL10N('core');
917 917
 					$displayName = $l->t('Unknown user');
918 918
 				} else {
@@ -925,7 +925,7 @@  discard block
 block discarded – undo
925 925
 		});
926 926
 		$this->registerAlias('CommentsManager', \OCP\Comments\ICommentsManager::class);
927 927
 
928
-		$this->registerService('ThemingDefaults', function (Server $c) {
928
+		$this->registerService('ThemingDefaults', function(Server $c) {
929 929
 			/*
930 930
 			 * Dark magic for autoloader.
931 931
 			 * If we do a class_exists it will try to load the class which will
@@ -952,7 +952,7 @@  discard block
 block discarded – undo
952 952
 			}
953 953
 			return new \OC_Defaults();
954 954
 		});
955
-		$this->registerService(SCSSCacher::class, function (Server $c) {
955
+		$this->registerService(SCSSCacher::class, function(Server $c) {
956 956
 			/** @var Factory $cacheFactory */
957 957
 			$cacheFactory = $c->query(Factory::class);
958 958
 			return new SCSSCacher(
@@ -965,7 +965,7 @@  discard block
 block discarded – undo
965 965
 				$this->getMemCacheFactory()
966 966
 			);
967 967
 		});
968
-		$this->registerService(JSCombiner::class, function (Server $c) {
968
+		$this->registerService(JSCombiner::class, function(Server $c) {
969 969
 			/** @var Factory $cacheFactory */
970 970
 			$cacheFactory = $c->query(Factory::class);
971 971
 			return new JSCombiner(
@@ -976,13 +976,13 @@  discard block
 block discarded – undo
976 976
 				$c->getLogger()
977 977
 			);
978 978
 		});
979
-		$this->registerService(EventDispatcher::class, function () {
979
+		$this->registerService(EventDispatcher::class, function() {
980 980
 			return new EventDispatcher();
981 981
 		});
982 982
 		$this->registerAlias('EventDispatcher', EventDispatcher::class);
983 983
 		$this->registerAlias(EventDispatcherInterface::class, EventDispatcher::class);
984 984
 
985
-		$this->registerService('CryptoWrapper', function (Server $c) {
985
+		$this->registerService('CryptoWrapper', function(Server $c) {
986 986
 			// FIXME: Instantiiated here due to cyclic dependency
987 987
 			$request = new Request(
988 988
 				[
@@ -1007,7 +1007,7 @@  discard block
 block discarded – undo
1007 1007
 				$request
1008 1008
 			);
1009 1009
 		});
1010
-		$this->registerService('CsrfTokenManager', function (Server $c) {
1010
+		$this->registerService('CsrfTokenManager', function(Server $c) {
1011 1011
 			$tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom());
1012 1012
 
1013 1013
 			return new CsrfTokenManager(
@@ -1015,22 +1015,22 @@  discard block
 block discarded – undo
1015 1015
 				$c->query(SessionStorage::class)
1016 1016
 			);
1017 1017
 		});
1018
-		$this->registerService(SessionStorage::class, function (Server $c) {
1018
+		$this->registerService(SessionStorage::class, function(Server $c) {
1019 1019
 			return new SessionStorage($c->getSession());
1020 1020
 		});
1021
-		$this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function (Server $c) {
1021
+		$this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function(Server $c) {
1022 1022
 			return new ContentSecurityPolicyManager();
1023 1023
 		});
1024 1024
 		$this->registerAlias('ContentSecurityPolicyManager', \OCP\Security\IContentSecurityPolicyManager::class);
1025 1025
 
1026
-		$this->registerService('ContentSecurityPolicyNonceManager', function (Server $c) {
1026
+		$this->registerService('ContentSecurityPolicyNonceManager', function(Server $c) {
1027 1027
 			return new ContentSecurityPolicyNonceManager(
1028 1028
 				$c->getCsrfTokenManager(),
1029 1029
 				$c->getRequest()
1030 1030
 			);
1031 1031
 		});
1032 1032
 
1033
-		$this->registerService(\OCP\Share\IManager::class, function (Server $c) {
1033
+		$this->registerService(\OCP\Share\IManager::class, function(Server $c) {
1034 1034
 			$config = $c->getConfig();
1035 1035
 			$factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class);
1036 1036
 			/** @var \OCP\Share\IProviderFactory $factory */
@@ -1073,7 +1073,7 @@  discard block
 block discarded – undo
1073 1073
 
1074 1074
 		$this->registerAlias(\OCP\Collaboration\AutoComplete\IManager::class, \OC\Collaboration\AutoComplete\Manager::class);
1075 1075
 
1076
-		$this->registerService('SettingsManager', function (Server $c) {
1076
+		$this->registerService('SettingsManager', function(Server $c) {
1077 1077
 			$manager = new \OC\Settings\Manager(
1078 1078
 				$c->getLogger(),
1079 1079
 				$c->getDatabaseConnection(),
@@ -1091,24 +1091,24 @@  discard block
 block discarded – undo
1091 1091
 			);
1092 1092
 			return $manager;
1093 1093
 		});
1094
-		$this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) {
1094
+		$this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) {
1095 1095
 			return new \OC\Files\AppData\Factory(
1096 1096
 				$c->getRootFolder(),
1097 1097
 				$c->getSystemConfig()
1098 1098
 			);
1099 1099
 		});
1100 1100
 
1101
-		$this->registerService('LockdownManager', function (Server $c) {
1102
-			return new LockdownManager(function () use ($c) {
1101
+		$this->registerService('LockdownManager', function(Server $c) {
1102
+			return new LockdownManager(function() use ($c) {
1103 1103
 				return $c->getSession();
1104 1104
 			});
1105 1105
 		});
1106 1106
 
1107
-		$this->registerService(\OCP\OCS\IDiscoveryService::class, function (Server $c) {
1107
+		$this->registerService(\OCP\OCS\IDiscoveryService::class, function(Server $c) {
1108 1108
 			return new DiscoveryService($c->getMemCacheFactory(), $c->getHTTPClientService());
1109 1109
 		});
1110 1110
 
1111
-		$this->registerService(ICloudIdManager::class, function (Server $c) {
1111
+		$this->registerService(ICloudIdManager::class, function(Server $c) {
1112 1112
 			return new CloudIdManager();
1113 1113
 		});
1114 1114
 
@@ -1118,18 +1118,18 @@  discard block
 block discarded – undo
1118 1118
 		$this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class);
1119 1119
 		$this->registerAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class);
1120 1120
 
1121
-		$this->registerService(Defaults::class, function (Server $c) {
1121
+		$this->registerService(Defaults::class, function(Server $c) {
1122 1122
 			return new Defaults(
1123 1123
 				$c->getThemingDefaults()
1124 1124
 			);
1125 1125
 		});
1126 1126
 		$this->registerAlias('Defaults', \OCP\Defaults::class);
1127 1127
 
1128
-		$this->registerService(\OCP\ISession::class, function (SimpleContainer $c) {
1128
+		$this->registerService(\OCP\ISession::class, function(SimpleContainer $c) {
1129 1129
 			return $c->query(\OCP\IUserSession::class)->getSession();
1130 1130
 		});
1131 1131
 
1132
-		$this->registerService(IShareHelper::class, function (Server $c) {
1132
+		$this->registerService(IShareHelper::class, function(Server $c) {
1133 1133
 			return new ShareHelper(
1134 1134
 				$c->query(\OCP\Share\IManager::class)
1135 1135
 			);
@@ -1191,11 +1191,11 @@  discard block
 block discarded – undo
1191 1191
 				// no avatar to remove
1192 1192
 			} catch (\Exception $e) {
1193 1193
 				// Ignore exceptions
1194
-				$logger->info('Could not cleanup avatar of ' . $user->getUID());
1194
+				$logger->info('Could not cleanup avatar of '.$user->getUID());
1195 1195
 			}
1196 1196
 		});
1197 1197
 
1198
-		$dispatcher->addListener('OCP\IUser::changeUser', function (GenericEvent $e) {
1198
+		$dispatcher->addListener('OCP\IUser::changeUser', function(GenericEvent $e) {
1199 1199
 			$manager = $this->getAvatarManager();
1200 1200
 			/** @var IUser $user */
1201 1201
 			$user = $e->getSubject();
@@ -1346,7 +1346,7 @@  discard block
 block discarded – undo
1346 1346
 	 * @deprecated since 9.2.0 use IAppData
1347 1347
 	 */
1348 1348
 	public function getAppFolder() {
1349
-		$dir = '/' . \OC_App::getCurrentApp();
1349
+		$dir = '/'.\OC_App::getCurrentApp();
1350 1350
 		$root = $this->getRootFolder();
1351 1351
 		if (!$root->nodeExists($dir)) {
1352 1352
 			$folder = $root->newFolder($dir);
@@ -1923,7 +1923,7 @@  discard block
 block discarded – undo
1923 1923
 	/**
1924 1924
 	 * @return \OCP\Collaboration\AutoComplete\IManager
1925 1925
 	 */
1926
-	public function getAutoCompleteManager(){
1926
+	public function getAutoCompleteManager() {
1927 1927
 		return $this->query(IManager::class);
1928 1928
 	}
1929 1929
 
Please login to merge, or discard this patch.