Completed
Pull Request — master (#9565)
by Julius
30:04 queued 14:03
created
lib/private/Server.php 1 patch
Spacing   +114 added lines, -114 removed lines patch added patch discarded remove patch
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 		// To find out if we are running from CLI or not
168 168
 		$this->registerParameter('isCLI', \OC::$CLI);
169 169
 
170
-		$this->registerService(\OCP\IServerContainer::class, function (IServerContainer $c) {
170
+		$this->registerService(\OCP\IServerContainer::class, function(IServerContainer $c) {
171 171
 			return $c;
172 172
 		});
173 173
 
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 		$this->registerAlias(IActionFactory::class, ActionFactory::class);
181 181
 
182 182
 
183
-		$this->registerService(\OCP\IPreview::class, function (Server $c) {
183
+		$this->registerService(\OCP\IPreview::class, function(Server $c) {
184 184
 			return new PreviewManager(
185 185
 				$c->getConfig(),
186 186
 				$c->getRootFolder(),
@@ -191,13 +191,13 @@  discard block
 block discarded – undo
191 191
 		});
192 192
 		$this->registerAlias('PreviewManager', \OCP\IPreview::class);
193 193
 
194
-		$this->registerService(\OC\Preview\Watcher::class, function (Server $c) {
194
+		$this->registerService(\OC\Preview\Watcher::class, function(Server $c) {
195 195
 			return new \OC\Preview\Watcher(
196 196
 				$c->getAppDataDir('preview')
197 197
 			);
198 198
 		});
199 199
 
200
-		$this->registerService('EncryptionManager', function (Server $c) {
200
+		$this->registerService('EncryptionManager', function(Server $c) {
201 201
 			$view = new View();
202 202
 			$util = new Encryption\Util(
203 203
 				$view,
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 			);
216 216
 		});
217 217
 
218
-		$this->registerService('EncryptionFileHelper', function (Server $c) {
218
+		$this->registerService('EncryptionFileHelper', function(Server $c) {
219 219
 			$util = new Encryption\Util(
220 220
 				new View(),
221 221
 				$c->getUserManager(),
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 			);
230 230
 		});
231 231
 
232
-		$this->registerService('EncryptionKeyStorage', function (Server $c) {
232
+		$this->registerService('EncryptionKeyStorage', function(Server $c) {
233 233
 			$view = new View();
234 234
 			$util = new Encryption\Util(
235 235
 				$view,
@@ -240,30 +240,30 @@  discard block
 block discarded – undo
240 240
 
241 241
 			return new Encryption\Keys\Storage($view, $util);
242 242
 		});
243
-		$this->registerService('TagMapper', function (Server $c) {
243
+		$this->registerService('TagMapper', function(Server $c) {
244 244
 			return new TagMapper($c->getDatabaseConnection());
245 245
 		});
246 246
 
247
-		$this->registerService(\OCP\ITagManager::class, function (Server $c) {
247
+		$this->registerService(\OCP\ITagManager::class, function(Server $c) {
248 248
 			$tagMapper = $c->query('TagMapper');
249 249
 			return new TagManager($tagMapper, $c->getUserSession());
250 250
 		});
251 251
 		$this->registerAlias('TagManager', \OCP\ITagManager::class);
252 252
 
253
-		$this->registerService('SystemTagManagerFactory', function (Server $c) {
253
+		$this->registerService('SystemTagManagerFactory', function(Server $c) {
254 254
 			$config = $c->getConfig();
255 255
 			$factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class);
256 256
 			return new $factoryClass($this);
257 257
 		});
258
-		$this->registerService(\OCP\SystemTag\ISystemTagManager::class, function (Server $c) {
258
+		$this->registerService(\OCP\SystemTag\ISystemTagManager::class, function(Server $c) {
259 259
 			return $c->query('SystemTagManagerFactory')->getManager();
260 260
 		});
261 261
 		$this->registerAlias('SystemTagManager', \OCP\SystemTag\ISystemTagManager::class);
262 262
 
263
-		$this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function (Server $c) {
263
+		$this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function(Server $c) {
264 264
 			return $c->query('SystemTagManagerFactory')->getObjectMapper();
265 265
 		});
266
-		$this->registerService('RootFolder', function (Server $c) {
266
+		$this->registerService('RootFolder', function(Server $c) {
267 267
 			$manager = \OC\Files\Filesystem::getMountManager(null);
268 268
 			$view = new View();
269 269
 			$root = new Root(
@@ -284,38 +284,38 @@  discard block
 block discarded – undo
284 284
 		});
285 285
 		$this->registerAlias('SystemTagObjectMapper', \OCP\SystemTag\ISystemTagObjectMapper::class);
286 286
 
287
-		$this->registerService(\OCP\Files\IRootFolder::class, function (Server $c) {
288
-			return new LazyRoot(function () use ($c) {
287
+		$this->registerService(\OCP\Files\IRootFolder::class, function(Server $c) {
288
+			return new LazyRoot(function() use ($c) {
289 289
 				return $c->query('RootFolder');
290 290
 			});
291 291
 		});
292 292
 		$this->registerAlias('LazyRootFolder', \OCP\Files\IRootFolder::class);
293 293
 
294
-		$this->registerService(\OC\User\Manager::class, function (Server $c) {
294
+		$this->registerService(\OC\User\Manager::class, function(Server $c) {
295 295
 			$config = $c->getConfig();
296 296
 			return new \OC\User\Manager($config);
297 297
 		});
298 298
 		$this->registerAlias('UserManager', \OC\User\Manager::class);
299 299
 		$this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class);
300 300
 
301
-		$this->registerService(\OCP\IGroupManager::class, function (Server $c) {
301
+		$this->registerService(\OCP\IGroupManager::class, function(Server $c) {
302 302
 			$groupManager = new \OC\Group\Manager($this->getUserManager(), $this->getLogger());
303
-			$groupManager->listen('\OC\Group', 'preCreate', function ($gid) {
303
+			$groupManager->listen('\OC\Group', 'preCreate', function($gid) {
304 304
 				\OC_Hook::emit('OC_Group', 'pre_createGroup', array('run' => true, 'gid' => $gid));
305 305
 			});
306
-			$groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $gid) {
306
+			$groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $gid) {
307 307
 				\OC_Hook::emit('OC_User', 'post_createGroup', array('gid' => $gid->getGID()));
308 308
 			});
309
-			$groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) {
309
+			$groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) {
310 310
 				\OC_Hook::emit('OC_Group', 'pre_deleteGroup', array('run' => true, 'gid' => $group->getGID()));
311 311
 			});
312
-			$groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) {
312
+			$groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) {
313 313
 				\OC_Hook::emit('OC_User', 'post_deleteGroup', array('gid' => $group->getGID()));
314 314
 			});
315
-			$groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
315
+			$groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) {
316 316
 				\OC_Hook::emit('OC_Group', 'pre_addToGroup', array('run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID()));
317 317
 			});
318
-			$groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
318
+			$groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) {
319 319
 				\OC_Hook::emit('OC_Group', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID()));
320 320
 				//Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks
321 321
 				\OC_Hook::emit('OC_User', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID()));
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 		});
325 325
 		$this->registerAlias('GroupManager', \OCP\IGroupManager::class);
326 326
 
327
-		$this->registerService(Store::class, function (Server $c) {
327
+		$this->registerService(Store::class, function(Server $c) {
328 328
 			$session = $c->getSession();
329 329
 			if (\OC::$server->getSystemConfig()->getValue('installed', false)) {
330 330
 				$tokenProvider = $c->query(IProvider::class);
@@ -335,11 +335,11 @@  discard block
 block discarded – undo
335 335
 			return new Store($session, $logger, $tokenProvider);
336 336
 		});
337 337
 		$this->registerAlias(IStore::class, Store::class);
338
-		$this->registerService(Authentication\Token\DefaultTokenMapper::class, function (Server $c) {
338
+		$this->registerService(Authentication\Token\DefaultTokenMapper::class, function(Server $c) {
339 339
 			$dbConnection = $c->getDatabaseConnection();
340 340
 			return new Authentication\Token\DefaultTokenMapper($dbConnection);
341 341
 		});
342
-		$this->registerService(Authentication\Token\DefaultTokenProvider::class, function (Server $c) {
342
+		$this->registerService(Authentication\Token\DefaultTokenProvider::class, function(Server $c) {
343 343
 			$mapper = $c->query(Authentication\Token\DefaultTokenMapper::class);
344 344
 			$crypto = $c->getCrypto();
345 345
 			$config = $c->getConfig();
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
 		});
350 350
 		$this->registerAlias(IProvider::class, Authentication\Token\DefaultTokenProvider::class);
351 351
 
352
-		$this->registerService(\OCP\IUserSession::class, function (Server $c) {
352
+		$this->registerService(\OCP\IUserSession::class, function(Server $c) {
353 353
 			$manager = $c->getUserManager();
354 354
 			$session = new \OC\Session\Memory('');
355 355
 			$timeFactory = new TimeFactory();
@@ -373,45 +373,45 @@  discard block
 block discarded – undo
373 373
 				$c->getLockdownManager(),
374 374
 				$c->getLogger()
375 375
 			);
376
-			$userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) {
376
+			$userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) {
377 377
 				\OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password));
378 378
 			});
379
-			$userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) {
379
+			$userSession->listen('\OC\User', 'postCreateUser', function($user, $password) {
380 380
 				/** @var $user \OC\User\User */
381 381
 				\OC_Hook::emit('OC_User', 'post_createUser', array('uid' => $user->getUID(), 'password' => $password));
382 382
 			});
383
-			$userSession->listen('\OC\User', 'preDelete', function ($user) use ($dispatcher) {
383
+			$userSession->listen('\OC\User', 'preDelete', function($user) use ($dispatcher) {
384 384
 				/** @var $user \OC\User\User */
385 385
 				\OC_Hook::emit('OC_User', 'pre_deleteUser', array('run' => true, 'uid' => $user->getUID()));
386 386
 				$dispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user));
387 387
 			});
388
-			$userSession->listen('\OC\User', 'postDelete', function ($user) {
388
+			$userSession->listen('\OC\User', 'postDelete', function($user) {
389 389
 				/** @var $user \OC\User\User */
390 390
 				\OC_Hook::emit('OC_User', 'post_deleteUser', array('uid' => $user->getUID()));
391 391
 			});
392
-			$userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) {
392
+			$userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) {
393 393
 				/** @var $user \OC\User\User */
394 394
 				\OC_Hook::emit('OC_User', 'pre_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword));
395 395
 			});
396
-			$userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) {
396
+			$userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) {
397 397
 				/** @var $user \OC\User\User */
398 398
 				\OC_Hook::emit('OC_User', 'post_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword));
399 399
 			});
400
-			$userSession->listen('\OC\User', 'preLogin', function ($uid, $password) {
400
+			$userSession->listen('\OC\User', 'preLogin', function($uid, $password) {
401 401
 				\OC_Hook::emit('OC_User', 'pre_login', array('run' => true, 'uid' => $uid, 'password' => $password));
402 402
 			});
403
-			$userSession->listen('\OC\User', 'postLogin', function ($user, $password) {
403
+			$userSession->listen('\OC\User', 'postLogin', function($user, $password) {
404 404
 				/** @var $user \OC\User\User */
405 405
 				\OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password));
406 406
 			});
407
-			$userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) {
407
+			$userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) {
408 408
 				/** @var $user \OC\User\User */
409 409
 				\OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password));
410 410
 			});
411
-			$userSession->listen('\OC\User', 'logout', function () {
411
+			$userSession->listen('\OC\User', 'logout', function() {
412 412
 				\OC_Hook::emit('OC_User', 'logout', array());
413 413
 			});
414
-			$userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) use ($dispatcher) {
414
+			$userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) use ($dispatcher) {
415 415
 				/** @var $user \OC\User\User */
416 416
 				\OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue));
417 417
 				$dispatcher->dispatch('OCP\IUser::changeUser', new GenericEvent($user, ['feature' => $feature, 'oldValue' => $oldValue, 'value' => $value]));
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
 		});
421 421
 		$this->registerAlias('UserSession', \OCP\IUserSession::class);
422 422
 
423
-		$this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function (Server $c) {
423
+		$this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function(Server $c) {
424 424
 			return new \OC\Authentication\TwoFactorAuth\Manager(
425 425
 				$c->getAppManager(),
426 426
 				$c->getSession(),
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
 		$this->registerAlias(\OCP\INavigationManager::class, \OC\NavigationManager::class);
437 437
 		$this->registerAlias('NavigationManager', \OCP\INavigationManager::class);
438 438
 
439
-		$this->registerService(\OC\AllConfig::class, function (Server $c) {
439
+		$this->registerService(\OC\AllConfig::class, function(Server $c) {
440 440
 			return new \OC\AllConfig(
441 441
 				$c->getSystemConfig()
442 442
 			);
@@ -444,17 +444,17 @@  discard block
 block discarded – undo
444 444
 		$this->registerAlias('AllConfig', \OC\AllConfig::class);
445 445
 		$this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class);
446 446
 
447
-		$this->registerService('SystemConfig', function ($c) use ($config) {
447
+		$this->registerService('SystemConfig', function($c) use ($config) {
448 448
 			return new \OC\SystemConfig($config);
449 449
 		});
450 450
 
451
-		$this->registerService(\OC\AppConfig::class, function (Server $c) {
451
+		$this->registerService(\OC\AppConfig::class, function(Server $c) {
452 452
 			return new \OC\AppConfig($c->getDatabaseConnection());
453 453
 		});
454 454
 		$this->registerAlias('AppConfig', \OC\AppConfig::class);
455 455
 		$this->registerAlias(\OCP\IAppConfig::class, \OC\AppConfig::class);
456 456
 
457
-		$this->registerService(\OCP\L10N\IFactory::class, function (Server $c) {
457
+		$this->registerService(\OCP\L10N\IFactory::class, function(Server $c) {
458 458
 			return new \OC\L10N\Factory(
459 459
 				$c->getConfig(),
460 460
 				$c->getRequest(),
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
 		});
465 465
 		$this->registerAlias('L10NFactory', \OCP\L10N\IFactory::class);
466 466
 
467
-		$this->registerService(\OCP\IURLGenerator::class, function (Server $c) {
467
+		$this->registerService(\OCP\IURLGenerator::class, function(Server $c) {
468 468
 			$config = $c->getConfig();
469 469
 			$cacheFactory = $c->getMemCacheFactory();
470 470
 			$request = $c->getRequest();
@@ -479,12 +479,12 @@  discard block
 block discarded – undo
479 479
 		$this->registerAlias('AppFetcher', AppFetcher::class);
480 480
 		$this->registerAlias('CategoryFetcher', CategoryFetcher::class);
481 481
 
482
-		$this->registerService(\OCP\ICache::class, function ($c) {
482
+		$this->registerService(\OCP\ICache::class, function($c) {
483 483
 			return new Cache\File();
484 484
 		});
485 485
 		$this->registerAlias('UserCache', \OCP\ICache::class);
486 486
 
487
-		$this->registerService(Factory::class, function (Server $c) {
487
+		$this->registerService(Factory::class, function(Server $c) {
488 488
 
489 489
 			$arrayCacheFactory = new \OC\Memcache\Factory('', $c->getLogger(),
490 490
 				ArrayCache::class,
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
 				$version = implode(',', $v);
502 502
 				$instanceId = \OC_Util::getInstanceId();
503 503
 				$path = \OC::$SERVERROOT;
504
-				$prefix = md5($instanceId . '-' . $version . '-' . $path);
504
+				$prefix = md5($instanceId.'-'.$version.'-'.$path);
505 505
 				return new \OC\Memcache\Factory($prefix, $c->getLogger(),
506 506
 					$config->getSystemValue('memcache.local', null),
507 507
 					$config->getSystemValue('memcache.distributed', null),
@@ -514,12 +514,12 @@  discard block
 block discarded – undo
514 514
 		$this->registerAlias('MemCacheFactory', Factory::class);
515 515
 		$this->registerAlias(ICacheFactory::class, Factory::class);
516 516
 
517
-		$this->registerService('RedisFactory', function (Server $c) {
517
+		$this->registerService('RedisFactory', function(Server $c) {
518 518
 			$systemConfig = $c->getSystemConfig();
519 519
 			return new RedisFactory($systemConfig);
520 520
 		});
521 521
 
522
-		$this->registerService(\OCP\Activity\IManager::class, function (Server $c) {
522
+		$this->registerService(\OCP\Activity\IManager::class, function(Server $c) {
523 523
 			return new \OC\Activity\Manager(
524 524
 				$c->getRequest(),
525 525
 				$c->getUserSession(),
@@ -529,14 +529,14 @@  discard block
 block discarded – undo
529 529
 		});
530 530
 		$this->registerAlias('ActivityManager', \OCP\Activity\IManager::class);
531 531
 
532
-		$this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) {
532
+		$this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) {
533 533
 			return new \OC\Activity\EventMerger(
534 534
 				$c->getL10N('lib')
535 535
 			);
536 536
 		});
537 537
 		$this->registerAlias(IValidator::class, Validator::class);
538 538
 
539
-		$this->registerService(\OCP\IAvatarManager::class, function (Server $c) {
539
+		$this->registerService(\OCP\IAvatarManager::class, function(Server $c) {
540 540
 			return new AvatarManager(
541 541
 				$c->query(\OC\User\Manager::class),
542 542
 				$c->getAppDataDir('avatar'),
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
 
550 550
 		$this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class);
551 551
 
552
-		$this->registerService(\OCP\ILogger::class, function (Server $c) {
552
+		$this->registerService(\OCP\ILogger::class, function(Server $c) {
553 553
 			$logType = $c->query('AllConfig')->getSystemValue('log_type', 'file');
554 554
 			$factory = new LogFactory($c, $this->getSystemConfig());
555 555
 			$logger = $factory->get($logType);
@@ -559,11 +559,11 @@  discard block
 block discarded – undo
559 559
 		});
560 560
 		$this->registerAlias('Logger', \OCP\ILogger::class);
561 561
 
562
-		$this->registerService(ILogFactory::class, function (Server $c) {
562
+		$this->registerService(ILogFactory::class, function(Server $c) {
563 563
 			return new LogFactory($c, $this->getSystemConfig());
564 564
 		});
565 565
 
566
-		$this->registerService(\OCP\BackgroundJob\IJobList::class, function (Server $c) {
566
+		$this->registerService(\OCP\BackgroundJob\IJobList::class, function(Server $c) {
567 567
 			$config = $c->getConfig();
568 568
 			return new \OC\BackgroundJob\JobList(
569 569
 				$c->getDatabaseConnection(),
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
 		});
574 574
 		$this->registerAlias('JobList', \OCP\BackgroundJob\IJobList::class);
575 575
 
576
-		$this->registerService(\OCP\Route\IRouter::class, function (Server $c) {
576
+		$this->registerService(\OCP\Route\IRouter::class, function(Server $c) {
577 577
 			$cacheFactory = $c->getMemCacheFactory();
578 578
 			$logger = $c->getLogger();
579 579
 			if ($cacheFactory->isLocalCacheAvailable()) {
@@ -585,12 +585,12 @@  discard block
 block discarded – undo
585 585
 		});
586 586
 		$this->registerAlias('Router', \OCP\Route\IRouter::class);
587 587
 
588
-		$this->registerService(\OCP\ISearch::class, function ($c) {
588
+		$this->registerService(\OCP\ISearch::class, function($c) {
589 589
 			return new Search();
590 590
 		});
591 591
 		$this->registerAlias('Search', \OCP\ISearch::class);
592 592
 
593
-		$this->registerService(\OC\Security\RateLimiting\Limiter::class, function (Server $c) {
593
+		$this->registerService(\OC\Security\RateLimiting\Limiter::class, function(Server $c) {
594 594
 			return new \OC\Security\RateLimiting\Limiter(
595 595
 				$this->getUserSession(),
596 596
 				$this->getRequest(),
@@ -598,34 +598,34 @@  discard block
 block discarded – undo
598 598
 				$c->query(\OC\Security\RateLimiting\Backend\IBackend::class)
599 599
 			);
600 600
 		});
601
-		$this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) {
601
+		$this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) {
602 602
 			return new \OC\Security\RateLimiting\Backend\MemoryCache(
603 603
 				$this->getMemCacheFactory(),
604 604
 				new \OC\AppFramework\Utility\TimeFactory()
605 605
 			);
606 606
 		});
607 607
 
608
-		$this->registerService(\OCP\Security\ISecureRandom::class, function ($c) {
608
+		$this->registerService(\OCP\Security\ISecureRandom::class, function($c) {
609 609
 			return new SecureRandom();
610 610
 		});
611 611
 		$this->registerAlias('SecureRandom', \OCP\Security\ISecureRandom::class);
612 612
 
613
-		$this->registerService(\OCP\Security\ICrypto::class, function (Server $c) {
613
+		$this->registerService(\OCP\Security\ICrypto::class, function(Server $c) {
614 614
 			return new Crypto($c->getConfig(), $c->getSecureRandom());
615 615
 		});
616 616
 		$this->registerAlias('Crypto', \OCP\Security\ICrypto::class);
617 617
 
618
-		$this->registerService(\OCP\Security\IHasher::class, function (Server $c) {
618
+		$this->registerService(\OCP\Security\IHasher::class, function(Server $c) {
619 619
 			return new Hasher($c->getConfig());
620 620
 		});
621 621
 		$this->registerAlias('Hasher', \OCP\Security\IHasher::class);
622 622
 
623
-		$this->registerService(\OCP\Security\ICredentialsManager::class, function (Server $c) {
623
+		$this->registerService(\OCP\Security\ICredentialsManager::class, function(Server $c) {
624 624
 			return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection());
625 625
 		});
626 626
 		$this->registerAlias('CredentialsManager', \OCP\Security\ICredentialsManager::class);
627 627
 
628
-		$this->registerService(IDBConnection::class, function (Server $c) {
628
+		$this->registerService(IDBConnection::class, function(Server $c) {
629 629
 			$systemConfig = $c->getSystemConfig();
630 630
 			$factory = new \OC\DB\ConnectionFactory($systemConfig);
631 631
 			$type = $systemConfig->getValue('dbtype', 'sqlite');
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
 		$this->registerAlias('DatabaseConnection', IDBConnection::class);
641 641
 
642 642
 
643
-		$this->registerService(\OCP\Http\Client\IClientService::class, function (Server $c) {
643
+		$this->registerService(\OCP\Http\Client\IClientService::class, function(Server $c) {
644 644
 			$user = \OC_User::getUser();
645 645
 			$uid = $user ? $user : null;
646 646
 			return new ClientService(
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
 			);
656 656
 		});
657 657
 		$this->registerAlias('HttpClientService', \OCP\Http\Client\IClientService::class);
658
-		$this->registerService(\OCP\Diagnostics\IEventLogger::class, function (Server $c) {
658
+		$this->registerService(\OCP\Diagnostics\IEventLogger::class, function(Server $c) {
659 659
 			$eventLogger = new EventLogger();
660 660
 			if ($c->getSystemConfig()->getValue('debug', false)) {
661 661
 				// In debug mode, module is being activated by default
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
 		});
666 666
 		$this->registerAlias('EventLogger', \OCP\Diagnostics\IEventLogger::class);
667 667
 
668
-		$this->registerService(\OCP\Diagnostics\IQueryLogger::class, function (Server $c) {
668
+		$this->registerService(\OCP\Diagnostics\IQueryLogger::class, function(Server $c) {
669 669
 			$queryLogger = new QueryLogger();
670 670
 			if ($c->getSystemConfig()->getValue('debug', false)) {
671 671
 				// In debug mode, module is being activated by default
@@ -675,7 +675,7 @@  discard block
 block discarded – undo
675 675
 		});
676 676
 		$this->registerAlias('QueryLogger', \OCP\Diagnostics\IQueryLogger::class);
677 677
 
678
-		$this->registerService(TempManager::class, function (Server $c) {
678
+		$this->registerService(TempManager::class, function(Server $c) {
679 679
 			return new TempManager(
680 680
 				$c->getLogger(),
681 681
 				$c->getConfig()
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
 		$this->registerAlias('TempManager', TempManager::class);
685 685
 		$this->registerAlias(ITempManager::class, TempManager::class);
686 686
 
687
-		$this->registerService(AppManager::class, function (Server $c) {
687
+		$this->registerService(AppManager::class, function(Server $c) {
688 688
 			return new \OC\App\AppManager(
689 689
 				$c->getUserSession(),
690 690
 				$c->getConfig(),
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
 		$this->registerAlias('AppManager', AppManager::class);
697 697
 		$this->registerAlias(IAppManager::class, AppManager::class);
698 698
 
699
-		$this->registerService(\OCP\IDateTimeZone::class, function (Server $c) {
699
+		$this->registerService(\OCP\IDateTimeZone::class, function(Server $c) {
700 700
 			return new DateTimeZone(
701 701
 				$c->getConfig(),
702 702
 				$c->getSession()
@@ -704,7 +704,7 @@  discard block
 block discarded – undo
704 704
 		});
705 705
 		$this->registerAlias('DateTimeZone', \OCP\IDateTimeZone::class);
706 706
 
707
-		$this->registerService(\OCP\IDateTimeFormatter::class, function (Server $c) {
707
+		$this->registerService(\OCP\IDateTimeFormatter::class, function(Server $c) {
708 708
 			$language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null);
709 709
 
710 710
 			return new DateTimeFormatter(
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
 		});
715 715
 		$this->registerAlias('DateTimeFormatter', \OCP\IDateTimeFormatter::class);
716 716
 
717
-		$this->registerService(\OCP\Files\Config\IUserMountCache::class, function (Server $c) {
717
+		$this->registerService(\OCP\Files\Config\IUserMountCache::class, function(Server $c) {
718 718
 			$mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger());
719 719
 			$listener = new UserMountCacheListener($mountCache);
720 720
 			$listener->listen($c->getUserManager());
@@ -722,7 +722,7 @@  discard block
 block discarded – undo
722 722
 		});
723 723
 		$this->registerAlias('UserMountCache', \OCP\Files\Config\IUserMountCache::class);
724 724
 
725
-		$this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function (Server $c) {
725
+		$this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function(Server $c) {
726 726
 			$loader = \OC\Files\Filesystem::getLoader();
727 727
 			$mountCache = $c->query('UserMountCache');
728 728
 			$manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache);
@@ -738,10 +738,10 @@  discard block
 block discarded – undo
738 738
 		});
739 739
 		$this->registerAlias('MountConfigManager', \OCP\Files\Config\IMountProviderCollection::class);
740 740
 
741
-		$this->registerService('IniWrapper', function ($c) {
741
+		$this->registerService('IniWrapper', function($c) {
742 742
 			return new IniGetWrapper();
743 743
 		});
744
-		$this->registerService('AsyncCommandBus', function (Server $c) {
744
+		$this->registerService('AsyncCommandBus', function(Server $c) {
745 745
 			$busClass = $c->getConfig()->getSystemValue('commandbus');
746 746
 			if ($busClass) {
747 747
 				list($app, $class) = explode('::', $busClass, 2);
@@ -756,10 +756,10 @@  discard block
 block discarded – undo
756 756
 				return new CronBus($jobList);
757 757
 			}
758 758
 		});
759
-		$this->registerService('TrustedDomainHelper', function ($c) {
759
+		$this->registerService('TrustedDomainHelper', function($c) {
760 760
 			return new TrustedDomainHelper($this->getConfig());
761 761
 		});
762
-		$this->registerService('Throttler', function (Server $c) {
762
+		$this->registerService('Throttler', function(Server $c) {
763 763
 			return new Throttler(
764 764
 				$c->getDatabaseConnection(),
765 765
 				new TimeFactory(),
@@ -767,7 +767,7 @@  discard block
 block discarded – undo
767 767
 				$c->getConfig()
768 768
 			);
769 769
 		});
770
-		$this->registerService('IntegrityCodeChecker', function (Server $c) {
770
+		$this->registerService('IntegrityCodeChecker', function(Server $c) {
771 771
 			// IConfig and IAppManager requires a working database. This code
772 772
 			// might however be called when ownCloud is not yet setup.
773 773
 			if (\OC::$server->getSystemConfig()->getValue('installed', false)) {
@@ -788,7 +788,7 @@  discard block
 block discarded – undo
788 788
 				$c->getTempManager()
789 789
 			);
790 790
 		});
791
-		$this->registerService(\OCP\IRequest::class, function ($c) {
791
+		$this->registerService(\OCP\IRequest::class, function($c) {
792 792
 			if (isset($this['urlParams'])) {
793 793
 				$urlParams = $this['urlParams'];
794 794
 			} else {
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
 		});
825 825
 		$this->registerAlias('Request', \OCP\IRequest::class);
826 826
 
827
-		$this->registerService(\OCP\Mail\IMailer::class, function (Server $c) {
827
+		$this->registerService(\OCP\Mail\IMailer::class, function(Server $c) {
828 828
 			return new Mailer(
829 829
 				$c->getConfig(),
830 830
 				$c->getLogger(),
@@ -835,7 +835,7 @@  discard block
 block discarded – undo
835 835
 		});
836 836
 		$this->registerAlias('Mailer', \OCP\Mail\IMailer::class);
837 837
 
838
-		$this->registerService('LDAPProvider', function (Server $c) {
838
+		$this->registerService('LDAPProvider', function(Server $c) {
839 839
 			$config = $c->getConfig();
840 840
 			$factoryClass = $config->getSystemValue('ldapProviderFactory', null);
841 841
 			if (is_null($factoryClass)) {
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
 			$factory = new $factoryClass($this);
846 846
 			return $factory->getLDAPProvider();
847 847
 		});
848
-		$this->registerService(ILockingProvider::class, function (Server $c) {
848
+		$this->registerService(ILockingProvider::class, function(Server $c) {
849 849
 			$ini = $c->getIniWrapper();
850 850
 			$config = $c->getConfig();
851 851
 			$ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time')));
@@ -868,49 +868,49 @@  discard block
 block discarded – undo
868 868
 		});
869 869
 		$this->registerAlias('LockingProvider', ILockingProvider::class);
870 870
 
871
-		$this->registerService(\OCP\Files\Mount\IMountManager::class, function () {
871
+		$this->registerService(\OCP\Files\Mount\IMountManager::class, function() {
872 872
 			return new \OC\Files\Mount\Manager();
873 873
 		});
874 874
 		$this->registerAlias('MountManager', \OCP\Files\Mount\IMountManager::class);
875 875
 
876
-		$this->registerService(\OCP\Files\IMimeTypeDetector::class, function (Server $c) {
876
+		$this->registerService(\OCP\Files\IMimeTypeDetector::class, function(Server $c) {
877 877
 			return new \OC\Files\Type\Detection(
878 878
 				$c->getURLGenerator(),
879 879
 				\OC::$configDir,
880
-				\OC::$SERVERROOT . '/resources/config/'
880
+				\OC::$SERVERROOT.'/resources/config/'
881 881
 			);
882 882
 		});
883 883
 		$this->registerAlias('MimeTypeDetector', \OCP\Files\IMimeTypeDetector::class);
884 884
 
885
-		$this->registerService(\OCP\Files\IMimeTypeLoader::class, function (Server $c) {
885
+		$this->registerService(\OCP\Files\IMimeTypeLoader::class, function(Server $c) {
886 886
 			return new \OC\Files\Type\Loader(
887 887
 				$c->getDatabaseConnection()
888 888
 			);
889 889
 		});
890 890
 		$this->registerAlias('MimeTypeLoader', \OCP\Files\IMimeTypeLoader::class);
891
-		$this->registerService(BundleFetcher::class, function () {
891
+		$this->registerService(BundleFetcher::class, function() {
892 892
 			return new BundleFetcher($this->getL10N('lib'));
893 893
 		});
894
-		$this->registerService(\OCP\Notification\IManager::class, function (Server $c) {
894
+		$this->registerService(\OCP\Notification\IManager::class, function(Server $c) {
895 895
 			return new Manager(
896 896
 				$c->query(IValidator::class)
897 897
 			);
898 898
 		});
899 899
 		$this->registerAlias('NotificationManager', \OCP\Notification\IManager::class);
900 900
 
901
-		$this->registerService(\OC\CapabilitiesManager::class, function (Server $c) {
901
+		$this->registerService(\OC\CapabilitiesManager::class, function(Server $c) {
902 902
 			$manager = new \OC\CapabilitiesManager($c->getLogger());
903
-			$manager->registerCapability(function () use ($c) {
903
+			$manager->registerCapability(function() use ($c) {
904 904
 				return new \OC\OCS\CoreCapabilities($c->getConfig());
905 905
 			});
906
-			$manager->registerCapability(function () use ($c) {
906
+			$manager->registerCapability(function() use ($c) {
907 907
 				return $c->query(\OC\Security\Bruteforce\Capabilities::class);
908 908
 			});
909 909
 			return $manager;
910 910
 		});
911 911
 		$this->registerAlias('CapabilitiesManager', \OC\CapabilitiesManager::class);
912 912
 
913
-		$this->registerService(\OCP\Comments\ICommentsManager::class, function (Server $c) {
913
+		$this->registerService(\OCP\Comments\ICommentsManager::class, function(Server $c) {
914 914
 			$config = $c->getConfig();
915 915
 			$factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class);
916 916
 			/** @var \OCP\Comments\ICommentsManagerFactory $factory */
@@ -920,7 +920,7 @@  discard block
 block discarded – undo
920 920
 			$manager->registerDisplayNameResolver('user', function($id) use ($c) {
921 921
 				$manager = $c->getUserManager();
922 922
 				$user = $manager->get($id);
923
-				if(is_null($user)) {
923
+				if (is_null($user)) {
924 924
 					$l = $c->getL10N('core');
925 925
 					$displayName = $l->t('Unknown user');
926 926
 				} else {
@@ -933,7 +933,7 @@  discard block
 block discarded – undo
933 933
 		});
934 934
 		$this->registerAlias('CommentsManager', \OCP\Comments\ICommentsManager::class);
935 935
 
936
-		$this->registerService('ThemingDefaults', function (Server $c) {
936
+		$this->registerService('ThemingDefaults', function(Server $c) {
937 937
 			/*
938 938
 			 * Dark magic for autoloader.
939 939
 			 * If we do a class_exists it will try to load the class which will
@@ -960,7 +960,7 @@  discard block
 block discarded – undo
960 960
 			}
961 961
 			return new \OC_Defaults();
962 962
 		});
963
-		$this->registerService(SCSSCacher::class, function (Server $c) {
963
+		$this->registerService(SCSSCacher::class, function(Server $c) {
964 964
 			/** @var Factory $cacheFactory */
965 965
 			$cacheFactory = $c->query(Factory::class);
966 966
 			return new SCSSCacher(
@@ -973,7 +973,7 @@  discard block
 block discarded – undo
973 973
 				$this->getMemCacheFactory()
974 974
 			);
975 975
 		});
976
-		$this->registerService(JSCombiner::class, function (Server $c) {
976
+		$this->registerService(JSCombiner::class, function(Server $c) {
977 977
 			/** @var Factory $cacheFactory */
978 978
 			$cacheFactory = $c->query(Factory::class);
979 979
 			return new JSCombiner(
@@ -984,13 +984,13 @@  discard block
 block discarded – undo
984 984
 				$c->getLogger()
985 985
 			);
986 986
 		});
987
-		$this->registerService(EventDispatcher::class, function () {
987
+		$this->registerService(EventDispatcher::class, function() {
988 988
 			return new EventDispatcher();
989 989
 		});
990 990
 		$this->registerAlias('EventDispatcher', EventDispatcher::class);
991 991
 		$this->registerAlias(EventDispatcherInterface::class, EventDispatcher::class);
992 992
 
993
-		$this->registerService('CryptoWrapper', function (Server $c) {
993
+		$this->registerService('CryptoWrapper', function(Server $c) {
994 994
 			// FIXME: Instantiiated here due to cyclic dependency
995 995
 			$request = new Request(
996 996
 				[
@@ -1015,7 +1015,7 @@  discard block
 block discarded – undo
1015 1015
 				$request
1016 1016
 			);
1017 1017
 		});
1018
-		$this->registerService('CsrfTokenManager', function (Server $c) {
1018
+		$this->registerService('CsrfTokenManager', function(Server $c) {
1019 1019
 			$tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom());
1020 1020
 
1021 1021
 			return new CsrfTokenManager(
@@ -1023,22 +1023,22 @@  discard block
 block discarded – undo
1023 1023
 				$c->query(SessionStorage::class)
1024 1024
 			);
1025 1025
 		});
1026
-		$this->registerService(SessionStorage::class, function (Server $c) {
1026
+		$this->registerService(SessionStorage::class, function(Server $c) {
1027 1027
 			return new SessionStorage($c->getSession());
1028 1028
 		});
1029
-		$this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function (Server $c) {
1029
+		$this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function(Server $c) {
1030 1030
 			return new ContentSecurityPolicyManager();
1031 1031
 		});
1032 1032
 		$this->registerAlias('ContentSecurityPolicyManager', \OCP\Security\IContentSecurityPolicyManager::class);
1033 1033
 
1034
-		$this->registerService('ContentSecurityPolicyNonceManager', function (Server $c) {
1034
+		$this->registerService('ContentSecurityPolicyNonceManager', function(Server $c) {
1035 1035
 			return new ContentSecurityPolicyNonceManager(
1036 1036
 				$c->getCsrfTokenManager(),
1037 1037
 				$c->getRequest()
1038 1038
 			);
1039 1039
 		});
1040 1040
 
1041
-		$this->registerService(\OCP\Share\IManager::class, function (Server $c) {
1041
+		$this->registerService(\OCP\Share\IManager::class, function(Server $c) {
1042 1042
 			$config = $c->getConfig();
1043 1043
 			$factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class);
1044 1044
 			/** @var \OCP\Share\IProviderFactory $factory */
@@ -1081,7 +1081,7 @@  discard block
 block discarded – undo
1081 1081
 
1082 1082
 		$this->registerAlias(\OCP\Collaboration\AutoComplete\IManager::class, \OC\Collaboration\AutoComplete\Manager::class);
1083 1083
 
1084
-		$this->registerService('SettingsManager', function (Server $c) {
1084
+		$this->registerService('SettingsManager', function(Server $c) {
1085 1085
 			$manager = new \OC\Settings\Manager(
1086 1086
 				$c->getLogger(),
1087 1087
 				$c->getDatabaseConnection(),
@@ -1099,24 +1099,24 @@  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
 
@@ -1126,18 +1126,18 @@  discard block
 block discarded – undo
1126 1126
 		$this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class);
1127 1127
 		$this->registerAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class);
1128 1128
 
1129
-		$this->registerService(Defaults::class, function (Server $c) {
1129
+		$this->registerService(Defaults::class, function(Server $c) {
1130 1130
 			return new Defaults(
1131 1131
 				$c->getThemingDefaults()
1132 1132
 			);
1133 1133
 		});
1134 1134
 		$this->registerAlias('Defaults', \OCP\Defaults::class);
1135 1135
 
1136
-		$this->registerService(\OCP\ISession::class, function (SimpleContainer $c) {
1136
+		$this->registerService(\OCP\ISession::class, function(SimpleContainer $c) {
1137 1137
 			return $c->query(\OCP\IUserSession::class)->getSession();
1138 1138
 		});
1139 1139
 
1140
-		$this->registerService(IShareHelper::class, function (Server $c) {
1140
+		$this->registerService(IShareHelper::class, function(Server $c) {
1141 1141
 			return new ShareHelper(
1142 1142
 				$c->query(\OCP\Share\IManager::class)
1143 1143
 			);
@@ -1199,11 +1199,11 @@  discard block
 block discarded – undo
1199 1199
 				// no avatar to remove
1200 1200
 			} catch (\Exception $e) {
1201 1201
 				// Ignore exceptions
1202
-				$logger->info('Could not cleanup avatar of ' . $user->getUID());
1202
+				$logger->info('Could not cleanup avatar of '.$user->getUID());
1203 1203
 			}
1204 1204
 		});
1205 1205
 
1206
-		$dispatcher->addListener('OCP\IUser::changeUser', function (GenericEvent $e) {
1206
+		$dispatcher->addListener('OCP\IUser::changeUser', function(GenericEvent $e) {
1207 1207
 			$manager = $this->getAvatarManager();
1208 1208
 			/** @var IUser $user */
1209 1209
 			$user = $e->getSubject();
@@ -1354,7 +1354,7 @@  discard block
 block discarded – undo
1354 1354
 	 * @deprecated since 9.2.0 use IAppData
1355 1355
 	 */
1356 1356
 	public function getAppFolder() {
1357
-		$dir = '/' . \OC_App::getCurrentApp();
1357
+		$dir = '/'.\OC_App::getCurrentApp();
1358 1358
 		$root = $this->getRootFolder();
1359 1359
 		if (!$root->nodeExists($dir)) {
1360 1360
 			$folder = $root->newFolder($dir);
@@ -1929,7 +1929,7 @@  discard block
 block discarded – undo
1929 1929
 	/**
1930 1930
 	 * @return \OCP\Collaboration\AutoComplete\IManager
1931 1931
 	 */
1932
-	public function getAutoCompleteManager(){
1932
+	public function getAutoCompleteManager() {
1933 1933
 		return $this->query(IManager::class);
1934 1934
 	}
1935 1935
 
Please login to merge, or discard this patch.
lib/private/App/AppManager.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -114,11 +114,11 @@  discard block
 block discarded – undo
114 114
 			$values = \OC::$server->getAppConfig()->getValues(false, 'enabled');
115 115
 
116 116
 			$alwaysEnabledApps = $this->getAlwaysEnabledApps();
117
-			foreach($alwaysEnabledApps as $appId) {
117
+			foreach ($alwaysEnabledApps as $appId) {
118 118
 				$values[$appId] = 'yes';
119 119
 			}
120 120
 
121
-			$this->installedAppsCache = array_filter($values, function ($value) {
121
+			$this->installedAppsCache = array_filter($values, function($value) {
122 122
 				return $value !== 'no';
123 123
 			});
124 124
 			ksort($this->installedAppsCache);
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 	 */
144 144
 	public function getEnabledAppsForUser(IUser $user) {
145 145
 		$apps = $this->getInstalledAppsValues();
146
-		$appsForUser = array_filter($apps, function ($enabled) use ($user) {
146
+		$appsForUser = array_filter($apps, function($enabled) use ($user) {
147 147
 			return $this->checkAppForUser($enabled, $user);
148 148
 		});
149 149
 		return array_keys($appsForUser);
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 		} elseif ($user === null) {
183 183
 			return false;
184 184
 		} else {
185
-			if(empty($enabled)){
185
+			if (empty($enabled)) {
186 186
 				return false;
187 187
 			}
188 188
 
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 
191 191
 			if (!is_array($groupIds)) {
192 192
 				$jsonError = json_last_error();
193
-				\OC::$server->getLogger()->warning('AppManger::checkAppForUser - can\'t decode group IDs: ' . print_r($enabled, true) . ' - json error code: ' . $jsonError, ['app' => 'lib']);
193
+				\OC::$server->getLogger()->warning('AppManger::checkAppForUser - can\'t decode group IDs: '.print_r($enabled, true).' - json error code: '.$jsonError, ['app' => 'lib']);
194 194
 				return false;
195 195
 			}
196 196
 
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 			}
267 267
 		}
268 268
 
269
-		$groupIds = array_map(function ($group) {
269
+		$groupIds = array_map(function($group) {
270 270
 			/** @var \OCP\IGroup $group */
271 271
 			return $group->getGID();
272 272
 		}, $groups);
@@ -305,8 +305,8 @@  discard block
 block discarded – undo
305 305
 	 */
306 306
 	public function getAppPath($appId) {
307 307
 		$appPath = \OC_App::getAppPath($appId);
308
-		if($appPath === false) {
309
-			throw new AppPathNotFoundException('Could not find path for ' . $appId);
308
+		if ($appPath === false) {
309
+			throw new AppPathNotFoundException('Could not find path for '.$appId);
310 310
 		}
311 311
 		return $appPath;
312 312
 	}
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
 			} catch (AppPathNotFoundException $e) {
367 367
 				return null;
368 368
 			}
369
-			$file = $appPath . '/appinfo/info.xml';
369
+			$file = $appPath.'/appinfo/info.xml';
370 370
 		}
371 371
 
372 372
 		$parser = new InfoParser($this->memCacheFactory->createLocal('core.appinfo'));
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 	}
385 385
 
386 386
 	public function getAppVersion(string $appId, bool $useCache = true): string {
387
-		if(!$useCache || !isset($this->appVersions[$appId])) {
387
+		if (!$useCache || !isset($this->appVersions[$appId])) {
388 388
 			$appInfo = \OC::$server->getAppManager()->getAppInfo($appId);
389 389
 			$this->appVersions[$appId] = ($appInfo !== null && isset($appInfo['version'])) ? $appInfo['version'] : '0';
390 390
 		}
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
 	 */
435 435
 	private function loadShippedJson() {
436 436
 		if ($this->shippedApps === null) {
437
-			$shippedJson = \OC::$SERVERROOT . '/core/shipped.json';
437
+			$shippedJson = \OC::$SERVERROOT.'/core/shipped.json';
438 438
 			if (!file_exists($shippedJson)) {
439 439
 				throw new \Exception("File not found: $shippedJson");
440 440
 			}
Please login to merge, or discard this patch.
settings/Controller/AppSettingsController.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -152,9 +152,9 @@  discard block
 block discarded – undo
152 152
 	private function getAppsWithUpdates() {
153 153
 		$appClass = new \OC_App();
154 154
 		$apps = $appClass->listAllApps();
155
-		foreach($apps as $key => $app) {
155
+		foreach ($apps as $key => $app) {
156 156
 			$newVersion = $this->installer->isUpdateAvailable($app['id']);
157
-			if($newVersion === false) {
157
+			if ($newVersion === false) {
158 158
 				unset($apps[$key]);
159 159
 			}
160 160
 		}
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 
190 190
 		$formattedCategories = [];
191 191
 		$categories = $this->categoryFetcher->get();
192
-		foreach($categories as $category) {
192
+		foreach ($categories as $category) {
193 193
 			$formattedCategories[] = [
194 194
 				'id' => $category['id'],
195 195
 				'ident' => $category['id'],
@@ -220,10 +220,10 @@  discard block
 block discarded – undo
220 220
 
221 221
 		// add bundle information
222 222
 		$bundles = $this->bundleFetcher->getBundles();
223
-		foreach($bundles as $bundle) {
224
-			foreach($bundle->getAppIdentifiers() as $identifier) {
225
-				foreach($this->allApps as &$app) {
226
-					if($app['id'] === $identifier) {
223
+		foreach ($bundles as $bundle) {
224
+			foreach ($bundle->getAppIdentifiers() as $identifier) {
225
+				foreach ($this->allApps as &$app) {
226
+					if ($app['id'] === $identifier) {
227 227
 						$app['bundleId'] = $bundle->getIdentifier();
228 228
 						continue;
229 229
 					}
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 			$appData['screenshot'] = isset($appstoreData['screenshots'][0]['url']) ? 'https://usercontent.apps.nextcloud.com/'.base64_encode($appstoreData['screenshots'][0]['url']) : '';
256 256
 
257 257
 			$newVersion = $this->installer->isUpdateAvailable($appData['id']);
258
-			if($newVersion && $this->appManager->isInstalled($appData['id'])) {
258
+			if ($newVersion && $this->appManager->isInstalled($appData['id'])) {
259 259
 				$appData['update'] = $newVersion;
260 260
 			}
261 261
 
@@ -299,44 +299,44 @@  discard block
 block discarded – undo
299 299
 		$versionParser = new VersionParser();
300 300
 		$formattedApps = [];
301 301
 		$apps = $this->appFetcher->get();
302
-		foreach($apps as $app) {
302
+		foreach ($apps as $app) {
303 303
 			// Skip all apps not in the requested category
304 304
 			if ($requestedCategory !== '') {
305 305
 				$isInCategory = false;
306
-				foreach($app['categories'] as $category) {
307
-					if($category === $requestedCategory) {
306
+				foreach ($app['categories'] as $category) {
307
+					if ($category === $requestedCategory) {
308 308
 						$isInCategory = true;
309 309
 					}
310 310
 				}
311
-				if(!$isInCategory) {
311
+				if (!$isInCategory) {
312 312
 					continue;
313 313
 				}
314 314
 			}
315 315
 
316 316
 			$nextCloudVersion = $versionParser->getVersion($app['releases'][0]['rawPlatformVersionSpec']);
317 317
 			$nextCloudVersionDependencies = [];
318
-			if($nextCloudVersion->getMinimumVersion() !== '') {
318
+			if ($nextCloudVersion->getMinimumVersion() !== '') {
319 319
 				$nextCloudVersionDependencies['nextcloud']['@attributes']['min-version'] = $nextCloudVersion->getMinimumVersion();
320 320
 			}
321
-			if($nextCloudVersion->getMaximumVersion() !== '') {
321
+			if ($nextCloudVersion->getMaximumVersion() !== '') {
322 322
 				$nextCloudVersionDependencies['nextcloud']['@attributes']['max-version'] = $nextCloudVersion->getMaximumVersion();
323 323
 			}
324 324
 			$phpVersion = $versionParser->getVersion($app['releases'][0]['rawPhpVersionSpec']);
325 325
 			$existsLocally = \OC_App::getAppPath($app['id']) !== false;
326 326
 			$phpDependencies = [];
327
-			if($phpVersion->getMinimumVersion() !== '') {
327
+			if ($phpVersion->getMinimumVersion() !== '') {
328 328
 				$phpDependencies['php']['@attributes']['min-version'] = $phpVersion->getMinimumVersion();
329 329
 			}
330
-			if($phpVersion->getMaximumVersion() !== '') {
330
+			if ($phpVersion->getMaximumVersion() !== '') {
331 331
 				$phpDependencies['php']['@attributes']['max-version'] = $phpVersion->getMaximumVersion();
332 332
 			}
333
-			if(isset($app['releases'][0]['minIntSize'])) {
333
+			if (isset($app['releases'][0]['minIntSize'])) {
334 334
 				$phpDependencies['php']['@attributes']['min-int-size'] = $app['releases'][0]['minIntSize'];
335 335
 			}
336 336
 			$authors = '';
337
-			foreach($app['authors'] as $key => $author) {
337
+			foreach ($app['authors'] as $key => $author) {
338 338
 				$authors .= $author['name'];
339
-				if($key !== count($app['authors']) - 1) {
339
+				if ($key !== count($app['authors']) - 1) {
340 340
 					$authors .= ', ';
341 341
 				}
342 342
 			}
@@ -344,12 +344,12 @@  discard block
 block discarded – undo
344 344
 			$currentLanguage = substr(\OC::$server->getL10NFactory()->findLanguage(), 0, 2);
345 345
 			$enabledValue = $this->config->getAppValue($app['id'], 'enabled', 'no');
346 346
 			$groups = null;
347
-			if($enabledValue !== 'no' && $enabledValue !== 'yes') {
347
+			if ($enabledValue !== 'no' && $enabledValue !== 'yes') {
348 348
 				$groups = $enabledValue;
349 349
 			}
350 350
 
351 351
 			$currentVersion = '';
352
-			if($this->appManager->isInstalled($app['id'])) {
352
+			if ($this->appManager->isInstalled($app['id'])) {
353 353
 				$currentVersion = $this->appManager->getAppVersion($app['id']);
354 354
 			} else {
355 355
 				$currentLanguage = $app['releases'][0]['version'];
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 				$installer = \OC::$server->query(Installer::class);
432 432
 				$isDownloaded = $installer->isDownloaded($appId);
433 433
 
434
-				if(!$isDownloaded) {
434
+				if (!$isDownloaded) {
435 435
 					$installer->downloadApp($appId);
436 436
 				}
437 437
 
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
 	public function uninstallApp(string $appId): JSONResponse {
505 505
 		$appId = OC_App::cleanAppId($appId);
506 506
 		$result = $this->installer->removeApp($appId);
507
-		if($result !== false) {
507
+		if ($result !== false) {
508 508
 			$this->appManager->clearAppsCache();
509 509
 			return new JSONResponse(['data' => ['appid' => $appId]]);
510 510
 		}
@@ -534,8 +534,8 @@  discard block
 block discarded – undo
534 534
 	}
535 535
 
536 536
 	private function sortApps($a, $b) {
537
-		$a = (string)$a['name'];
538
-		$b = (string)$b['name'];
537
+		$a = (string) $a['name'];
538
+		$b = (string) $b['name'];
539 539
 		if ($a === $b) {
540 540
 			return 0;
541 541
 		}
Please login to merge, or discard this patch.