public function getOption(
        InputInterface $input,
        $name,
        $configPath = null,
        $default = null,
        $commaSeparated = false
    ) {
        $value = $input->getOption($name);

        // find value in config
        if ($this->valueIsEmpty($value) && $configPath !== null) {
            $value = $this->getConfigValueFromPath($configPath);
        }

        // use default if value is still null
        if ($this->valueIsEmpty($value)) {
            return (is_array($value) && $default === null) ? array() : $default;
        }

        return $commaSeparated
            ? $this->splitCommaSeparatedValues($value)
            : $value;
    }
public function getOption(
        InputInterface $input,
        $name,
        $configPath = null,
        $default = null,
        $commaSeparated = false
    ) {
        $value = $input->getOption($name);

        // find value in config
        if ($this->valueIsEmpty($value) && $configPath !== null) {
            $value = $this->getConfigValueFromPath($configPath);
        }

        // use default if value is still null
        if ($this->valueIsEmpty($value)) {
            return (is_array($value) && $default === null) ? array() : $default;
        }

        return $commaSeparated
            ? $this->splitCommaSeparatedValues($value)
            : $value;
    }
public function getOption ( InputInterface $ input , $ name , $ configPath = null , $ default = null , $ commaSeparated = false ) { $ value = $ input -> getOption ( $ name ) ; // find value in config if ( $ this -> valueIsEmpty ( $ value ) && $ configPath !== null ) { $ value = $ this -> getConfigValueFromPath ( $ configPath ) ; } // use default if value is still null if ( $ this -> valueIsEmpty ( $ value ) ) { return ( is_array ( $ value ) && $ default === null ) ? array ( ) : $ default ; } return $ commaSeparated ? $ this -> splitCommaSeparatedValues ( $ value ) : $ value ; }
Returns the value of an option from the command-line parameters,
configuration or given default.

@param InputInterface $input           Input interface to query for information
@param string         $name            Name of the option to retrieve from argv
@param string|null    $configPath     Path to the config element(s) containing the value to be used when
no option is provided.
@param mixed|null     $default         Default value used if there is no configuration option or path set
@param bool           $commaSeparated Could the value be a comma separated string requiring splitting

@return string|array
Returns the value of an option from the command - line parameters configuration or given default .