diff options
Diffstat (limited to 'apps/provisioning_api/lib/Controller/GroupsController.php')
-rw-r--r-- | apps/provisioning_api/lib/Controller/GroupsController.php | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/apps/provisioning_api/lib/Controller/GroupsController.php b/apps/provisioning_api/lib/Controller/GroupsController.php index 0b16c319f1d..87544cc8992 100644 --- a/apps/provisioning_api/lib/Controller/GroupsController.php +++ b/apps/provisioning_api/lib/Controller/GroupsController.php @@ -68,17 +68,17 @@ class GroupsController extends AUserData { * @param string $search Text to search for * @param ?int $limit Limit the amount of groups returned * @param int $offset Offset for searching for groups - * @return DataResponse<Http::STATUS_OK, array{groups: string[]}, array{}> + * @return DataResponse<Http::STATUS_OK, array{groups: list<string>}, array{}> * * 200: Groups returned */ #[NoAdminRequired] public function getGroups(string $search = '', ?int $limit = null, int $offset = 0): DataResponse { $groups = $this->groupManager->search($search, $limit, $offset); - $groups = array_map(function ($group) { + $groups = array_values(array_map(function ($group) { /** @var IGroup $group */ return $group->getGID(); - }, $groups); + }, $groups)); return new DataResponse(['groups' => $groups]); } @@ -89,7 +89,7 @@ class GroupsController extends AUserData { * @param string $search Text to search for * @param ?int $limit Limit the amount of groups returned * @param int $offset Offset for searching for groups - * @return DataResponse<Http::STATUS_OK, array{groups: Provisioning_APIGroupDetails[]}, array{}> + * @return DataResponse<Http::STATUS_OK, array{groups: list<Provisioning_APIGroupDetails>}, array{}> * * 200: Groups details returned */ @@ -97,7 +97,7 @@ class GroupsController extends AUserData { #[AuthorizedAdminSetting(settings: Sharing::class)] public function getGroupsDetails(string $search = '', ?int $limit = null, int $offset = 0): DataResponse { $groups = $this->groupManager->search($search, $limit, $offset); - $groups = array_map(function ($group) { + $groups = array_values(array_map(function ($group) { /** @var IGroup $group */ return [ 'id' => $group->getGID(), @@ -107,7 +107,7 @@ class GroupsController extends AUserData { 'canAdd' => $group->canAddUser(), 'canRemove' => $group->canRemoveUser(), ]; - }, $groups); + }, $groups)); return new DataResponse(['groups' => $groups]); } @@ -116,7 +116,7 @@ class GroupsController extends AUserData { * Get a list of users in the specified group * * @param string $groupId ID of the group - * @return DataResponse<Http::STATUS_OK, array{users: string[]}, array{}> + * @return DataResponse<Http::STATUS_OK, array{users: list<string>}, array{}> * @throws OCSException * * @deprecated 14 Use getGroupUsers @@ -132,7 +132,7 @@ class GroupsController extends AUserData { * Get a list of users in the specified group * * @param string $groupId ID of the group - * @return DataResponse<Http::STATUS_OK, array{users: string[]}, array{}> + * @return DataResponse<Http::STATUS_OK, array{users: list<string>}, array{}> * @throws OCSException * @throws OCSNotFoundException Group not found * @throws OCSForbiddenException Missing permissions to get users in the group @@ -163,7 +163,7 @@ class GroupsController extends AUserData { /** @var IUser $user */ return $user->getUID(); }, $users); - /** @var string[] $users */ + /** @var list<string> $users */ $users = array_values($users); return new DataResponse(['users' => $users]); } @@ -233,7 +233,7 @@ class GroupsController extends AUserData { * * @param string $groupid ID of the group * @param string $displayname Display name of the group - * @return DataResponse<Http::STATUS_OK, array<empty>, array{}> + * @return DataResponse<Http::STATUS_OK, list<empty>, array{}> * @throws OCSException * * 200: Group created successfully @@ -266,7 +266,7 @@ class GroupsController extends AUserData { * @param string $groupId ID of the group * @param string $key Key to update, only 'displayname' * @param string $value New value for the key - * @return DataResponse<Http::STATUS_OK, array<empty>, array{}> + * @return DataResponse<Http::STATUS_OK, list<empty>, array{}> * @throws OCSException * * 200: Group updated successfully @@ -295,7 +295,7 @@ class GroupsController extends AUserData { * Delete a group * * @param string $groupId ID of the group - * @return DataResponse<Http::STATUS_OK, array<empty>, array{}> + * @return DataResponse<Http::STATUS_OK, list<empty>, array{}> * @throws OCSException * * 200: Group deleted successfully @@ -320,7 +320,7 @@ class GroupsController extends AUserData { * Get the list of user IDs that are a subadmin of the group * * @param string $groupId ID of the group - * @return DataResponse<Http::STATUS_OK, string[], array{}> + * @return DataResponse<Http::STATUS_OK, list<string>, array{}> * @throws OCSException * * 200: Sub admins returned @@ -336,7 +336,7 @@ class GroupsController extends AUserData { /** @var IUser[] $subadmins */ $subadmins = $this->groupManager->getSubAdmin()->getGroupsSubAdmins($targetGroup); // New class returns IUser[] so convert back - /** @var string[] $uids */ + /** @var list<string> $uids */ $uids = []; foreach ($subadmins as $user) { $uids[] = $user->getUID(); |