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

Breadcrumb

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

function ReStructuredTextDescriptor::setVisibleNamespaces

1 call to ReStructuredTextDescriptor::setVisibleNamespaces()
ReStructuredTextDescriptor::createTableOfContents in vendor/symfony/console/Descriptor/ReStructuredTextDescriptor.php

File

vendor/symfony/console/Descriptor/ReStructuredTextDescriptor.php, line 238

Class

ReStructuredTextDescriptor

Namespace

Symfony\Component\Console\Descriptor

Code

private function setVisibleNamespaces(ApplicationDescription $description) : void {
    $commands = $description->getCommands();
    foreach ($description->getNamespaces() as $namespace) {
        try {
            $namespaceCommands = $namespace['commands'];
            foreach ($namespaceCommands as $key => $commandName) {
                if (!\array_key_exists($commandName, $commands)) {
                    // If the array key does not exist, then this is an alias.
                    unset($namespaceCommands[$key]);
                }
                elseif ($commands[$commandName]->isHidden()) {
                    unset($namespaceCommands[$key]);
                }
            }
            if (!$namespaceCommands) {
                // If the namespace contained only aliases or hidden commands, skip the namespace.
                continue;
            }
        } catch (\Exception) {
        }
        $this->visibleNamespaces[] = $namespace['id'];
    }
}

API Navigation

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