You are here

private function TextDescriptor::getColumnWidth in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/console/Descriptor/TextDescriptor.php \Symfony\Component\Console\Descriptor\TextDescriptor::getColumnWidth()

Parameters

Command[] $commands:

Return value

int

1 call to TextDescriptor::getColumnWidth()
TextDescriptor::describeApplication in vendor/symfony/console/Descriptor/TextDescriptor.php
Describes an Application instance.

File

vendor/symfony/console/Descriptor/TextDescriptor.php, line 250

Class

TextDescriptor
Text descriptor.

Namespace

Symfony\Component\Console\Descriptor

Code

private function getColumnWidth(array $commands) {
  $widths = array();
  foreach ($commands as $command) {
    $widths[] = strlen($command
      ->getName());
    foreach ($command
      ->getAliases() as $alias) {
      $widths[] = strlen($alias);
    }
  }
  return max($widths) + 2;
}