/**
  * Show prompt to ask user.
  *
  * @param   string  $msg      Question.
  * @param   string  $default  Default value.
  *
  * @return  string  The value that use input.
  *
  * @since   2.0
  */
 public function ask($msg = '', $default = null)
 {
     return parent::ask($msg, $default);
 }
示例#2
0
 /**
  * prepareCallbackPrompter
  *
  * @param CallbackPrompter $prompter
  * @param string|null      $noValidMessage
  * @param integer          $attemptTimes
  * @param string|null      $failCloseMessage
  *
  * @return CallbackPrompter
  */
 protected static function prepareCallbackPrompter(CallbackPrompter $prompter, $noValidMessage, $attemptTimes, $failCloseMessage)
 {
     $prompter->setAttemptTimes($attemptTimes);
     if ($noValidMessage !== null) {
         $prompter->setNoValidMessage($noValidMessage);
     }
     if ($failCloseMessage !== false) {
         $prompter->failToClose(true, $failCloseMessage);
     }
     return $prompter;
 }