diff options
author | Morris Jobke <hey@morrisjobke.de> | 2020-07-21 14:36:40 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2020-07-21 20:44:05 +0200 |
commit | 7870ca06637453f4e72dbd67edbfb3603d813196 (patch) | |
tree | 9f61927799c9baf39e336fa4299d4ac0fe4e34a1 /apps/settings/lib/AppInfo/Application.php | |
parent | 91e7f12088cb87ffef5660429ece404364167978 (diff) | |
download | nextcloud-server-7870ca06637453f4e72dbd67edbfb3603d813196.tar.gz nextcloud-server-7870ca06637453f4e72dbd67edbfb3603d813196.zip |
Use the proper IAppContainer and IServerContainer type hints to know which code runs with which container
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/settings/lib/AppInfo/Application.php')
-rw-r--r-- | apps/settings/lib/AppInfo/Application.php | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/apps/settings/lib/AppInfo/Application.php b/apps/settings/lib/AppInfo/Application.php index 3ea4d6bc080..6e6eb26d011 100644 --- a/apps/settings/lib/AppInfo/Application.php +++ b/apps/settings/lib/AppInfo/Application.php @@ -51,6 +51,7 @@ use OCP\AppFramework\App; use OCP\AppFramework\Bootstrap\IBootContext; use OCP\AppFramework\Bootstrap\IBootstrap; use OCP\AppFramework\Bootstrap\IRegistrationContext; +use OCP\AppFramework\IAppContainer; use OCP\Defaults; use OCP\IGroup; use OCP\IGroupManager; @@ -59,7 +60,6 @@ use OCP\IServerContainer; use OCP\IUser; use OCP\Settings\IManager; use OCP\Util; -use Psr\Container\ContainerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\GenericEvent; @@ -94,30 +94,30 @@ class Application extends App implements IBootstrap { } return $isSubAdmin; }); - $context->registerService('userCertificateManager', function (ContainerInterface $c) { + $context->registerService('userCertificateManager', function (IAppContainer $appContainer) { /** @var IServerContainer $serverContainer */ - $serverContainer = $c->get(IServerContainer::class); + $serverContainer = $appContainer->get(IServerContainer::class); return $serverContainer->getCertificateManager(); }, false); - $context->registerService('systemCertificateManager', function (ContainerInterface $c) { + $context->registerService('systemCertificateManager', function (IAppContainer $appContainer) { /** @var IServerContainer $serverContainer */ - $serverContainer = $c->query('ServerContainer'); + $serverContainer = $appContainer->query('ServerContainer'); return $serverContainer->getCertificateManager(null); }, false); - $context->registerService(IProvider::class, function (ContainerInterface $c) { + $context->registerService(IProvider::class, function (IAppContainer $appContainer) { /** @var IServerContainer $serverContainer */ - $serverContainer = $c->query(IServerContainer::class); + $serverContainer = $appContainer->query(IServerContainer::class); return $serverContainer->query(IProvider::class); }); - $context->registerService(IManager::class, function (ContainerInterface $c) { + $context->registerService(IManager::class, function (IAppContainer $appContainer) { /** @var IServerContainer $serverContainer */ - $serverContainer = $c->query(IServerContainer::class); + $serverContainer = $appContainer->query(IServerContainer::class); return $serverContainer->getSettingsManager(); }); - $context->registerService(NewUserMailHelper::class, function (ContainerInterface $c) { + $context->registerService(NewUserMailHelper::class, function (IAppContainer $appContainer) { /** @var Server $server */ - $server = $c->query(IServerContainer::class); + $server = $appContainer->query(IServerContainer::class); /** @var Defaults $defaults */ $defaults = $server->query(Defaults::class); @@ -136,13 +136,13 @@ class Application extends App implements IBootstrap { } public function boot(IBootContext $context): void { - $context->injectFn(function (EventDispatcherInterface $dispatcher, ContainerInterface $container) { - $dispatcher->addListener('app_password_created', function (GenericEvent $event) use ($container) { + $context->injectFn(function (EventDispatcherInterface $dispatcher, IAppContainer $appContainer) { + $dispatcher->addListener('app_password_created', function (GenericEvent $event) use ($appContainer) { if (($token = $event->getSubject()) instanceof IToken) { /** @var IActivityManager $activityManager */ - $activityManager = $container->get(IActivityManager::class); + $activityManager = $appContainer->get(IActivityManager::class); /** @var ILogger $logger */ - $logger = $container->get(ILogger::class); + $logger = $appContainer->get(ILogger::class); $activity = $activityManager->generateEvent(); $activity->setApp('settings') |