diff options
author | Thomas Citharel <tcit@tcit.fr> | 2022-03-22 12:39:23 +0100 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2022-05-12 18:31:59 +0200 |
commit | 232322fe062031d5fe5b5297ca60b22bc1da1d30 (patch) | |
tree | a2591d9ed9caf669cbc7c16142a84b00f435df8f /core/Controller | |
parent | 32139610c5e11ee84c71cc1db3e58523f749aa27 (diff) | |
download | nextcloud-server-232322fe062031d5fe5b5297ca60b22bc1da1d30.tar.gz nextcloud-server-232322fe062031d5fe5b5297ca60b22bc1da1d30.zip |
Modernize contacts menu
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Diffstat (limited to 'core/Controller')
-rw-r--r-- | core/Controller/ContactsMenuController.php | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/core/Controller/ContactsMenuController.php b/core/Controller/ContactsMenuController.php index 6c967e7e019..87ed02362aa 100644 --- a/core/Controller/ContactsMenuController.php +++ b/core/Controller/ContactsMenuController.php @@ -24,6 +24,7 @@ */ namespace OC\Core\Controller; +use Exception; use OC\Contacts\ContactsMenu\Manager; use OCP\AppFramework\Controller; use OCP\AppFramework\Http; @@ -32,18 +33,9 @@ use OCP\IRequest; use OCP\IUserSession; class ContactsMenuController extends Controller { + private Manager $manager; + private IUserSession $userSession; - /** @var Manager */ - private $manager; - - /** @var IUserSession */ - private $userSession; - - /** - * @param IRequest $request - * @param IUserSession $userSession - * @param Manager $manager - */ public function __construct(IRequest $request, IUserSession $userSession, Manager $manager) { parent::__construct('core', $request); $this->userSession = $userSession; @@ -53,21 +45,20 @@ class ContactsMenuController extends Controller { /** * @NoAdminRequired * - * @param string|null filter * @return \JsonSerializable[] + * @throws Exception */ - public function index($filter = null) { + public function index(?string $filter = null): array { return $this->manager->getEntries($this->userSession->getUser(), $filter); } /** * @NoAdminRequired * - * @param integer $shareType - * @param string $shareWith * @return JSONResponse|\JsonSerializable + * @throws Exception */ - public function findOne($shareType, $shareWith) { + public function findOne(int $shareType, string $shareWith) { $contact = $this->manager->findOne($this->userSession->getUser(), $shareType, $shareWith); if ($contact) { |