Fixed warning when command alias is longer than command name
This commit is contained in:
parent
c0ff72802c
commit
ecfe94465d
@ -249,12 +249,16 @@ class TextDescriptor extends Descriptor
|
|||||||
*/
|
*/
|
||||||
private function getColumnWidth(array $commands)
|
private function getColumnWidth(array $commands)
|
||||||
{
|
{
|
||||||
$width = 0;
|
$widths = array();
|
||||||
|
|
||||||
foreach ($commands as $command) {
|
foreach ($commands as $command) {
|
||||||
$width = strlen($command->getName()) > $width ? strlen($command->getName()) : $width;
|
$widths[] = strlen($command->getName());
|
||||||
|
foreach ($command->getAliases() as $alias) {
|
||||||
|
$widths[] = strlen($alias);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $width + 2;
|
return max($widths) + 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user