Cake\Console\Shell::in PHP Method

in() public method

Prompts the user for input, and returns it.
public in ( string $prompt, string | array | null $options = null, string | null $default = null ) : mixed
$prompt string Prompt text.
$options string | array | null Array or string of options.
$default string | null Default input value.
return mixed Either the default value, or the user-provided input.
    public function in($prompt, $options = null, $default = null)
    {
        if (!$this->interactive) {
            return $default;
        }
        if ($options) {
            return $this->_io->askChoice($prompt, $options, $default);
        }
        return $this->_io->ask($prompt, $default);
    }