diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-03-15 17:17:36 +0100 |
---|---|---|
committer | Carl Schwan <carl@carlschwan.eu> | 2022-03-16 13:14:15 +0100 |
commit | fa266165d6d38f963dd44e227ee076799697f482 (patch) | |
tree | 482f7ad48d68e4fc233cb9857eee41ad35df8f8d /apps/comments/lib/AppInfo | |
parent | 3e067edcbe80797a70118f613ac4b752ce512992 (diff) | |
download | nextcloud-server-fa266165d6d38f963dd44e227ee076799697f482.tar.gz nextcloud-server-fa266165d6d38f963dd44e227ee076799697f482.zip |
Modernize comments app
* Use php 7.4 typed properties
* More typed methods (and replace existing php doc in some cases)
* query -> get for Container
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'apps/comments/lib/AppInfo')
-rw-r--r-- | apps/comments/lib/AppInfo/Application.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/comments/lib/AppInfo/Application.php b/apps/comments/lib/AppInfo/Application.php index 090d62df639..527c5d99fc3 100644 --- a/apps/comments/lib/AppInfo/Application.php +++ b/apps/comments/lib/AppInfo/Application.php @@ -46,6 +46,7 @@ use OCP\AppFramework\Bootstrap\IRegistrationContext; use OCP\Comments\CommentsEntityEvent; use OCP\ISearch; use OCP\IServerContainer; +use OCP\Comments\ICommentsManager; class Application extends App implements IBootstrap { public const APP_ID = 'comments'; @@ -84,9 +85,9 @@ class Application extends App implements IBootstrap { $context->getServerContainer()->get(ISearch::class)->registerProvider(LegacyProvider::class, ['apps' => ['files']]); } - protected function registerCommentsEventHandler(IServerContainer $container) { - $container->getCommentsManager()->registerEventHandler(function () { - return $this->getContainer()->query(EventHandler::class); + protected function registerCommentsEventHandler(IServerContainer $container): void { + $container->get(ICommentsManager::class)->registerEventHandler(function (): EventHandler { + return $this->getContainer()->get(EventHandler::class); }); } } |