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

Breadcrumb

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

function MarkdownDescriptor::describeInputOption

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 57

Class

MarkdownDescriptor
Markdown descriptor.

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()) . '';
    }
    $this->write('#### `' . $name . '`' . "\n\n" . ($option->getDescription() ? preg_replace('/\\s*[\\r\\n]\\s*/', "\n", $option->getDescription()) . "\n\n" : '') . '* 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)) . '`');
}

API Navigation

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