diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-06-29 17:07:21 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-07-03 15:37:53 +0300 |
commit | 58b8b00798fcee45f355ec043483be50a352a6eb (patch) | |
tree | d6a28b1aefe4918bbf2fe806dc7da7a3caf07678 /apps/accessibility | |
parent | 8150bcb60c8f4486d284ff1b37c543b50a6833ef (diff) |
Use \OCP\IContainer::injectFn to boot the Accessibility app
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/accessibility')
-rw-r--r-- | apps/accessibility/lib/AppInfo/Application.php | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/apps/accessibility/lib/AppInfo/Application.php b/apps/accessibility/lib/AppInfo/Application.php index 6d583af07f4..9f596e460e0 100644 --- a/apps/accessibility/lib/AppInfo/Application.php +++ b/apps/accessibility/lib/AppInfo/Application.php @@ -56,16 +56,11 @@ class Application extends App implements IBootstrap { } public function boot(IBootContext $context): void { - $this->injectCss( - $context->getAppContainer()->query(IUserSession::class), - $context->getAppContainer()->query(IConfig::class), - $context->getAppContainer()->query(IURLGenerator::class) - ); - - $this->registerInitialState($context->getAppContainer()); + $context->injectFn([$this, 'injectCss']); + $context->injectFn([$this, 'registerInitialState']); } - private function injectCss(IUserSession $userSession, + public function injectCss(IUserSession $userSession, IConfig $config, IURLGenerator $urlGenerator) { // Inject the fake css on all pages if enabled and user is logged @@ -87,10 +82,8 @@ class Application extends App implements IBootstrap { } } - private function registerInitialState(IAppContainer $container) { - /** @var IInitialStateService $initialState */ - $initialState = $container->query(IInitialStateService::class); - + public function registerInitialState(IInitialStateService $initialState, + IAppContainer $container) { $initialState->provideLazyInitialState(self::APP_ID, 'data', function () use ($container) { /** @var JSDataService $data */ $data = $container->query(JSDataService::class); |