public function choice(
        string $question,
        array $choices,
        ?string $default = null,
        $attempts        = null,
        bool $multiple   = false
    ): ?string {
        $question = new ChoiceQuestion($question, $choices, $default);

        $question->setMaxAttempts($attempts)->setMultiselect($multiple);

        return $this->getOutput()->askQuestion($question);
    }
public function choice(
        string $question,
        array $choices,
        ?string $default = null,
        $attempts        = null,
        bool $multiple   = false
    ): ?string {
        $question = new ChoiceQuestion($question, $choices, $default);

        $question->setMaxAttempts($attempts)->setMultiselect($multiple);

        return $this->getOutput()->askQuestion($question);
    }
public function choice ( string $ question , array $ choices , ? string $ default = null , $ attempts = null , bool $ multiple = false ) : ? string { $ question = new ChoiceQuestion ( $ question , $ choices , $ default ) ; $ question -> setMaxAttempts ( $ attempts ) -> setMultiselect ( $ multiple ) ; return $ this -> getOutput ( ) -> askQuestion ( $ question ) ; }
Give the user a single choice from an array of answers.

@param string      $question
@param array       $choices
@param null|string $default
@param mixed       $attempts
@param bool        $multiple

@return null|string
Give the user a single choice from an array of answers .