@param string $name

@return IOption

@throws InvalidOptionNameException
332147
public function setName($name) {
        if ($name !== null && ! $this->argumentsParser->isOptionName($name)) {
            throw new InvalidOptionNameException(s(
                'A option name must have this format: "--option", got: "%s"', $name
            ));
        }

        $this->name = $name;

        return $this;
    }
112590
public function getOption($name) {
        if (!$this->definition->hasOption($name)) {
            throw new \InvalidArgumentException(sprintf('The "%s" option does not exist.', $name));
        }

        return isset($this->options[$name]) ? $this->options[$name] : $this->definition->getOption($name)->getDefault();
    }
54441
public function findOption($nameOrOption) {
        foreach ($this->getOptions() as $option) {
            if ($option->hasNameOrAlias($nameOrOption)) {
                return $option;
            }
        }

        throw new OptionNotFoundException(s(
            'Option "%s" does not exist.',
            $nameOrOption
        ));
    }
483965
public function setName($name)
    {
        if (is_scalar($name) || method_exists($name, '__toString')) {
            $this->name = (string) $name;
        } else {
            throw new InvalidArgumentException('The name must be a string.');
        }

        if ($this->name === '') {
            $this->name = 'Error';
        }

        return $this;
    }
1243010
public static function fromName($name)
    {
        $names = static::getNames();
        if (array_key_exists($name, $names)) {
            return new static($name, $names[$name]);
        }
        throw new \InvalidArgumentException("No enum constant '$name' in class " . get_called_class());
    }
519198
public function getOption($name)
    {
        if (isset($this->options[$name])) {
            return $this->options[$name];
        }
        return false;
    }
225184
public function getOption($name)
    {
        if (!\array_key_exists($name, $this->options)) {
            throw new \OutOfBoundsException(\sprintf('Unknown option "%s"', $name));
        }

        return $this->options[$name];
    }
318879
public function getOption($name)
    {
        if (method_exists($this, $method = 'get' . $name)) {
            return $this->$method();
        } else {
            return isset($this->$name) ? $this->$name : null;
        }
    }
375788
public function setName($name)
    {
        if (strlen($name) == 0) {
            throw new \InvalidArgumentException(sprintf('TextInput name should not be empty'));
        }

        $this->name = $name;

        return $this;
    }
342647
public function getOption($name) {
    if (!array_key_exists($name, $this->options)) {
      throw new InvalidArgumentException(sprintf('Undefined option: "%s"', $name));
    }

    return $this->options[$name];
  }
384861
protected function setUsername($name) {
        if (!is_string($name)) throw new IllegalTypeException('Illegal type of parameter $name: '.gettype($name));
        if (!strlen($name))    throw new InvalidArgumentException('Invalid parameter $name: "'.$name.'" (empty)');

        $this->username = $name;
        return $this;
    }
991127
final public function getOption($name)
    {
        if (!isset($this->options[$name])) {
            throw new \LogicException(sprintf('The option "%s" don\'t exists.', $name));
        }
        return $this->options[$name];
    }
729511
public static function getOption($name = null)
    {
        if (null === $name) {
            return self::$_options;
        } else {
            return isset(self::$_options[$name])? self::$_options[$name]: null;
        }
    }
604895
public function setName($name)
    {
        if (!is_string($name) && !is_null($name)) {
            throw new \InvalidArgumentException(__CLASS__ . ' ' . __METHOD__ . ': Not a string');
        }

        $this->name = $name;

        return $this;
    }
895321
public function option($name)
    {
        $input = $this->getInput();

        return (is_null($name)) ? $input->getOptions() : $input->getOption($name);
    }
536814
public function get(string $name) : ICommand
    {
        if (!$this->has($name)) {
            throw new InvalidArgumentException("No command with name \"$name\" exists");
        }

        return $this->commands[$name];
    }
741702
public function setName($name) {
        if (!is_string($name)) throw new IllegalTypeException('Illegal type of parameter $name: '.gettype($name));
        if (!strlen($name))    throw new InvalidArgumentException('Invalid argument $name: '.$name);

        $this->name = $name;
        return $this;
    }