src/mako/cli/input/helpers/Confirmation.php
public function ask(string $question, $default = 'n', ?array $options = null)
	{
		$options = $options === null ? ['y' => true, 'n' => false] : $this->normalizeKeys($options);

		$input = parent::ask(trim($question) . ' [' . $this->getOptions($options, $default) . '] ');

		$input = mb_strtolower(empty($input) ? $default : $input);

		if(!isset($options[$input]))
		{
			return $this->ask($question, $default, $options);
		}

		return $options[$input];
	}
public function ask(string $question, $default = 'n', ?array $options = null)
	{
		$options = $options === null ? ['y' => true, 'n' => false] : $this->normalizeKeys($options);

		$input = parent::ask(trim($question) . ' [' . $this->getOptions($options, $default) . '] ');

		$input = mb_strtolower(empty($input) ? $default : $input);

		if(!isset($options[$input]))
		{
			return $this->ask($question, $default, $options);
		}

		return $options[$input];
	}
public function ask ( string $ question , $ default = 'n' , ? array $ options = null ) { $ options = $ options === null ? [ 'y' => true , 'n' => false ] : $ this -> normalizeKeys ( $ options ) ; $ input = parent :: ask ( trim ( $ question ) . ' [' . $ this -> getOptions ( $ options , $ default ) . '] ' ) ; $ input = mb_strtolower ( empty ( $ input ) ? $ default : $ input ) ; if ( ! isset ( $ options [ $ input ] ) ) { return $ this -> ask ( $ question , $ default , $ options ) ; } return $ options [ $ input ] ; }
Asks user for confirmation and returns value corresponding to the chosen value.

@param  string     $question Question to ask
@param  string     $default  Default answer
@param  array|null $options  Answer options
@return bool
Asks user for confirmation and returns value corresponding to the chosen value .