diff --git a/apps/user_ldap/lib/Group_LDAP.php b/apps/user_ldap/lib/Group_LDAP.php index db7ec2f28e62f..57f2c4dfbe4ce 100644 --- a/apps/user_ldap/lib/Group_LDAP.php +++ b/apps/user_ldap/lib/Group_LDAP.php @@ -1324,7 +1324,7 @@ public function removeFromGroup(string $uid, string $gid): bool { * Gets group details * * @param string $gid Name of the group - * @return array + * @return array{displayName?: string} * @throws Exception */ public function getGroupDetails(string $gid): array { diff --git a/apps/user_ldap/lib/Group_Proxy.php b/apps/user_ldap/lib/Group_Proxy.php index 6d327a0d815f7..09d21d5cbac8f 100644 --- a/apps/user_ldap/lib/Group_Proxy.php +++ b/apps/user_ldap/lib/Group_Proxy.php @@ -28,11 +28,19 @@ */ namespace OCA\User_LDAP; +use OCP\Group\Backend\ABackend; use OCP\Group\Backend\IDeleteGroupBackend; use OCP\Group\Backend\IGetDisplayNameBackend; use OCP\Group\Backend\INamedBackend; +use OCP\Group\Backend\IAddToGroupBackend; +use OCP\Group\Backend\ICountUsersBackend; +use OCP\Group\Backend\IGroupDetailsBackend; +use OCP\Group\Backend\IRemoveFromGroupBackend; +use OCP\GroupInterface; -class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP, IGetDisplayNameBackend, INamedBackend, IDeleteGroupBackend { +class Group_Proxy extends Proxy implements GroupInterface, IGroupLDAP, + IGetDisplayNameBackend, IDeleteGroupBackend, ICountUsersBackend, IAddToGroupBackend, + IRemoveFromGroupBackend, IGroupDetailsBackend { private $backends = []; private $refBackend = null; @@ -187,7 +195,7 @@ public function deleteGroup(string $gid): bool { * * Adds a user to a group. */ - public function addToGroup($uid, $gid) { + public function addToGroup(string $uid, string $gid): bool { return $this->handleRequest( $gid, 'addToGroup', [$uid, $gid]); } @@ -201,7 +209,7 @@ public function addToGroup($uid, $gid) { * * removes the user from a group. */ - public function removeFromGroup($uid, $gid) { + public function removeFromGroup(string $uid, string $gid): bool { return $this->handleRequest( $gid, 'removeFromGroup', [$uid, $gid]); } @@ -211,20 +219,16 @@ public function removeFromGroup($uid, $gid) { * * @param string $gid the internal group name * @param string $search optional, a search string - * @return int|bool */ - public function countUsersInGroup($gid, $search = '') { + public function countUsersInGroup(string $gid, string $search = ''): int { return $this->handleRequest( $gid, 'countUsersInGroup', [$gid, $search]); } /** - * get an array with group details - * - * @param string $gid - * @return array|false + * Get an array with group details */ - public function getGroupDetails($gid) { + public function getGroupDetails(string $gid): array { return $this->handleRequest( $gid, 'getGroupDetails', [$gid]); } @@ -276,7 +280,6 @@ public function implementsActions($actions) { /** * Return access for LDAP interaction. * - * @param string $gid * @return Access instance of Access for LDAP interaction */ public function getLDAPAccess($gid) { diff --git a/apps/user_ldap/lib/Proxy.php b/apps/user_ldap/lib/Proxy.php index d9546a163ab89..0a3760cebd60f 100644 --- a/apps/user_ldap/lib/Proxy.php +++ b/apps/user_ldap/lib/Proxy.php @@ -142,7 +142,7 @@ abstract protected function walkBackends($id, $method, $parameters); * @param string $id * @return Access */ - abstract public function getLDAPAccess($id); + abstract public function getLDAPAccess($gid); abstract protected function activeBackends(): int; diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml index 9448e1d1e6cbf..b95288f943432 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -1885,6 +1885,14 @@ $lastUpdateCheckTimestamp + + + 'OCA\\User_LDAP\\User\\User::postLDAPBackendAdded' + + + dispatch + + $ln + 1 @@ -1904,14 +1912,6 @@ string[] - - - 'OCA\\User_LDAP\\User\\User::postLDAPBackendAdded' - - - dispatch - - @@ -1931,11 +1931,6 @@ is_array($list) - - - $gid - - $i @@ -3671,7 +3666,7 @@ IGroup::class . '::preDelete' IGroup::class . '::preRemoveUser' - + dispatch dispatch diff --git a/lib/private/Group/Database.php b/lib/private/Group/Database.php index 71cabfb31d48c..903d1d154a1dc 100644 --- a/lib/private/Group/Database.php +++ b/lib/private/Group/Database.php @@ -45,7 +45,6 @@ use OCP\Group\Backend\ISetDisplayNameBackend; use OCP\Group\Backend\INamedBackend; use OCP\IDBConnection; -use OCP\IUser; use OCP\IUserManager; /**