@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | // To find out if we are running from CLI or not |
252 | 252 | $this->registerParameter('isCLI', \OC::$CLI); |
253 | 253 | |
254 | - $this->registerService(\OCP\IServerContainer::class, function (IServerContainer $c) { |
|
254 | + $this->registerService(\OCP\IServerContainer::class, function(IServerContainer $c) { |
|
255 | 255 | return $c; |
256 | 256 | }); |
257 | 257 | |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | $this->registerAlias(IActionFactory::class, ActionFactory::class); |
273 | 273 | |
274 | 274 | |
275 | - $this->registerService(IPreview::class, function (Server $c) { |
|
275 | + $this->registerService(IPreview::class, function(Server $c) { |
|
276 | 276 | return new PreviewManager( |
277 | 277 | $c->getConfig(), |
278 | 278 | $c->getRootFolder(), |
@@ -284,13 +284,13 @@ discard block |
||
284 | 284 | }); |
285 | 285 | $this->registerDeprecatedAlias('PreviewManager', IPreview::class); |
286 | 286 | |
287 | - $this->registerService(\OC\Preview\Watcher::class, function (Server $c) { |
|
287 | + $this->registerService(\OC\Preview\Watcher::class, function(Server $c) { |
|
288 | 288 | return new \OC\Preview\Watcher( |
289 | 289 | $c->getAppDataDir('preview') |
290 | 290 | ); |
291 | 291 | }); |
292 | 292 | |
293 | - $this->registerService(\OCP\Encryption\IManager::class, function (Server $c) { |
|
293 | + $this->registerService(\OCP\Encryption\IManager::class, function(Server $c) { |
|
294 | 294 | $view = new View(); |
295 | 295 | $util = new Encryption\Util( |
296 | 296 | $view, |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | }); |
310 | 310 | $this->registerDeprecatedAlias('EncryptionManager', \OCP\Encryption\IManager::class); |
311 | 311 | |
312 | - $this->registerService('EncryptionFileHelper', function (Server $c) { |
|
312 | + $this->registerService('EncryptionFileHelper', function(Server $c) { |
|
313 | 313 | $util = new Encryption\Util( |
314 | 314 | new View(), |
315 | 315 | $c->getUserManager(), |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | ); |
324 | 324 | }); |
325 | 325 | |
326 | - $this->registerService('EncryptionKeyStorage', function (Server $c) { |
|
326 | + $this->registerService('EncryptionKeyStorage', function(Server $c) { |
|
327 | 327 | $view = new View(); |
328 | 328 | $util = new Encryption\Util( |
329 | 329 | $view, |
@@ -334,30 +334,30 @@ discard block |
||
334 | 334 | |
335 | 335 | return new Encryption\Keys\Storage($view, $util); |
336 | 336 | }); |
337 | - $this->registerService('TagMapper', function (Server $c) { |
|
337 | + $this->registerService('TagMapper', function(Server $c) { |
|
338 | 338 | return new TagMapper($c->getDatabaseConnection()); |
339 | 339 | }); |
340 | 340 | |
341 | - $this->registerService(\OCP\ITagManager::class, function (Server $c) { |
|
341 | + $this->registerService(\OCP\ITagManager::class, function(Server $c) { |
|
342 | 342 | $tagMapper = $c->query('TagMapper'); |
343 | 343 | return new TagManager($tagMapper, $c->getUserSession()); |
344 | 344 | }); |
345 | 345 | $this->registerDeprecatedAlias('TagManager', \OCP\ITagManager::class); |
346 | 346 | |
347 | - $this->registerService('SystemTagManagerFactory', function (Server $c) { |
|
347 | + $this->registerService('SystemTagManagerFactory', function(Server $c) { |
|
348 | 348 | $config = $c->getConfig(); |
349 | 349 | $factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class); |
350 | 350 | return new $factoryClass($this); |
351 | 351 | }); |
352 | - $this->registerService(ISystemTagManager::class, function (Server $c) { |
|
352 | + $this->registerService(ISystemTagManager::class, function(Server $c) { |
|
353 | 353 | return $c->query('SystemTagManagerFactory')->getManager(); |
354 | 354 | }); |
355 | 355 | $this->registerDeprecatedAlias('SystemTagManager', ISystemTagManager::class); |
356 | 356 | |
357 | - $this->registerService(ISystemTagObjectMapper::class, function (Server $c) { |
|
357 | + $this->registerService(ISystemTagObjectMapper::class, function(Server $c) { |
|
358 | 358 | return $c->query('SystemTagManagerFactory')->getObjectMapper(); |
359 | 359 | }); |
360 | - $this->registerService('RootFolder', function (Server $c) { |
|
360 | + $this->registerService('RootFolder', function(Server $c) { |
|
361 | 361 | $manager = \OC\Files\Filesystem::getMountManager(null); |
362 | 362 | $view = new View(); |
363 | 363 | $root = new Root( |
@@ -378,8 +378,8 @@ discard block |
||
378 | 378 | }); |
379 | 379 | $this->registerDeprecatedAlias('SystemTagObjectMapper', ISystemTagObjectMapper::class); |
380 | 380 | |
381 | - $this->registerService(IRootFolder::class, function (Server $c) { |
|
382 | - return new LazyRoot(function () use ($c) { |
|
381 | + $this->registerService(IRootFolder::class, function(Server $c) { |
|
382 | + return new LazyRoot(function() use ($c) { |
|
383 | 383 | return $c->query('RootFolder'); |
384 | 384 | }); |
385 | 385 | }); |
@@ -388,44 +388,44 @@ discard block |
||
388 | 388 | $this->registerDeprecatedAlias('UserManager', \OC\User\Manager::class); |
389 | 389 | $this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class); |
390 | 390 | |
391 | - $this->registerService(\OCP\IGroupManager::class, function (Server $c) { |
|
391 | + $this->registerService(\OCP\IGroupManager::class, function(Server $c) { |
|
392 | 392 | $groupManager = new \OC\Group\Manager($this->getUserManager(), $c->getEventDispatcher(), $this->getLogger()); |
393 | - $groupManager->listen('\OC\Group', 'preCreate', function ($gid) { |
|
393 | + $groupManager->listen('\OC\Group', 'preCreate', function($gid) { |
|
394 | 394 | \OC_Hook::emit('OC_Group', 'pre_createGroup', array('run' => true, 'gid' => $gid)); |
395 | 395 | |
396 | 396 | /** @var IEventDispatcher $dispatcher */ |
397 | 397 | $dispatcher = $this->query(IEventDispatcher::class); |
398 | 398 | $dispatcher->dispatchTyped(new BeforeGroupCreatedEvent($gid)); |
399 | 399 | }); |
400 | - $groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $group) { |
|
400 | + $groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $group) { |
|
401 | 401 | \OC_Hook::emit('OC_User', 'post_createGroup', array('gid' => $group->getGID())); |
402 | 402 | |
403 | 403 | /** @var IEventDispatcher $dispatcher */ |
404 | 404 | $dispatcher = $this->query(IEventDispatcher::class); |
405 | 405 | $dispatcher->dispatchTyped(new GroupCreatedEvent($group)); |
406 | 406 | }); |
407 | - $groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) { |
|
407 | + $groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) { |
|
408 | 408 | \OC_Hook::emit('OC_Group', 'pre_deleteGroup', array('run' => true, 'gid' => $group->getGID())); |
409 | 409 | |
410 | 410 | /** @var IEventDispatcher $dispatcher */ |
411 | 411 | $dispatcher = $this->query(IEventDispatcher::class); |
412 | 412 | $dispatcher->dispatchTyped(new BeforeGroupDeletedEvent($group)); |
413 | 413 | }); |
414 | - $groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) { |
|
414 | + $groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) { |
|
415 | 415 | \OC_Hook::emit('OC_User', 'post_deleteGroup', array('gid' => $group->getGID())); |
416 | 416 | |
417 | 417 | /** @var IEventDispatcher $dispatcher */ |
418 | 418 | $dispatcher = $this->query(IEventDispatcher::class); |
419 | 419 | $dispatcher->dispatchTyped(new GroupDeletedEvent($group)); |
420 | 420 | }); |
421 | - $groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
421 | + $groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
422 | 422 | \OC_Hook::emit('OC_Group', 'pre_addToGroup', array('run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID())); |
423 | 423 | |
424 | 424 | /** @var IEventDispatcher $dispatcher */ |
425 | 425 | $dispatcher = $this->query(IEventDispatcher::class); |
426 | 426 | $dispatcher->dispatchTyped(new BeforeUserAddedEvent($group, $user)); |
427 | 427 | }); |
428 | - $groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
428 | + $groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
429 | 429 | \OC_Hook::emit('OC_Group', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
430 | 430 | //Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks |
431 | 431 | \OC_Hook::emit('OC_User', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
@@ -434,12 +434,12 @@ discard block |
||
434 | 434 | $dispatcher = $this->query(IEventDispatcher::class); |
435 | 435 | $dispatcher->dispatchTyped(new UserAddedEvent($group, $user)); |
436 | 436 | }); |
437 | - $groupManager->listen('\OC\Group', 'preRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
437 | + $groupManager->listen('\OC\Group', 'preRemoveUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
438 | 438 | /** @var IEventDispatcher $dispatcher */ |
439 | 439 | $dispatcher = $this->query(IEventDispatcher::class); |
440 | 440 | $dispatcher->dispatchTyped(new BeforeUserRemovedEvent($group, $user)); |
441 | 441 | }); |
442 | - $groupManager->listen('\OC\Group', 'postRemoveUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
442 | + $groupManager->listen('\OC\Group', 'postRemoveUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
443 | 443 | /** @var IEventDispatcher $dispatcher */ |
444 | 444 | $dispatcher = $this->query(IEventDispatcher::class); |
445 | 445 | $dispatcher->dispatchTyped(new UserRemovedEvent($group, $user)); |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | }); |
449 | 449 | $this->registerDeprecatedAlias('GroupManager', \OCP\IGroupManager::class); |
450 | 450 | |
451 | - $this->registerService(Store::class, function (Server $c) { |
|
451 | + $this->registerService(Store::class, function(Server $c) { |
|
452 | 452 | $session = $c->getSession(); |
453 | 453 | if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
454 | 454 | $tokenProvider = $c->query(IProvider::class); |
@@ -459,13 +459,13 @@ discard block |
||
459 | 459 | return new Store($session, $logger, $tokenProvider); |
460 | 460 | }); |
461 | 461 | $this->registerAlias(IStore::class, Store::class); |
462 | - $this->registerService(Authentication\Token\DefaultTokenMapper::class, function (Server $c) { |
|
462 | + $this->registerService(Authentication\Token\DefaultTokenMapper::class, function(Server $c) { |
|
463 | 463 | $dbConnection = $c->getDatabaseConnection(); |
464 | 464 | return new Authentication\Token\DefaultTokenMapper($dbConnection); |
465 | 465 | }); |
466 | 466 | $this->registerAlias(IProvider::class, Authentication\Token\Manager::class); |
467 | 467 | |
468 | - $this->registerService(\OC\User\Session::class, function (Server $c) { |
|
468 | + $this->registerService(\OC\User\Session::class, function(Server $c) { |
|
469 | 469 | $manager = $c->getUserManager(); |
470 | 470 | $session = new \OC\Session\Memory(''); |
471 | 471 | $timeFactory = new TimeFactory(); |
@@ -490,14 +490,14 @@ discard block |
||
490 | 490 | $c->getLogger(), |
491 | 491 | $c->query(IEventDispatcher::class) |
492 | 492 | ); |
493 | - $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) { |
|
493 | + $userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) { |
|
494 | 494 | \OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password)); |
495 | 495 | |
496 | 496 | /** @var IEventDispatcher $dispatcher */ |
497 | 497 | $dispatcher = $this->query(IEventDispatcher::class); |
498 | 498 | $dispatcher->dispatchTyped(new BeforeUserCreatedEvent($uid, $password)); |
499 | 499 | }); |
500 | - $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) { |
|
500 | + $userSession->listen('\OC\User', 'postCreateUser', function($user, $password) { |
|
501 | 501 | /** @var $user \OC\User\User */ |
502 | 502 | \OC_Hook::emit('OC_User', 'post_createUser', array('uid' => $user->getUID(), 'password' => $password)); |
503 | 503 | |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | $dispatcher = $this->query(IEventDispatcher::class); |
506 | 506 | $dispatcher->dispatchTyped(new UserCreatedEvent($user, $password)); |
507 | 507 | }); |
508 | - $userSession->listen('\OC\User', 'preDelete', function ($user) use ($legacyDispatcher) { |
|
508 | + $userSession->listen('\OC\User', 'preDelete', function($user) use ($legacyDispatcher) { |
|
509 | 509 | /** @var $user \OC\User\User */ |
510 | 510 | \OC_Hook::emit('OC_User', 'pre_deleteUser', array('run' => true, 'uid' => $user->getUID())); |
511 | 511 | $legacyDispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user)); |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | $dispatcher = $this->query(IEventDispatcher::class); |
515 | 515 | $dispatcher->dispatchTyped(new BeforeUserDeletedEvent($user)); |
516 | 516 | }); |
517 | - $userSession->listen('\OC\User', 'postDelete', function ($user) { |
|
517 | + $userSession->listen('\OC\User', 'postDelete', function($user) { |
|
518 | 518 | /** @var $user \OC\User\User */ |
519 | 519 | \OC_Hook::emit('OC_User', 'post_deleteUser', array('uid' => $user->getUID())); |
520 | 520 | |
@@ -522,7 +522,7 @@ discard block |
||
522 | 522 | $dispatcher = $this->query(IEventDispatcher::class); |
523 | 523 | $dispatcher->dispatchTyped(new UserDeletedEvent($user)); |
524 | 524 | }); |
525 | - $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) { |
|
525 | + $userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) { |
|
526 | 526 | /** @var $user \OC\User\User */ |
527 | 527 | \OC_Hook::emit('OC_User', 'pre_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
528 | 528 | |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | $dispatcher = $this->query(IEventDispatcher::class); |
531 | 531 | $dispatcher->dispatchTyped(new BeforePasswordUpdatedEvent($user, $password, $recoveryPassword)); |
532 | 532 | }); |
533 | - $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) { |
|
533 | + $userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) { |
|
534 | 534 | /** @var $user \OC\User\User */ |
535 | 535 | \OC_Hook::emit('OC_User', 'post_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
536 | 536 | |
@@ -538,14 +538,14 @@ discard block |
||
538 | 538 | $dispatcher = $this->query(IEventDispatcher::class); |
539 | 539 | $dispatcher->dispatchTyped(new PasswordUpdatedEvent($user, $password, $recoveryPassword)); |
540 | 540 | }); |
541 | - $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) { |
|
541 | + $userSession->listen('\OC\User', 'preLogin', function($uid, $password) { |
|
542 | 542 | \OC_Hook::emit('OC_User', 'pre_login', array('run' => true, 'uid' => $uid, 'password' => $password)); |
543 | 543 | |
544 | 544 | /** @var IEventDispatcher $dispatcher */ |
545 | 545 | $dispatcher = $this->query(IEventDispatcher::class); |
546 | 546 | $dispatcher->dispatchTyped(new BeforeUserLoggedInEvent($uid, $password)); |
547 | 547 | }); |
548 | - $userSession->listen('\OC\User', 'postLogin', function ($user, $password, $isTokenLogin) { |
|
548 | + $userSession->listen('\OC\User', 'postLogin', function($user, $password, $isTokenLogin) { |
|
549 | 549 | /** @var $user \OC\User\User */ |
550 | 550 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'isTokenLogin' => $isTokenLogin)); |
551 | 551 | |
@@ -553,12 +553,12 @@ discard block |
||
553 | 553 | $dispatcher = $this->query(IEventDispatcher::class); |
554 | 554 | $dispatcher->dispatchTyped(new UserLoggedInEvent($user, $password, $isTokenLogin)); |
555 | 555 | }); |
556 | - $userSession->listen('\OC\User', 'preRememberedLogin', function ($uid) { |
|
556 | + $userSession->listen('\OC\User', 'preRememberedLogin', function($uid) { |
|
557 | 557 | /** @var IEventDispatcher $dispatcher */ |
558 | 558 | $dispatcher = $this->query(IEventDispatcher::class); |
559 | 559 | $dispatcher->dispatchTyped(new BeforeUserLoggedInWithCookieEvent($uid)); |
560 | 560 | }); |
561 | - $userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) { |
|
561 | + $userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) { |
|
562 | 562 | /** @var $user \OC\User\User */ |
563 | 563 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password)); |
564 | 564 | |
@@ -566,19 +566,19 @@ discard block |
||
566 | 566 | $dispatcher = $this->query(IEventDispatcher::class); |
567 | 567 | $dispatcher->dispatchTyped(new UserLoggedInWithCookieEvent($user, $password)); |
568 | 568 | }); |
569 | - $userSession->listen('\OC\User', 'logout', function ($user) { |
|
569 | + $userSession->listen('\OC\User', 'logout', function($user) { |
|
570 | 570 | \OC_Hook::emit('OC_User', 'logout', array()); |
571 | 571 | |
572 | 572 | /** @var IEventDispatcher $dispatcher */ |
573 | 573 | $dispatcher = $this->query(IEventDispatcher::class); |
574 | 574 | $dispatcher->dispatchTyped(new BeforeUserLoggedOutEvent($user)); |
575 | 575 | }); |
576 | - $userSession->listen('\OC\User', 'postLogout', function ($user) { |
|
576 | + $userSession->listen('\OC\User', 'postLogout', function($user) { |
|
577 | 577 | /** @var IEventDispatcher $dispatcher */ |
578 | 578 | $dispatcher = $this->query(IEventDispatcher::class); |
579 | 579 | $dispatcher->dispatchTyped(new UserLoggedOutEvent($user)); |
580 | 580 | }); |
581 | - $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) { |
|
581 | + $userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) { |
|
582 | 582 | /** @var $user \OC\User\User */ |
583 | 583 | \OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue)); |
584 | 584 | |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | $this->registerAlias(INavigationManager::class, \OC\NavigationManager::class); |
597 | 597 | $this->registerDeprecatedAlias('NavigationManager', INavigationManager::class); |
598 | 598 | |
599 | - $this->registerService(\OC\AllConfig::class, function (Server $c) { |
|
599 | + $this->registerService(\OC\AllConfig::class, function(Server $c) { |
|
600 | 600 | return new \OC\AllConfig( |
601 | 601 | $c->getSystemConfig() |
602 | 602 | ); |
@@ -604,18 +604,18 @@ discard block |
||
604 | 604 | $this->registerDeprecatedAlias('AllConfig', \OC\AllConfig::class); |
605 | 605 | $this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class); |
606 | 606 | |
607 | - $this->registerService(\OC\SystemConfig::class, function ($c) use ($config) { |
|
607 | + $this->registerService(\OC\SystemConfig::class, function($c) use ($config) { |
|
608 | 608 | return new \OC\SystemConfig($config); |
609 | 609 | }); |
610 | 610 | $this->registerDeprecatedAlias('SystemConfig', \OC\SystemConfig::class); |
611 | 611 | |
612 | - $this->registerService(\OC\AppConfig::class, function (Server $c) { |
|
612 | + $this->registerService(\OC\AppConfig::class, function(Server $c) { |
|
613 | 613 | return new \OC\AppConfig($c->getDatabaseConnection()); |
614 | 614 | }); |
615 | 615 | $this->registerDeprecatedAlias('AppConfig', \OC\AppConfig::class); |
616 | 616 | $this->registerAlias(IAppConfig::class, \OC\AppConfig::class); |
617 | 617 | |
618 | - $this->registerService(IFactory::class, function (Server $c) { |
|
618 | + $this->registerService(IFactory::class, function(Server $c) { |
|
619 | 619 | return new \OC\L10N\Factory( |
620 | 620 | $c->getConfig(), |
621 | 621 | $c->getRequest(), |
@@ -625,7 +625,7 @@ discard block |
||
625 | 625 | }); |
626 | 626 | $this->registerDeprecatedAlias('L10NFactory', IFactory::class); |
627 | 627 | |
628 | - $this->registerService(IURLGenerator::class, function (Server $c) { |
|
628 | + $this->registerService(IURLGenerator::class, function(Server $c) { |
|
629 | 629 | $config = $c->getConfig(); |
630 | 630 | $cacheFactory = $c->getMemCacheFactory(); |
631 | 631 | $request = $c->getRequest(); |
@@ -640,12 +640,12 @@ discard block |
||
640 | 640 | $this->registerDeprecatedAlias('AppFetcher', AppFetcher::class); |
641 | 641 | $this->registerDeprecatedAlias('CategoryFetcher', CategoryFetcher::class); |
642 | 642 | |
643 | - $this->registerService(ICache::class, function ($c) { |
|
643 | + $this->registerService(ICache::class, function($c) { |
|
644 | 644 | return new Cache\File(); |
645 | 645 | }); |
646 | 646 | $this->registerDeprecatedAlias('UserCache', ICache::class); |
647 | 647 | |
648 | - $this->registerService(Factory::class, function (Server $c) { |
|
648 | + $this->registerService(Factory::class, function(Server $c) { |
|
649 | 649 | |
650 | 650 | $arrayCacheFactory = new \OC\Memcache\Factory('', $c->getLogger(), |
651 | 651 | ArrayCache::class, |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | $version = implode(',', $v); |
661 | 661 | $instanceId = \OC_Util::getInstanceId(); |
662 | 662 | $path = \OC::$SERVERROOT; |
663 | - $prefix = md5($instanceId . '-' . $version . '-' . $path); |
|
663 | + $prefix = md5($instanceId.'-'.$version.'-'.$path); |
|
664 | 664 | return new \OC\Memcache\Factory($prefix, $c->getLogger(), |
665 | 665 | $config->getSystemValue('memcache.local', null), |
666 | 666 | $config->getSystemValue('memcache.distributed', null), |
@@ -673,12 +673,12 @@ discard block |
||
673 | 673 | $this->registerDeprecatedAlias('MemCacheFactory', Factory::class); |
674 | 674 | $this->registerAlias(ICacheFactory::class, Factory::class); |
675 | 675 | |
676 | - $this->registerService('RedisFactory', function (Server $c) { |
|
676 | + $this->registerService('RedisFactory', function(Server $c) { |
|
677 | 677 | $systemConfig = $c->getSystemConfig(); |
678 | 678 | return new RedisFactory($systemConfig); |
679 | 679 | }); |
680 | 680 | |
681 | - $this->registerService(\OCP\Activity\IManager::class, function (Server $c) { |
|
681 | + $this->registerService(\OCP\Activity\IManager::class, function(Server $c) { |
|
682 | 682 | return new \OC\Activity\Manager( |
683 | 683 | $c->getRequest(), |
684 | 684 | $c->getUserSession(), |
@@ -688,7 +688,7 @@ discard block |
||
688 | 688 | }); |
689 | 689 | $this->registerDeprecatedAlias('ActivityManager', \OCP\Activity\IManager::class); |
690 | 690 | |
691 | - $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) { |
|
691 | + $this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) { |
|
692 | 692 | return new \OC\Activity\EventMerger( |
693 | 693 | $c->getL10N('lib') |
694 | 694 | ); |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | $this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class); |
711 | 711 | $this->registerAlias(\OCP\Support\Subscription\IRegistry::class, \OC\Support\Subscription\Registry::class); |
712 | 712 | |
713 | - $this->registerService(\OC\Log::class, function (Server $c) { |
|
713 | + $this->registerService(\OC\Log::class, function(Server $c) { |
|
714 | 714 | $logType = $c->query(AllConfig::class)->getSystemValue('log_type', 'file'); |
715 | 715 | $factory = new LogFactory($c, $this->getSystemConfig()); |
716 | 716 | $logger = $factory->get($logType); |
@@ -721,11 +721,11 @@ discard block |
||
721 | 721 | $this->registerAlias(ILogger::class, \OC\Log::class); |
722 | 722 | $this->registerDeprecatedAlias('Logger', \OC\Log::class); |
723 | 723 | |
724 | - $this->registerService(ILogFactory::class, function (Server $c) { |
|
724 | + $this->registerService(ILogFactory::class, function(Server $c) { |
|
725 | 725 | return new LogFactory($c, $this->getSystemConfig()); |
726 | 726 | }); |
727 | 727 | |
728 | - $this->registerService(IJobList::class, function (Server $c) { |
|
728 | + $this->registerService(IJobList::class, function(Server $c) { |
|
729 | 729 | $config = $c->getConfig(); |
730 | 730 | return new \OC\BackgroundJob\JobList( |
731 | 731 | $c->getDatabaseConnection(), |
@@ -735,7 +735,7 @@ discard block |
||
735 | 735 | }); |
736 | 736 | $this->registerDeprecatedAlias('JobList', IJobList::class); |
737 | 737 | |
738 | - $this->registerService(IRouter::class, function (Server $c) { |
|
738 | + $this->registerService(IRouter::class, function(Server $c) { |
|
739 | 739 | $cacheFactory = $c->getMemCacheFactory(); |
740 | 740 | $logger = $c->getLogger(); |
741 | 741 | if ($cacheFactory->isLocalCacheAvailable()) { |
@@ -747,39 +747,39 @@ discard block |
||
747 | 747 | }); |
748 | 748 | $this->registerDeprecatedAlias('Router', IRouter::class); |
749 | 749 | |
750 | - $this->registerService(ISearch::class, function ($c) { |
|
750 | + $this->registerService(ISearch::class, function($c) { |
|
751 | 751 | return new Search(); |
752 | 752 | }); |
753 | 753 | $this->registerDeprecatedAlias('Search', ISearch::class); |
754 | 754 | |
755 | - $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) { |
|
755 | + $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) { |
|
756 | 756 | return new \OC\Security\RateLimiting\Backend\MemoryCache( |
757 | 757 | $this->getMemCacheFactory(), |
758 | 758 | new \OC\AppFramework\Utility\TimeFactory() |
759 | 759 | ); |
760 | 760 | }); |
761 | 761 | |
762 | - $this->registerService(\OCP\Security\ISecureRandom::class, function ($c) { |
|
762 | + $this->registerService(\OCP\Security\ISecureRandom::class, function($c) { |
|
763 | 763 | return new SecureRandom(); |
764 | 764 | }); |
765 | 765 | $this->registerDeprecatedAlias('SecureRandom', \OCP\Security\ISecureRandom::class); |
766 | 766 | |
767 | - $this->registerService(ICrypto::class, function (Server $c) { |
|
767 | + $this->registerService(ICrypto::class, function(Server $c) { |
|
768 | 768 | return new Crypto($c->getConfig(), $c->getSecureRandom()); |
769 | 769 | }); |
770 | 770 | $this->registerDeprecatedAlias('Crypto', ICrypto::class); |
771 | 771 | |
772 | - $this->registerService(IHasher::class, function (Server $c) { |
|
772 | + $this->registerService(IHasher::class, function(Server $c) { |
|
773 | 773 | return new Hasher($c->getConfig()); |
774 | 774 | }); |
775 | 775 | $this->registerDeprecatedAlias('Hasher', IHasher::class); |
776 | 776 | |
777 | - $this->registerService(ICredentialsManager::class, function (Server $c) { |
|
777 | + $this->registerService(ICredentialsManager::class, function(Server $c) { |
|
778 | 778 | return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection()); |
779 | 779 | }); |
780 | 780 | $this->registerDeprecatedAlias('CredentialsManager', ICredentialsManager::class); |
781 | 781 | |
782 | - $this->registerService(IDBConnection::class, function (Server $c) { |
|
782 | + $this->registerService(IDBConnection::class, function(Server $c) { |
|
783 | 783 | $systemConfig = $c->getSystemConfig(); |
784 | 784 | $factory = new \OC\DB\ConnectionFactory($systemConfig); |
785 | 785 | $type = $systemConfig->getValue('dbtype', 'sqlite'); |
@@ -794,7 +794,7 @@ discard block |
||
794 | 794 | $this->registerDeprecatedAlias('DatabaseConnection', IDBConnection::class); |
795 | 795 | |
796 | 796 | |
797 | - $this->registerService(IClientService::class, function (Server $c) { |
|
797 | + $this->registerService(IClientService::class, function(Server $c) { |
|
798 | 798 | $user = \OC_User::getUser(); |
799 | 799 | $uid = $user ? $user : null; |
800 | 800 | return new ClientService( |
@@ -809,7 +809,7 @@ discard block |
||
809 | 809 | ); |
810 | 810 | }); |
811 | 811 | $this->registerDeprecatedAlias('HttpClientService', IClientService::class); |
812 | - $this->registerService(IEventLogger::class, function (Server $c) { |
|
812 | + $this->registerService(IEventLogger::class, function(Server $c) { |
|
813 | 813 | $eventLogger = new EventLogger(); |
814 | 814 | if ($c->getSystemConfig()->getValue('debug', false)) { |
815 | 815 | // In debug mode, module is being activated by default |
@@ -819,7 +819,7 @@ discard block |
||
819 | 819 | }); |
820 | 820 | $this->registerDeprecatedAlias('EventLogger', IEventLogger::class); |
821 | 821 | |
822 | - $this->registerService(IQueryLogger::class, function (Server $c) { |
|
822 | + $this->registerService(IQueryLogger::class, function(Server $c) { |
|
823 | 823 | $queryLogger = new QueryLogger(); |
824 | 824 | if ($c->getSystemConfig()->getValue('debug', false)) { |
825 | 825 | // In debug mode, module is being activated by default |
@@ -829,7 +829,7 @@ discard block |
||
829 | 829 | }); |
830 | 830 | $this->registerDeprecatedAlias('QueryLogger', IQueryLogger::class); |
831 | 831 | |
832 | - $this->registerService(TempManager::class, function (Server $c) { |
|
832 | + $this->registerService(TempManager::class, function(Server $c) { |
|
833 | 833 | return new TempManager( |
834 | 834 | $c->getLogger(), |
835 | 835 | $c->getConfig() |
@@ -838,7 +838,7 @@ discard block |
||
838 | 838 | $this->registerDeprecatedAlias('TempManager', TempManager::class); |
839 | 839 | $this->registerAlias(ITempManager::class, TempManager::class); |
840 | 840 | |
841 | - $this->registerService(AppManager::class, function (Server $c) { |
|
841 | + $this->registerService(AppManager::class, function(Server $c) { |
|
842 | 842 | return new \OC\App\AppManager( |
843 | 843 | $c->getUserSession(), |
844 | 844 | $c->getConfig(), |
@@ -852,7 +852,7 @@ discard block |
||
852 | 852 | $this->registerDeprecatedAlias('AppManager', AppManager::class); |
853 | 853 | $this->registerAlias(IAppManager::class, AppManager::class); |
854 | 854 | |
855 | - $this->registerService(IDateTimeZone::class, function (Server $c) { |
|
855 | + $this->registerService(IDateTimeZone::class, function(Server $c) { |
|
856 | 856 | return new DateTimeZone( |
857 | 857 | $c->getConfig(), |
858 | 858 | $c->getSession() |
@@ -860,7 +860,7 @@ discard block |
||
860 | 860 | }); |
861 | 861 | $this->registerDeprecatedAlias('DateTimeZone', IDateTimeZone::class); |
862 | 862 | |
863 | - $this->registerService(IDateTimeFormatter::class, function (Server $c) { |
|
863 | + $this->registerService(IDateTimeFormatter::class, function(Server $c) { |
|
864 | 864 | $language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null); |
865 | 865 | |
866 | 866 | return new DateTimeFormatter( |
@@ -870,7 +870,7 @@ discard block |
||
870 | 870 | }); |
871 | 871 | $this->registerDeprecatedAlias('DateTimeFormatter', IDateTimeFormatter::class); |
872 | 872 | |
873 | - $this->registerService(IUserMountCache::class, function (Server $c) { |
|
873 | + $this->registerService(IUserMountCache::class, function(Server $c) { |
|
874 | 874 | $mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger()); |
875 | 875 | $listener = new UserMountCacheListener($mountCache); |
876 | 876 | $listener->listen($c->getUserManager()); |
@@ -878,7 +878,7 @@ discard block |
||
878 | 878 | }); |
879 | 879 | $this->registerDeprecatedAlias('UserMountCache', IUserMountCache::class); |
880 | 880 | |
881 | - $this->registerService(IMountProviderCollection::class, function (Server $c) { |
|
881 | + $this->registerService(IMountProviderCollection::class, function(Server $c) { |
|
882 | 882 | $loader = \OC\Files\Filesystem::getLoader(); |
883 | 883 | $mountCache = $c->query(IUserMountCache::class); |
884 | 884 | $manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
@@ -894,10 +894,10 @@ discard block |
||
894 | 894 | }); |
895 | 895 | $this->registerDeprecatedAlias('MountConfigManager', IMountProviderCollection::class); |
896 | 896 | |
897 | - $this->registerService('IniWrapper', function ($c) { |
|
897 | + $this->registerService('IniWrapper', function($c) { |
|
898 | 898 | return new IniGetWrapper(); |
899 | 899 | }); |
900 | - $this->registerService('AsyncCommandBus', function (Server $c) { |
|
900 | + $this->registerService('AsyncCommandBus', function(Server $c) { |
|
901 | 901 | $busClass = $c->getConfig()->getSystemValue('commandbus'); |
902 | 902 | if ($busClass) { |
903 | 903 | list($app, $class) = explode('::', $busClass, 2); |
@@ -912,10 +912,10 @@ discard block |
||
912 | 912 | return new CronBus($jobList); |
913 | 913 | } |
914 | 914 | }); |
915 | - $this->registerService('TrustedDomainHelper', function ($c) { |
|
915 | + $this->registerService('TrustedDomainHelper', function($c) { |
|
916 | 916 | return new TrustedDomainHelper($this->getConfig()); |
917 | 917 | }); |
918 | - $this->registerService(Throttler::class, function (Server $c) { |
|
918 | + $this->registerService(Throttler::class, function(Server $c) { |
|
919 | 919 | return new Throttler( |
920 | 920 | $c->getDatabaseConnection(), |
921 | 921 | new TimeFactory(), |
@@ -924,7 +924,7 @@ discard block |
||
924 | 924 | ); |
925 | 925 | }); |
926 | 926 | $this->registerDeprecatedAlias('Throttler', Throttler::class); |
927 | - $this->registerService('IntegrityCodeChecker', function (Server $c) { |
|
927 | + $this->registerService('IntegrityCodeChecker', function(Server $c) { |
|
928 | 928 | // IConfig and IAppManager requires a working database. This code |
929 | 929 | // might however be called when ownCloud is not yet setup. |
930 | 930 | if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
@@ -946,7 +946,7 @@ discard block |
||
946 | 946 | $c->getMimeTypeDetector() |
947 | 947 | ); |
948 | 948 | }); |
949 | - $this->registerService(\OCP\IRequest::class, function ($c) { |
|
949 | + $this->registerService(\OCP\IRequest::class, function($c) { |
|
950 | 950 | if (isset($this['urlParams'])) { |
951 | 951 | $urlParams = $this['urlParams']; |
952 | 952 | } else { |
@@ -982,7 +982,7 @@ discard block |
||
982 | 982 | }); |
983 | 983 | $this->registerDeprecatedAlias('Request', \OCP\IRequest::class); |
984 | 984 | |
985 | - $this->registerService(IMailer::class, function (Server $c) { |
|
985 | + $this->registerService(IMailer::class, function(Server $c) { |
|
986 | 986 | return new Mailer( |
987 | 987 | $c->getConfig(), |
988 | 988 | $c->getLogger(), |
@@ -993,7 +993,7 @@ discard block |
||
993 | 993 | }); |
994 | 994 | $this->registerDeprecatedAlias('Mailer', IMailer::class); |
995 | 995 | |
996 | - $this->registerService('LDAPProvider', function (Server $c) { |
|
996 | + $this->registerService('LDAPProvider', function(Server $c) { |
|
997 | 997 | $config = $c->getConfig(); |
998 | 998 | $factoryClass = $config->getSystemValue('ldapProviderFactory', null); |
999 | 999 | if (is_null($factoryClass)) { |
@@ -1003,7 +1003,7 @@ discard block |
||
1003 | 1003 | $factory = new $factoryClass($this); |
1004 | 1004 | return $factory->getLDAPProvider(); |
1005 | 1005 | }); |
1006 | - $this->registerService(ILockingProvider::class, function (Server $c) { |
|
1006 | + $this->registerService(ILockingProvider::class, function(Server $c) { |
|
1007 | 1007 | $ini = $c->getIniWrapper(); |
1008 | 1008 | $config = $c->getConfig(); |
1009 | 1009 | $ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time'))); |
@@ -1026,31 +1026,31 @@ discard block |
||
1026 | 1026 | }); |
1027 | 1027 | $this->registerDeprecatedAlias('LockingProvider', ILockingProvider::class); |
1028 | 1028 | |
1029 | - $this->registerService(IMountManager::class, function () { |
|
1029 | + $this->registerService(IMountManager::class, function() { |
|
1030 | 1030 | return new \OC\Files\Mount\Manager(); |
1031 | 1031 | }); |
1032 | 1032 | $this->registerDeprecatedAlias('MountManager', IMountManager::class); |
1033 | 1033 | |
1034 | - $this->registerService(IMimeTypeDetector::class, function (Server $c) { |
|
1034 | + $this->registerService(IMimeTypeDetector::class, function(Server $c) { |
|
1035 | 1035 | return new \OC\Files\Type\Detection( |
1036 | 1036 | $c->getURLGenerator(), |
1037 | 1037 | $c->getLogger(), |
1038 | 1038 | \OC::$configDir, |
1039 | - \OC::$SERVERROOT . '/resources/config/' |
|
1039 | + \OC::$SERVERROOT.'/resources/config/' |
|
1040 | 1040 | ); |
1041 | 1041 | }); |
1042 | 1042 | $this->registerDeprecatedAlias('MimeTypeDetector', IMimeTypeDetector::class); |
1043 | 1043 | |
1044 | - $this->registerService(IMimeTypeLoader::class, function (Server $c) { |
|
1044 | + $this->registerService(IMimeTypeLoader::class, function(Server $c) { |
|
1045 | 1045 | return new \OC\Files\Type\Loader( |
1046 | 1046 | $c->getDatabaseConnection() |
1047 | 1047 | ); |
1048 | 1048 | }); |
1049 | 1049 | $this->registerDeprecatedAlias('MimeTypeLoader', IMimeTypeLoader::class); |
1050 | - $this->registerService(BundleFetcher::class, function () { |
|
1050 | + $this->registerService(BundleFetcher::class, function() { |
|
1051 | 1051 | return new BundleFetcher($this->getL10N('lib')); |
1052 | 1052 | }); |
1053 | - $this->registerService(\OCP\Notification\IManager::class, function (Server $c) { |
|
1053 | + $this->registerService(\OCP\Notification\IManager::class, function(Server $c) { |
|
1054 | 1054 | return new Manager( |
1055 | 1055 | $c->query(IValidator::class), |
1056 | 1056 | $c->getLogger() |
@@ -1058,19 +1058,19 @@ discard block |
||
1058 | 1058 | }); |
1059 | 1059 | $this->registerDeprecatedAlias('NotificationManager', \OCP\Notification\IManager::class); |
1060 | 1060 | |
1061 | - $this->registerService(CapabilitiesManager::class, function (Server $c) { |
|
1061 | + $this->registerService(CapabilitiesManager::class, function(Server $c) { |
|
1062 | 1062 | $manager = new CapabilitiesManager($c->getLogger()); |
1063 | - $manager->registerCapability(function () use ($c) { |
|
1063 | + $manager->registerCapability(function() use ($c) { |
|
1064 | 1064 | return new \OC\OCS\CoreCapabilities($c->getConfig()); |
1065 | 1065 | }); |
1066 | - $manager->registerCapability(function () use ($c) { |
|
1066 | + $manager->registerCapability(function() use ($c) { |
|
1067 | 1067 | return $c->query(\OC\Security\Bruteforce\Capabilities::class); |
1068 | 1068 | }); |
1069 | 1069 | return $manager; |
1070 | 1070 | }); |
1071 | 1071 | $this->registerDeprecatedAlias('CapabilitiesManager', CapabilitiesManager::class); |
1072 | 1072 | |
1073 | - $this->registerService(ICommentsManager::class, function (Server $c) { |
|
1073 | + $this->registerService(ICommentsManager::class, function(Server $c) { |
|
1074 | 1074 | $config = $c->getConfig(); |
1075 | 1075 | $factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class); |
1076 | 1076 | /** @var \OCP\Comments\ICommentsManagerFactory $factory */ |
@@ -1080,7 +1080,7 @@ discard block |
||
1080 | 1080 | $manager->registerDisplayNameResolver('user', function($id) use ($c) { |
1081 | 1081 | $manager = $c->getUserManager(); |
1082 | 1082 | $user = $manager->get($id); |
1083 | - if(is_null($user)) { |
|
1083 | + if (is_null($user)) { |
|
1084 | 1084 | $l = $c->getL10N('core'); |
1085 | 1085 | $displayName = $l->t('Unknown user'); |
1086 | 1086 | } else { |
@@ -1093,7 +1093,7 @@ discard block |
||
1093 | 1093 | }); |
1094 | 1094 | $this->registerDeprecatedAlias('CommentsManager', ICommentsManager::class); |
1095 | 1095 | |
1096 | - $this->registerService('ThemingDefaults', function (Server $c) { |
|
1096 | + $this->registerService('ThemingDefaults', function(Server $c) { |
|
1097 | 1097 | /* |
1098 | 1098 | * Dark magic for autoloader. |
1099 | 1099 | * If we do a class_exists it will try to load the class which will |
@@ -1121,7 +1121,7 @@ discard block |
||
1121 | 1121 | } |
1122 | 1122 | return new \OC_Defaults(); |
1123 | 1123 | }); |
1124 | - $this->registerService(SCSSCacher::class, function (Server $c) { |
|
1124 | + $this->registerService(SCSSCacher::class, function(Server $c) { |
|
1125 | 1125 | return new SCSSCacher( |
1126 | 1126 | $c->getLogger(), |
1127 | 1127 | $c->query(\OC\Files\AppData\Factory::class), |
@@ -1134,7 +1134,7 @@ discard block |
||
1134 | 1134 | new TimeFactory() |
1135 | 1135 | ); |
1136 | 1136 | }); |
1137 | - $this->registerService(JSCombiner::class, function (Server $c) { |
|
1137 | + $this->registerService(JSCombiner::class, function(Server $c) { |
|
1138 | 1138 | return new JSCombiner( |
1139 | 1139 | $c->getAppDataDir('js'), |
1140 | 1140 | $c->getURLGenerator(), |
@@ -1147,7 +1147,7 @@ discard block |
||
1147 | 1147 | $this->registerDeprecatedAlias('EventDispatcher', \OC\EventDispatcher\SymfonyAdapter::class); |
1148 | 1148 | $this->registerAlias(EventDispatcherInterface::class, \OC\EventDispatcher\SymfonyAdapter::class); |
1149 | 1149 | |
1150 | - $this->registerService('CryptoWrapper', function (Server $c) { |
|
1150 | + $this->registerService('CryptoWrapper', function(Server $c) { |
|
1151 | 1151 | // FIXME: Instantiiated here due to cyclic dependency |
1152 | 1152 | $request = new Request( |
1153 | 1153 | [ |
@@ -1172,7 +1172,7 @@ discard block |
||
1172 | 1172 | $request |
1173 | 1173 | ); |
1174 | 1174 | }); |
1175 | - $this->registerService(CsrfTokenManager::class, function (Server $c) { |
|
1175 | + $this->registerService(CsrfTokenManager::class, function(Server $c) { |
|
1176 | 1176 | $tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom()); |
1177 | 1177 | |
1178 | 1178 | return new CsrfTokenManager( |
@@ -1181,20 +1181,20 @@ discard block |
||
1181 | 1181 | ); |
1182 | 1182 | }); |
1183 | 1183 | $this->registerDeprecatedAlias('CsrfTokenManager', CsrfTokenManager::class); |
1184 | - $this->registerService(SessionStorage::class, function (Server $c) { |
|
1184 | + $this->registerService(SessionStorage::class, function(Server $c) { |
|
1185 | 1185 | return new SessionStorage($c->getSession()); |
1186 | 1186 | }); |
1187 | 1187 | $this->registerAlias(\OCP\Security\IContentSecurityPolicyManager::class, ContentSecurityPolicyManager::class); |
1188 | 1188 | $this->registerDeprecatedAlias('ContentSecurityPolicyManager', ContentSecurityPolicyManager::class); |
1189 | 1189 | |
1190 | - $this->registerService('ContentSecurityPolicyNonceManager', function (Server $c) { |
|
1190 | + $this->registerService('ContentSecurityPolicyNonceManager', function(Server $c) { |
|
1191 | 1191 | return new ContentSecurityPolicyNonceManager( |
1192 | 1192 | $c->getCsrfTokenManager(), |
1193 | 1193 | $c->getRequest() |
1194 | 1194 | ); |
1195 | 1195 | }); |
1196 | 1196 | |
1197 | - $this->registerService(\OCP\Share\IManager::class, function (Server $c) { |
|
1197 | + $this->registerService(\OCP\Share\IManager::class, function(Server $c) { |
|
1198 | 1198 | $config = $c->getConfig(); |
1199 | 1199 | $factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class); |
1200 | 1200 | /** @var \OCP\Share\IProviderFactory $factory */ |
@@ -1243,7 +1243,7 @@ discard block |
||
1243 | 1243 | $this->registerAlias(\OCP\Collaboration\Resources\IProviderManager::class, \OC\Collaboration\Resources\ProviderManager::class); |
1244 | 1244 | $this->registerAlias(\OCP\Collaboration\Resources\IManager::class, \OC\Collaboration\Resources\Manager::class); |
1245 | 1245 | |
1246 | - $this->registerService('SettingsManager', function (Server $c) { |
|
1246 | + $this->registerService('SettingsManager', function(Server $c) { |
|
1247 | 1247 | $manager = new \OC\Settings\Manager( |
1248 | 1248 | $c->getLogger(), |
1249 | 1249 | $c->getL10NFactory(), |
@@ -1252,36 +1252,36 @@ discard block |
||
1252 | 1252 | ); |
1253 | 1253 | return $manager; |
1254 | 1254 | }); |
1255 | - $this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) { |
|
1255 | + $this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) { |
|
1256 | 1256 | return new \OC\Files\AppData\Factory( |
1257 | 1257 | $c->getRootFolder(), |
1258 | 1258 | $c->getSystemConfig() |
1259 | 1259 | ); |
1260 | 1260 | }); |
1261 | 1261 | |
1262 | - $this->registerService('LockdownManager', function (Server $c) { |
|
1263 | - return new LockdownManager(function () use ($c) { |
|
1262 | + $this->registerService('LockdownManager', function(Server $c) { |
|
1263 | + return new LockdownManager(function() use ($c) { |
|
1264 | 1264 | return $c->getSession(); |
1265 | 1265 | }); |
1266 | 1266 | }); |
1267 | 1267 | |
1268 | - $this->registerService(\OCP\OCS\IDiscoveryService::class, function (Server $c) { |
|
1268 | + $this->registerService(\OCP\OCS\IDiscoveryService::class, function(Server $c) { |
|
1269 | 1269 | return new DiscoveryService($c->getMemCacheFactory(), $c->getHTTPClientService()); |
1270 | 1270 | }); |
1271 | 1271 | |
1272 | - $this->registerService(ICloudIdManager::class, function (Server $c) { |
|
1272 | + $this->registerService(ICloudIdManager::class, function(Server $c) { |
|
1273 | 1273 | return new CloudIdManager(); |
1274 | 1274 | }); |
1275 | 1275 | |
1276 | - $this->registerService(IConfig::class, function (Server $c) { |
|
1276 | + $this->registerService(IConfig::class, function(Server $c) { |
|
1277 | 1277 | return new GlobalScale\Config($c->getConfig()); |
1278 | 1278 | }); |
1279 | 1279 | |
1280 | - $this->registerService(ICloudFederationProviderManager::class, function (Server $c) { |
|
1280 | + $this->registerService(ICloudFederationProviderManager::class, function(Server $c) { |
|
1281 | 1281 | return new CloudFederationProviderManager($c->getAppManager(), $c->getHTTPClientService(), $c->getCloudIdManager(), $c->getLogger()); |
1282 | 1282 | }); |
1283 | 1283 | |
1284 | - $this->registerService(ICloudFederationFactory::class, function (Server $c) { |
|
1284 | + $this->registerService(ICloudFederationFactory::class, function(Server $c) { |
|
1285 | 1285 | return new CloudFederationFactory(); |
1286 | 1286 | }); |
1287 | 1287 | |
@@ -1291,18 +1291,18 @@ discard block |
||
1291 | 1291 | $this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class); |
1292 | 1292 | $this->registerDeprecatedAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class); |
1293 | 1293 | |
1294 | - $this->registerService(Defaults::class, function (Server $c) { |
|
1294 | + $this->registerService(Defaults::class, function(Server $c) { |
|
1295 | 1295 | return new Defaults( |
1296 | 1296 | $c->getThemingDefaults() |
1297 | 1297 | ); |
1298 | 1298 | }); |
1299 | 1299 | $this->registerDeprecatedAlias('Defaults', \OCP\Defaults::class); |
1300 | 1300 | |
1301 | - $this->registerService(\OCP\ISession::class, function (SimpleContainer $c) { |
|
1301 | + $this->registerService(\OCP\ISession::class, function(SimpleContainer $c) { |
|
1302 | 1302 | return $c->query(\OCP\IUserSession::class)->getSession(); |
1303 | 1303 | }); |
1304 | 1304 | |
1305 | - $this->registerService(IShareHelper::class, function (Server $c) { |
|
1305 | + $this->registerService(IShareHelper::class, function(Server $c) { |
|
1306 | 1306 | return new ShareHelper( |
1307 | 1307 | $c->query(\OCP\Share\IManager::class) |
1308 | 1308 | ); |
@@ -1391,11 +1391,11 @@ discard block |
||
1391 | 1391 | // no avatar to remove |
1392 | 1392 | } catch (\Exception $e) { |
1393 | 1393 | // Ignore exceptions |
1394 | - $logger->info('Could not cleanup avatar of ' . $user->getUID()); |
|
1394 | + $logger->info('Could not cleanup avatar of '.$user->getUID()); |
|
1395 | 1395 | } |
1396 | 1396 | }); |
1397 | 1397 | |
1398 | - $dispatcher->addListener('OCP\IUser::changeUser', function (GenericEvent $e) { |
|
1398 | + $dispatcher->addListener('OCP\IUser::changeUser', function(GenericEvent $e) { |
|
1399 | 1399 | $manager = $this->getAvatarManager(); |
1400 | 1400 | /** @var IUser $user */ |
1401 | 1401 | $user = $e->getSubject(); |
@@ -1551,7 +1551,7 @@ discard block |
||
1551 | 1551 | * @deprecated since 9.2.0 use IAppData |
1552 | 1552 | */ |
1553 | 1553 | public function getAppFolder() { |
1554 | - $dir = '/' . \OC_App::getCurrentApp(); |
|
1554 | + $dir = '/'.\OC_App::getCurrentApp(); |
|
1555 | 1555 | $root = $this->getRootFolder(); |
1556 | 1556 | if (!$root->nodeExists($dir)) { |
1557 | 1557 | $folder = $root->newFolder($dir); |
@@ -2129,7 +2129,7 @@ discard block |
||
2129 | 2129 | /** |
2130 | 2130 | * @return \OCP\Collaboration\AutoComplete\IManager |
2131 | 2131 | */ |
2132 | - public function getAutoCompleteManager(){ |
|
2132 | + public function getAutoCompleteManager() { |
|
2133 | 2133 | return $this->query(IManager::class); |
2134 | 2134 | } |
2135 | 2135 | |
@@ -2225,11 +2225,11 @@ discard block |
||
2225 | 2225 | } |
2226 | 2226 | |
2227 | 2227 | private function registerDeprecatedAlias(string $alias, string $target) { |
2228 | - $this->registerService($alias, function (IContainer $container) use ($target, $alias) { |
|
2228 | + $this->registerService($alias, function(IContainer $container) use ($target, $alias) { |
|
2229 | 2229 | try { |
2230 | 2230 | /** @var ILogger $logger */ |
2231 | 2231 | $logger = $container->query(ILogger::class); |
2232 | - $logger->debug('The requested alias "' . $alias . '" is depreacted. Please request "' . $target . '" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']); |
|
2232 | + $logger->debug('The requested alias "'.$alias.'" is depreacted. Please request "'.$target.'" directly. This alias will be removed in a future Nextcloud version.', ['app' => 'serverDI']); |
|
2233 | 2233 | } catch (QueryException $e) { |
2234 | 2234 | // Could not get logger. Continue |
2235 | 2235 | } |