public function getOption($name, $includeBase = true)
    {
        Assert::string($name, 'The option name must be a string or an integer. Got: %s');
        Assert::notEmpty($name, 'The option name must not be empty.');
        Assert::boolean($includeBase, 'The parameter $includeBase must be a boolean. Got: %s');

        if (isset($this->options[$name])) {
            return $this->options[$name];
        }

        if (isset($this->optionsByShortName[$name])) {
            return $this->optionsByShortName[$name];
        }

        if ($includeBase && $this->baseFormat) {
            return $this->baseFormat->getOption($name);
        }

        throw NoSuchOptionException::forOptionName($name);
    }
public function getOption($name, $includeBase = true)
    {
        Assert::string($name, 'The option name must be a string or an integer. Got: %s');
        Assert::notEmpty($name, 'The option name must not be empty.');
        Assert::boolean($includeBase, 'The parameter $includeBase must be a boolean. Got: %s');

        if (isset($this->options[$name])) {
            return $this->options[$name];
        }

        if (isset($this->optionsByShortName[$name])) {
            return $this->optionsByShortName[$name];
        }

        if ($includeBase && $this->baseFormat) {
            return $this->baseFormat->getOption($name);
        }

        throw NoSuchOptionException::forOptionName($name);
    }
public function getOption ( $ name , $ includeBase = true ) { Assert :: string ( $ name , 'The option name must be a string or an integer. Got: %s' ) ; Assert :: notEmpty ( $ name , 'The option name must not be empty.' ) ; Assert :: boolean ( $ includeBase , 'The parameter $includeBase must be a boolean. Got: %s' ) ; if ( isset ( $ this -> options [ $ name ] ) ) { return $ this -> options [ $ name ] ; } if ( isset ( $ this -> optionsByShortName [ $ name ] ) ) { return $ this -> optionsByShortName [ $ name ] ; } if ( $ includeBase && $ this -> baseFormat ) { return $ this -> baseFormat -> getOption ( $ name ) ; } throw NoSuchOptionException :: forOptionName ( $ name ) ; }
Returns an option by its long or short name.

@param string $name        The long or short option name.
@param bool   $includeBase Whether to include options in the base format
in the search.

@return Option The option.

@throws NoSuchOptionException If the option with the given name does not
not exist.
Returns an option by its long or short name .