function MarkdownDescriptor::describeApplication
Overrides Descriptor::describeApplication
File
-
vendor/
symfony/ console/ Descriptor/ MarkdownDescriptor.php, line 137
Class
- MarkdownDescriptor
- Markdown descriptor.
Namespace
Symfony\Component\Console\DescriptorCode
protected function describeApplication(Application $application, array $options = []) : void {
$describedNamespace = $options['namespace'] ?? null;
$description = new ApplicationDescription($application, $describedNamespace);
$title = $this->getApplicationTitle($application);
$this->write($title . "\n" . str_repeat('=', Helper::width($title)));
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(fn($commandName) => \sprintf('* [`%s`](#%s)', $commandName, str_replace(':', '', $description->getCommand($commandName)
->getName())), $namespace['commands'])));
}
foreach ($description->getCommands() as $command) {
$this->write("\n\n");
$this->describeCommand($command, $options);
}
}