aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/IGroup.php
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2023-05-23 19:00:38 +0200
committerChristoph Wurst <ChristophWurst@users.noreply.github.com>2023-09-06 11:58:09 +0200
commit312dd8ac6dce96353ac1f6e6c89e0e7d7840d03c (patch)
tree82f326e1015ca1d0e12ebe89aa5fb94a62968f4b /lib/public/IGroup.php
parent00c0813ce6209e8910b60b48172743fc13bb1a15 (diff)
downloadnextcloud-server-312dd8ac6dce96353ac1f6e6c89e0e7d7840d03c.tar.gz
nextcloud-server-312dd8ac6dce96353ac1f6e6c89e0e7d7840d03c.zip
feat(ocp): Add types and strict typing to \OCP\Group\IGroup
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/public/IGroup.php')
-rw-r--r--lib/public/IGroup.php60
1 files changed, 34 insertions, 26 deletions
diff --git a/lib/public/IGroup.php b/lib/public/IGroup.php
index ec26cc55b69..51417641e26 100644
--- a/lib/public/IGroup.php
+++ b/lib/public/IGroup.php
@@ -1,4 +1,7 @@
<?php
+
+declare(strict_types=1);
+
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
@@ -38,7 +41,7 @@ interface IGroup {
* @return string
* @since 8.0.0
*/
- public function getGID();
+ public function getGID(): string;
/**
* Returns the group display name
@@ -46,7 +49,7 @@ interface IGroup {
* @return string
* @since 12.0.0
*/
- public function getDisplayName();
+ public function getDisplayName(): string;
/**
* Set the group display name
@@ -60,43 +63,47 @@ interface IGroup {
/**
* get all users in the group
*
- * @return \OCP\IUser[]
+ * @return IUser[]
* @since 8.0.0
*/
- public function getUsers();
+ public function getUsers(): array;
/**
* check if a user is in the group
*
- * @param \OCP\IUser $user
+ * @param IUser $user
+ *
* @return bool
* @since 8.0.0
*/
- public function inGroup(IUser $user);
+ public function inGroup(IUser $user): bool;
/**
* add a user to the group
*
- * @param \OCP\IUser $user
+ * @param IUser $user
+ *
* @since 8.0.0
*/
- public function addUser(IUser $user);
+ public function addUser(IUser $user): void;
/**
- * remove a user from the group
+ * Remove a user from the group
+ *
+ * @param IUser $user
*
- * @param \OCP\IUser $user
* @since 8.0.0
*/
- public function removeUser($user);
+ public function removeUser(IUser $user): void;
/**
* search for users in the group by userid
*
* @param string $search
- * @param int $limit
- * @param int $offset
- * @return \OCP\IUser[]
+ * @param int|null $limit
+ * @param int|null $offset
+ *
+ * @return IUser[]
* @since 8.0.0
*/
public function searchUsers(string $search, ?int $limit = null, ?int $offset = null): array;
@@ -108,7 +115,7 @@ interface IGroup {
* @return int|bool
* @since 8.0.0
*/
- public function count($search = '');
+ public function count(string $search = ''): int|bool;
/**
* returns the number of disabled users
@@ -116,18 +123,19 @@ interface IGroup {
* @return int|bool
* @since 14.0.0
*/
- public function countDisabled();
+ public function countDisabled(): int|bool;
/**
- * search for users in the group by displayname
+ * Search for users in the group by displayname
*
* @param string $search
- * @param int $limit
- * @param int $offset
- * @return \OCP\IUser[]
+ * @param int|null $limit
+ * @param int|null $offset
+ *
+ * @return IUser[]
* @since 8.0.0
*/
- public function searchDisplayName($search, $limit = null, $offset = null);
+ public function searchDisplayName(string $search, int $limit = null, int $offset = null): array;
/**
* Get the names of the backends the group is connected to
@@ -135,27 +143,27 @@ interface IGroup {
* @return string[]
* @since 22.0.0
*/
- public function getBackendNames();
+ public function getBackendNames(): array;
/**
- * delete the group
+ * Delete the group
*
* @return bool
* @since 8.0.0
*/
- public function delete();
+ public function delete(): bool;
/**
* @return bool
* @since 14.0.0
*/
- public function canRemoveUser();
+ public function canRemoveUser(): bool;
/**
* @return bool
* @since 14.0.0
*/
- public function canAddUser();
+ public function canAddUser(): bool;
/**
* @return bool