injectFn(Closure::fromCallable([$this, 'registerEventListeners'])); } /** * @todo move the OCP events and then move the registration to `register` */ private function registerEventListeners(IEventDispatcher $dispatcher, ContainerInterface $appContainer): void { $dispatcher->addListener(UserUpdatedEvent::class, function (UserUpdatedEvent $event) use ($appContainer) { /** @var UpdateLookupServer $updateLookupServer */ $updateLookupServer = $appContainer->get(UpdateLookupServer::class); $updateLookupServer->userUpdated($event->getUser()); }); } }