Skip to content

Commit 3a299f4

Browse files
committed
fix output for group:list command with numeric user ids
Signed-off-by: Robin Appelman <[email protected]>
1 parent 1ac7a3f commit 3a299f4

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

core/Command/Group/ListCommand.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7575
return 0;
7676
}
7777

78+
/**
79+
* @param IGroup $group
80+
* @return string[]
81+
*/
82+
function usersForGroup(IGroup $group) {
83+
$users = array_keys($group->getUsers());
84+
return array_map(function($userId) {return (string)$userId;}, $users);
85+
}
86+
7887
/**
7988
* @param IGroup[] $groups
8089
* @return array
@@ -88,12 +97,12 @@ private function formatGroups(array $groups, bool $addInfo = false) {
8897
$values = array_map(function (IGroup $group) {
8998
return [
9099
'backends' => $group->getBackendNames(),
91-
'users' => array_keys($group->getUsers()),
100+
'users' => $this->usersForGroup($group),
92101
];
93102
}, $groups);
94103
} else {
95104
$values = array_map(function (IGroup $group) {
96-
return array_keys($group->getUsers());
105+
return $this->usersForGroup($group);
97106
}, $groups);
98107
}
99108
return array_combine($keys, $values);

0 commit comments

Comments
 (0)