public function choice(string $text, array $choices, $default = null, bool $case = false)
    {
        $this->writer->yellow($text);

        $this->listOptions($choices, $default, false);

        $choice = $this->reader->read($default);

        return $this->isValidChoice($choice, $choices, $case) ? $choice : $default;
    }
public function choice(string $text, array $choices, $default = null, bool $case = false)
    {
        $this->writer->yellow($text);

        $this->listOptions($choices, $default, false);

        $choice = $this->reader->read($default);

        return $this->isValidChoice($choice, $choices, $case) ? $choice : $default;
    }
public function choice ( string $ text , array $ choices , $ default = null , bool $ case = false ) { $ this -> writer -> yellow ( $ text ) ; $ this -> listOptions ( $ choices , $ default , false ) ; $ choice = $ this -> reader -> read ( $ default ) ; return $ this -> isValidChoice ( $ choice , $ choices , $ case ) ? $ choice : $ default ; }
Let user make a choice out of available choices.

@param string $text    Prompt text.
@param array  $choices Possible choices for user.
@param mixed  $default Default value- if not chosen or invalid.
@param bool   $case    If user input should be case sensitive.

@return mixed User input or default.
Let user make a choice out of available choices .