function ReStructuredTextDescriptor::createTableOfContents
1 call to ReStructuredTextDescriptor::createTableOfContents()
- ReStructuredTextDescriptor::describeApplication in vendor/
symfony/ console/ Descriptor/ ReStructuredTextDescriptor.php - Describes an Application instance.
File
-
vendor/
symfony/ console/ Descriptor/ ReStructuredTextDescriptor.php, line 196
Class
Namespace
Symfony\Component\Console\DescriptorCode
private function createTableOfContents(ApplicationDescription $description, Application $application) : void {
$this->setVisibleNamespaces($description);
$chapterTitle = 'Table of Contents';
$this->write("\n\n{$chapterTitle}\n" . str_repeat($this->chapterChar, Helper::width($chapterTitle)) . "\n\n");
foreach ($this->visibleNamespaces as $namespace) {
if ('_global' === $namespace) {
$commands = $application->all('');
}
else {
$commands = $application->all($namespace);
$this->write("\n\n");
$this->write($namespace . "\n" . str_repeat($this->sectionChar, Helper::width($namespace)) . "\n\n");
}
$commands = $this->removeAliasesAndHiddenCommands($commands);
$this->write("\n\n");
$this->write(implode("\n", array_map(static fn($commandName) => \sprintf('- `%s`_', $commandName), array_keys($commands))));
}
}