Fix the group:find command
This commit is contained in:
parent
33b96007e8
commit
cc5c711d32
@ -30,7 +30,24 @@ class GroupFindCommand extends Command
|
|||||||
|
|
||||||
$groups = $this->client->findGroups();
|
$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;
|
return self::SUCCESS;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user