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/Search | |
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/Search')
-rw-r--r-- | apps/comments/lib/Search/CommentsSearchProvider.php | 15 | ||||
-rw-r--r-- | apps/comments/lib/Search/LegacyProvider.php | 3 |
2 files changed, 6 insertions, 12 deletions
diff --git a/apps/comments/lib/Search/CommentsSearchProvider.php b/apps/comments/lib/Search/CommentsSearchProvider.php index 796e87ad4bb..b36f82f8401 100644 --- a/apps/comments/lib/Search/CommentsSearchProvider.php +++ b/apps/comments/lib/Search/CommentsSearchProvider.php @@ -40,17 +40,10 @@ use function pathinfo; class CommentsSearchProvider implements IProvider { - /** @var IUserManager */ - private $userManager; - - /** @var IL10N */ - private $l10n; - - /** @var IURLGenerator */ - private $urlGenerator; - - /** @var LegacyProvider */ - private $legacyProvider; + private IUserManager $userManager; + private IL10N $l10n; + private IURLGenerator $urlGenerator; + private LegacyProvider $legacyProvider; public function __construct(IUserManager $userManager, IL10N $l10n, diff --git a/apps/comments/lib/Search/LegacyProvider.php b/apps/comments/lib/Search/LegacyProvider.php index cba48678e8b..d22caad7e3d 100644 --- a/apps/comments/lib/Search/LegacyProvider.php +++ b/apps/comments/lib/Search/LegacyProvider.php @@ -31,6 +31,7 @@ use OCP\Files\Node; use OCP\Files\NotFoundException; use OCP\IUser; use OCP\Search\Provider; +use OCP\Comments\ICommentsManager; use function count; class LegacyProvider extends Provider { @@ -43,7 +44,7 @@ class LegacyProvider extends Provider { * @since 7.0.0 */ public function search($query): array { - $cm = \OC::$server->getCommentsManager(); + $cm = \OC::$server->get(ICommentsManager::class); $us = \OC::$server->getUserSession(); $user = $us->getUser(); |