You are here

protected function MarkdownDescriptor::describeInputOption in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Descriptor/MarkdownDescriptor.php \Symfony\Component\Console\Descriptor\MarkdownDescriptor::describeInputOption()

Describes an InputOption instance.

Parameters

InputOption $option:

array $options:

Return value

string|mixed

Overrides Descriptor::describeInputOption

1 call to MarkdownDescriptor::describeInputOption()
MarkdownDescriptor::describeInputDefinition in vendor/symfony/console/Descriptor/MarkdownDescriptor.php
Describes an InputDefinition instance.

File

vendor/symfony/console/Descriptor/MarkdownDescriptor.php, line 47

Class

MarkdownDescriptor
Markdown descriptor.

Namespace

Symfony\Component\Console\Descriptor

Code

protected function describeInputOption(InputOption $option, array $options = array()) {
  $this
    ->write('**' . $option
    ->getName() . ':**' . "\n\n" . '* Name: `--' . $option
    ->getName() . '`' . "\n" . '* Shortcut: ' . ($option
    ->getShortcut() ? '`-' . implode('|-', explode('|', $option
    ->getShortcut())) . '`' : '<none>') . "\n" . '* Accept value: ' . ($option
    ->acceptValue() ? 'yes' : 'no') . "\n" . '* Is value required: ' . ($option
    ->isValueRequired() ? 'yes' : 'no') . "\n" . '* Is multiple: ' . ($option
    ->isArray() ? 'yes' : 'no') . "\n" . '* Description: ' . preg_replace('/\\s*[\\r\\n]\\s*/', "\n  ", $option
    ->getDescription() ?: '<none>') . "\n" . '* Default: `' . str_replace("\n", '', var_export($option
    ->getDefault(), true)) . '`');
}