function ReStructuredTextDescriptor::describeInputOption
Overrides Descriptor::describeInputOption
1 call to ReStructuredTextDescriptor::describeInputOption()
- ReStructuredTextDescriptor::describeInputDefinition in vendor/
symfony/ console/ Descriptor/ ReStructuredTextDescriptor.php - Describes an InputDefinition instance.
File
-
vendor/
symfony/ console/ Descriptor/ ReStructuredTextDescriptor.php, line 69
Class
Namespace
Symfony\Component\Console\DescriptorCode
protected function describeInputOption(InputOption $option, array $options = []) : void {
$name = '\\-\\-' . $option->getName();
if ($option->isNegatable()) {
$name .= '|\\-\\-no-' . $option->getName();
}
if ($option->getShortcut()) {
$name .= '|-' . str_replace('|', '|-', $option->getShortcut());
}
$optionDescription = $option->getDescription() ? preg_replace('/\\s*[\\r\\n]\\s*/', "\n\n", $option->getDescription()) . "\n\n" : '';
$optionDescription = (new UnicodeString($optionDescription))->ascii();
$this->write($name . "\n" . str_repeat($this->paragraphsChar, Helper::width($name)) . "\n\n" . $optionDescription . '- **Accept value**: ' . ($option->acceptValue() ? 'yes' : 'no') . "\n" . '- **Is value required**: ' . ($option->isValueRequired() ? 'yes' : 'no') . "\n" . '- **Is multiple**: ' . ($option->isArray() ? 'yes' : 'no') . "\n" . '- **Is negatable**: ' . ($option->isNegatable() ? 'yes' : 'no') . "\n" . '- **Default**: ``' . str_replace("\n", '', var_export($option->getDefault(), true)) . '``' . "\n");
}