Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2022-03-22 14:39:23 +0300
committerThomas Citharel <tcit@tcit.fr>2022-05-12 19:31:59 +0300
commit232322fe062031d5fe5b5297ca60b22bc1da1d30 (patch)
treea2591d9ed9caf669cbc7c16142a84b00f435df8f /core
parent32139610c5e11ee84c71cc1db3e58523f749aa27 (diff)
Modernize contacts menumodernize-contactmenu
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Diffstat (limited to 'core')
-rw-r--r--core/Controller/ContactsMenuController.php23
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) {