diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2017-07-19 15:44:38 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2017-08-01 08:20:15 +0200 |
commit | b4d4db0e39d3e09fe0cf53241c72d5d6fc180101 (patch) | |
tree | 06af623e4b56b524fedea3723d89caece9dfa4ad /lib/private/Group | |
parent | 084bac353023e1c450f91f71ff1e4ac389e2497e (diff) | |
download | nextcloud-server-b4d4db0e39d3e09fe0cf53241c72d5d6fc180101.tar.gz nextcloud-server-b4d4db0e39d3e09fe0cf53241c72d5d6fc180101.zip |
Take IUser instead of User
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'lib/private/Group')
-rw-r--r-- | lib/private/Group/Group.php | 9 | ||||
-rw-r--r-- | lib/private/Group/Manager.php | 8 |
2 files changed, 9 insertions, 8 deletions
diff --git a/lib/private/Group/Group.php b/lib/private/Group/Group.php index 69dce215694..32ab79adab3 100644 --- a/lib/private/Group/Group.php +++ b/lib/private/Group/Group.php @@ -29,6 +29,7 @@ namespace OC\Group; use OCP\IGroup; +use OCP\IUser; class Group implements IGroup { /** @var null|string */ @@ -119,10 +120,10 @@ class Group implements IGroup { /** * check if a user is in the group * - * @param \OC\User\User $user + * @param IUser $user * @return bool */ - public function inGroup($user) { + public function inGroup(IUser $user) { if (isset($this->users[$user->getUID()])) { return true; } @@ -138,9 +139,9 @@ class Group implements IGroup { /** * add a user to the group * - * @param \OC\User\User $user + * @param IUser $user */ - public function addUser($user) { + public function addUser(IUser $user) { if ($this->inGroup($user)) { return; } diff --git a/lib/private/Group/Manager.php b/lib/private/Group/Manager.php index 61b47fdd448..6d4f5a091c6 100644 --- a/lib/private/Group/Manager.php +++ b/lib/private/Group/Manager.php @@ -246,10 +246,10 @@ class Manager extends PublicEmitter implements IGroupManager { } /** - * @param \OC\User\User|null $user + * @param IUser|null $user * @return \OC\Group\Group[] */ - public function getUserGroups($user) { + public function getUserGroups(IUser $user= null) { if (!$user instanceof IUser) { return []; } @@ -303,10 +303,10 @@ class Manager extends PublicEmitter implements IGroupManager { /** * get a list of group ids for a user - * @param \OC\User\User $user + * @param IUser $user * @return array with group ids */ - public function getUserGroupIds($user) { + public function getUserGroupIds(IUser $user) { return array_map(function($value) { return (string) $value; }, array_keys($this->getUserGroups($user))); |