diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2022-05-13 20:14:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-13 20:14:31 +0200 |
commit | 85758a4f7011cf6ec3c24d4f500129504b910767 (patch) | |
tree | cd7bd5e6c943110affeaddbf5f96655f4479fb19 /core | |
parent | 20a648ed95bb6e7e795d2c87caffaa37554b0d8f (diff) | |
parent | 232322fe062031d5fe5b5297ca60b22bc1da1d30 (diff) | |
download | nextcloud-server-85758a4f7011cf6ec3c24d4f500129504b910767.tar.gz nextcloud-server-85758a4f7011cf6ec3c24d4f500129504b910767.zip |
Merge pull request #31662 from nextcloud/modernize-contactmenu
Diffstat (limited to 'core')
-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) { |