public function select($question, array $choices, $default = null, bool $multiSelect = false, int $attempts = null)
    {
        $question = new ChoiceQuestion($this->combineQuestion($question), $choices, $default);
        $question
            ->setMaxAttempts($attempts)
            ->setMultiselect($multiSelect)
            ->setErrorMessage('Value "%s" is invalid');

        return $this->getQuestionHelper()->ask($this->input, $this->output, $question);
    }
public function select($question, array $choices, $default = null, bool $multiSelect = false, int $attempts = null)
    {
        $question = new ChoiceQuestion($this->combineQuestion($question), $choices, $default);
        $question
            ->setMaxAttempts($attempts)
            ->setMultiselect($multiSelect)
            ->setErrorMessage('Value "%s" is invalid');

        return $this->getQuestionHelper()->ask($this->input, $this->output, $question);
    }
public function select ( $ question , array $ choices , $ default = null , bool $ multiSelect = false , int $ attempts = null ) { $ question = new ChoiceQuestion ( $ this -> combineQuestion ( $ question ) , $ choices , $ default ) ; $ question -> setMaxAttempts ( $ attempts ) -> setMultiselect ( $ multiSelect ) -> setErrorMessage ( 'Value "%s" is invalid' ) ; return $ this -> getQuestionHelper ( ) -> ask ( $ this -> input , $ this -> output , $ question ) ; }
Asks the user to select a value

@param string|array $question The question to ask. If an array each array item is turned into one line of a multi-line question
@param array $choices List of choices to pick from
@param mixed|null $default The default answer if the user enters nothing
@param boolean $multiSelect If true the result will be an array with the selected options. Multiple options can be given separated by commas
@param integer|null $attempts Max number of times to ask before giving up (null by default, which means infinite)
@return integer|string|array Either the value for indexed arrays, the key for associative arrays or an array for multiple selections
@throws \InvalidArgumentException
Asks the user to select a value