You are here

protected function MarkdownDescriptor::describeApplication in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Descriptor/MarkdownDescriptor.php \Symfony\Component\Console\Descriptor\MarkdownDescriptor::describeApplication()

Describes an Application instance.

Parameters

Application $application:

array $options:

Return value

string|mixed

Overrides Descriptor::describeApplication

File

vendor/symfony/console/Descriptor/MarkdownDescriptor.php, line 119

Class

MarkdownDescriptor
Markdown descriptor.

Namespace

Symfony\Component\Console\Descriptor

Code

protected function describeApplication(Application $application, array $options = array()) {
  $describedNamespace = isset($options['namespace']) ? $options['namespace'] : null;
  $description = new ApplicationDescription($application, $describedNamespace);
  $this
    ->write($application
    ->getName() . "\n" . str_repeat('=', strlen($application
    ->getName())));
  foreach ($description
    ->getNamespaces() as $namespace) {
    if (ApplicationDescription::GLOBAL_NAMESPACE !== $namespace['id']) {
      $this
        ->write("\n\n");
      $this
        ->write('**' . $namespace['id'] . ':**');
    }
    $this
      ->write("\n\n");
    $this
      ->write(implode("\n", array_map(function ($commandName) {
      return '* ' . $commandName;
    }, $namespace['commands'])));
  }
  foreach ($description
    ->getCommands() as $command) {
    $this
      ->write("\n\n");
    $this
      ->write($this
      ->describeCommand($command));
  }
}