Back to SetConfigurationCommand class

Method retrieveOptionsFromInput

private bool
retrieveOptionsFromInput
(array $options)
Collects options from user input
Parameters
  • array $options Options input by users
Returns
  • bool
Since
  • 4.0.0

Method retrieveOptionsFromInput - Source code

/**
 * Collects options from user input
 *
 * @param   array  $options  Options input by users
 *
 * @return boolean
 *
 * @since 4.0.0
 */
private function retrieveOptionsFromInput(array $options) : bool
{
    $collected = [];
    foreach ($options as $option) {
        if (strpos($option, '=') === false) {
            $this->ioStyle->error('Options and values should be separated by "="');
            return false;
        }
        list($option, $value) = explode('=', $option);
        $collected[$option] = $value;
    }
    $this->options = $collected;
    return true;
}