From b89621e8da04f0365dcc53fff85b31e5d36aaac9 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 6 Apr 2023 16:27:57 +0200 Subject: fix output for group:list command with numeric user ids Signed-off-by: Robin Appelman --- core/Command/Group/ListCommand.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/Command/Group/ListCommand.php b/core/Command/Group/ListCommand.php index 5100a00c60a..0285cc05dcd 100644 --- a/core/Command/Group/ListCommand.php +++ b/core/Command/Group/ListCommand.php @@ -75,6 +75,17 @@ class ListCommand extends Base { return 0; } + /** + * @param IGroup $group + * @return string[] + */ + public function usersForGroup(IGroup $group) { + $users = array_keys($group->getUsers()); + return array_map(function ($userId) { + return (string)$userId; + }, $users); + } + /** * @param IGroup[] $groups * @return array @@ -88,12 +99,12 @@ class ListCommand extends Base { $values = array_map(function (IGroup $group) { return [ 'backends' => $group->getBackendNames(), - 'users' => array_keys($group->getUsers()), + 'users' => $this->usersForGroup($group), ]; }, $groups); } else { $values = array_map(function (IGroup $group) { - return array_keys($group->getUsers()); + return $this->usersForGroup($group); }, $groups); } return array_combine($keys, $values); -- cgit v1.2.3