You are here

public function OutputFormatterStyle::unsetOption in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Formatter/OutputFormatterStyle.php \Symfony\Component\Console\Formatter\OutputFormatterStyle::unsetOption()

Unsets some specific style option.

Parameters

string $option The option name:

Throws

\InvalidArgumentException When the option name isn't defined

Overrides OutputFormatterStyleInterface::unsetOption

File

vendor/symfony/console/Formatter/OutputFormatterStyle.php, line 156

Class

OutputFormatterStyle
Formatter style class for defining styles.

Namespace

Symfony\Component\Console\Formatter

Code

public function unsetOption($option) {
  if (!isset(static::$availableOptions[$option])) {
    throw new \InvalidArgumentException(sprintf('Invalid option specified: "%s". Expected one of (%s)', $option, implode(', ', array_keys(static::$availableOptions))));
  }
  $pos = array_search(static::$availableOptions[$option], $this->options);
  if (false !== $pos) {
    unset($this->options[$pos]);
  }
}