protected function TextDescriptor::describeInputArgument in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/console/Descriptor/TextDescriptor.php \Symfony\Component\Console\Descriptor\TextDescriptor::describeInputArgument()
Describes an InputArgument instance.
Parameters
InputArgument $argument:
array $options:
Return value
string|mixed
Overrides Descriptor::describeInputArgument
1 call to TextDescriptor::describeInputArgument()
- TextDescriptor::describeInputDefinition in vendor/
symfony/ console/ Descriptor/ TextDescriptor.php - Describes an InputDefinition instance.
File
- vendor/
symfony/ console/ Descriptor/ TextDescriptor.php, line 32
Class
- TextDescriptor
- Text descriptor.
Namespace
Symfony\Component\Console\DescriptorCode
protected function describeInputArgument(InputArgument $argument, array $options = array()) {
if (null !== $argument
->getDefault() && (!is_array($argument
->getDefault()) || count($argument
->getDefault()))) {
$default = sprintf('<comment> [default: %s]</comment>', $this
->formatDefaultValue($argument
->getDefault()));
}
else {
$default = '';
}
$totalWidth = isset($options['total_width']) ? $options['total_width'] : strlen($argument
->getName());
$spacingWidth = $totalWidth - strlen($argument
->getName()) + 2;
$this
->writeText(sprintf(' <info>%s</info>%s%s%s', $argument
->getName(), str_repeat(' ', $spacingWidth), preg_replace('/\\s*[\\r\\n]\\s*/', "\n" . str_repeat(' ', $totalWidth + 17), $argument
->getDescription()), $default), $options);
}