Back to AddUserToGroupCommand class

Method getStringFromOption

protected string
getStringFromOption
(mixed $option, mixed $question)
Method to get a value from option
Parameters
  • string $option set the option name
  • string $question set the question if user enters no value to option
Returns
  • string
Since
  • 4.0.0

Method getStringFromOption - Source code

/**
 * Method to get a value from option
 *
 * @param   string  $option    set the option name
 *
 * @param   string  $question  set the question if user enters no value to option
 *
 * @return  string
 *
 * @since   4.0.0
 */
protected function getStringFromOption($option, $question) : string
{
    $answer = (string) $this->getApplication()->getConsoleInput()->getOption($option);
    while (!$answer) {
        $answer = (string) $this->ioStyle->ask($question);
    }
    return $answer;
}