aboutsummaryrefslogtreecommitdiffstats
path: root/apps/accessibility
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-07-05 22:03:12 +0200
committerGitHub <noreply@github.com>2020-07-05 22:03:12 +0200
commitd3d11cb826654d9c597443edb1d22d63521a2698 (patch)
tree457a0a7c9add6c677b2627f8505b203e76e5dc8f /apps/accessibility
parent52af709ceaf77b1f8b6b8f7b81dbbc115784f792 (diff)
parent9993a3b839a4354a2ccf67d4aac53922c2de9b54 (diff)
downloadnextcloud-server-d3d11cb826654d9c597443edb1d22d63521a2698.tar.gz
nextcloud-server-d3d11cb826654d9c597443edb1d22d63521a2698.zip
Merge pull request #21626 from nextcloud/enhancement/injectible-callables
Callable parameter injection
Diffstat (limited to 'apps/accessibility')
-rw-r--r--apps/accessibility/lib/AppInfo/Application.php17
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);