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
Namespace
Symfony\Component\Console\DescriptorCode
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'];
}
}