function TextDescriptor::describeInputDefinition
Overrides Descriptor::describeInputDefinition
2 calls to TextDescriptor::describeInputDefinition()
- TextDescriptor::describeApplication in vendor/
symfony/ console/ Descriptor/ TextDescriptor.php - Describes an Application instance.
- TextDescriptor::describeCommand in vendor/
symfony/ console/ Descriptor/ TextDescriptor.php - Describes a Command instance.
File
-
vendor/
symfony/ console/ Descriptor/ TextDescriptor.php, line 86
Class
- TextDescriptor
- Text descriptor.
Namespace
Symfony\Component\Console\DescriptorCode
protected function describeInputDefinition(InputDefinition $definition, array $options = []) : void {
$totalWidth = $this->calculateTotalWidthForOptions($definition->getOptions());
foreach ($definition->getArguments() as $argument) {
$totalWidth = max($totalWidth, Helper::width($argument->getName()));
}
if ($definition->getArguments()) {
$this->writeText('<comment>Arguments:</comment>', $options);
$this->writeText("\n");
foreach ($definition->getArguments() as $argument) {
$this->describeInputArgument($argument, array_merge($options, [
'total_width' => $totalWidth,
]));
$this->writeText("\n");
}
}
if ($definition->getArguments() && $definition->getOptions()) {
$this->writeText("\n");
}
if ($definition->getOptions()) {
$laterOptions = [];
$this->writeText('<comment>Options:</comment>', $options);
foreach ($definition->getOptions() as $option) {
if (\strlen($option->getShortcut() ?? '') > 1) {
$laterOptions[] = $option;
continue;
}
$this->writeText("\n");
$this->describeInputOption($option, array_merge($options, [
'total_width' => $totalWidth,
]));
}
foreach ($laterOptions as $option) {
$this->writeText("\n");
$this->describeInputOption($option, array_merge($options, [
'total_width' => $totalWidth,
]));
}
}
}