Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions apps/user_ldap/lib/Group_LDAP.php
Original file line number Diff line number Diff line change
Expand Up @@ -1072,18 +1072,13 @@
}

/**
* get a list of all groups using a paged search
* Get groups via LDAP search.
*
* @param string $search
* @param int $limit
* @param int $offset
* @return array with group names
* Uses a paged search when available to override server-side search limits.
* Active Directory has a default limit of 1000 results.
*
* Returns a list with all groups
* Uses a paged search if available to override a
* server side search limit.
* (active directory has a limit of 1000 by default)
* @throws Exception
* @throws ServerNotAvailableException
*/
#[\Override]
public function getGroups($search = '', $limit = -1, $offset = 0) {
Expand Down Expand Up @@ -1115,7 +1110,7 @@
$ldap_groups = $this->access->nextcloudGroupNames($ldap_groups);

$this->access->connection->writeToCache($cacheKey, $ldap_groups);
return $ldap_groups;

Check failure on line 1113 in apps/user_ldap/lib/Group_LDAP.php

View workflow job for this annotation

GitHub Actions / static-code-analysis

LessSpecificReturnStatement

apps/user_ldap/lib/Group_LDAP.php:1113:10: LessSpecificReturnStatement: The type 'array<int, string>' is more general than the declared return type 'list<string>' for OCA\User_LDAP\Group_LDAP::getGroups (see https://psalm.dev/129)
}

/**
Expand Down
8 changes: 1 addition & 7 deletions lib/private/Group/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,7 @@ public function getUserGroups($uid) {
}

/**
* get a list of all groups
* @param string $search
* @param int $limit
* @param int $offset
* @return array an array of group names
*
* Returns a list with all groups
* Search for groups by gid or display name.
*/
#[\Override]
public function getGroups(string $search = '', int $limit = -1, int $offset = 0) {
Expand Down
14 changes: 7 additions & 7 deletions lib/public/GroupInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ public function inGroup($uid, $gid);
public function getUserGroups($uid);

/**
* @brief Get a list of all groups
* Get a list of groups matching the search criteria.
*
* @param string $search
* @param int $limit
* @param int $offset
* @return array an array of group names
* @since 4.5.0
* An empty search returns all groups.
*
* Returns a list with all groups
* @param string $search Search term used to filter group names
* @param int $limit Maximum number of results to return, or -1 for no limit
* @param int $offset Offset for paginated results
* @return list<string> An array of group names
* @since 4.5.0
*/
public function getGroups(string $search = '', int $limit = -1, int $offset = 0);

Expand Down
Loading