Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ReStructuredTextDescriptor.php

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

ReStructuredTextDescriptor

Namespace

Symfony\Component\Console\Descriptor

Code

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))));
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal