private function buildTable($current, $prefix = '', $isLast = false)
{
$data = [];
$currentPrefix = $prefix === '' ? '' : substr($prefix, 0, -2) . ($isLast ? '└-' : '├-');
$data[] = ['alias' => $currentPrefix . $current['alias'], 'name' => $current['name'], 'state' => $this->parseState($current['state'])];
$count = count($current['children']);
for ($i = 0; $i < $count; ++$i) {
$child = $current['children'][$i];
if ($i === $count - 1) {
$data = array_merge($data, $this->buildTable($child, $prefix . ' ', true));
} else {
$data = array_merge($data, $this->buildTable($child, $prefix . '| '));
}
}
return $data;
}