simplify command help example

This commit is contained in:
sunxyw 2022-05-03 16:13:13 +08:00
parent 7df05df48f
commit 35e23a7cbc
No known key found for this signature in database
GPG Key ID: CEA01A083E98C578

View File

@ -236,10 +236,9 @@ class Hello
{
$util = resolve(CommandInfoUtil::class);
$commands = $util->get();
$helps = [];
foreach ($commands as $command) {
$helps[] = $util->getHelp($command['id']);
}
$helps = array_map(static function ($command) use ($util) {
return $util->getHelp($command['id']);
}, $commands);
array_unshift($helps, '帮助:');
return implode("\n", $helps);
}