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

Breadcrumb

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

function Input::setOption

Overrides InputInterface::setOption

File

vendor/symfony/console/Input/Input.php, line 133

Class

Input
Input is the base class for all concrete Input classes.

Namespace

Symfony\Component\Console\Input

Code

public function setOption(string $name, mixed $value) : void {
    if ($this->definition
        ->hasNegation($name)) {
        $this->options[$this->definition
            ->negationToName($name)] = !$value;
        return;
    }
    elseif (!$this->definition
        ->hasOption($name)) {
        throw new InvalidArgumentException(\sprintf('The "%s" option does not exist.', $name));
    }
    $this->options[$name] = $value;
}

API Navigation

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