Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ReStructuredTextDescriptor.php

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

ReStructuredTextDescriptor

Namespace

Symfony\Component\Console\Descriptor

Code

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");
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal