Fix the group:find command

This commit is contained in:
Chris 2025-03-14 22:57:35 +01:00
parent 33b96007e8
commit cc5c711d32

View File

@ -30,7 +30,24 @@ class GroupFindCommand extends Command
$groups = $this->client->findGroups();
var_dump($groups);
$keys = [];
foreach ($groups as $group) {
$keys = array_merge($keys, array_keys($group));
}
$keys = array_unique($keys);
$table = new Table($output);
$table->setHeaders($keys);
$table->setStyle('box');
foreach ($groups as $group) {
$row = [];
foreach ($keys as $key) {
$row[] = isset($group[$key]) ? json_encode($group[$key]) : null;
}
$table->addRow($row);
}
$table->render();
return self::SUCCESS;
}