Input/ArgvInput.php
public function hasFlag($name)
    {
        $option = $this->definition->getOption($name);

        if (!$option->isFlag()) {
            throw new \InvalidArgumentException(sprintf('The "--%s" option is not a flag.', $name));
        }

        return !empty($this->options[$name]);
    }
public function hasFlag($name)
    {
        $option = $this->definition->getOption($name);

        if (!$option->isFlag()) {
            throw new \InvalidArgumentException(sprintf('The "--%s" option is not a flag.', $name));
        }

        return !empty($this->options[$name]);
    }
Returns true if flag is enabled and not empty.

@param string $name
Option name.

@return boolean
True if the flag is contained in raw parameters and its value is not
empty.