@param $message
@param bool  $default

@return string
160528
protected function confirm($message, $default = null)
    {
        /** @var QuestionHelper $q */
        $q = $this->getHelperSet()->get('question');

        $question = new ConfirmationQuestion(
            $message . ($default ? (sprintf(' [%s]', $default ? 'yes' : 'no')) : '') . ' : ', true === $default
        );

        $question->setMaxAttempts(3);

        $response = $q->ask($this->getInput(), $this->getOutput(), $question);

        return $response;
    }
303368
public function getFirstMessage($key, $default = null)
    {
        $messages = self::getMessage($key);
        if (is_array($messages) && count($messages) > 0) {
            return $messages[0];
        }

        return $default;
    }
661773
public function parseRequest($message)
    {
        if (!($parts = $this->parseMessage($message))) {
            return false;
        }

        // Parse the protocol and protocol version
        if (isset($parts['start_line'][2])) {
            $startParts = explode('/', $parts['start_line'][2]);
            $protocol = strtoupper($startParts[0]);
            $version = isset($startParts[1]) ? $startParts[1] : '1.1';
        } else {
            $protocol = 'HTTP';
            $version = '1.1';
        }

        $parsed = [
            'method'   => strtoupper($parts['start_line'][0]),
            'protocol' => $protocol,
            'protocol_version' => $version,
            'headers'  => $parts['headers'],
            'body'     => $parts['body']
        ];

        $parsed['request_url'] = $this->getUrlPartsFromMessage(
            (isset($parts['start_line'][1]) ? $parts['start_line'][1] : ''), $parsed);

        return $parsed;
    }
2163
public static function assertNotBool($actual, string $message = '')
    {
        self::assertTypeOfScalar($actual, $message, 'assertNotBool', new LogicalNot(new ScalarConstraint(ScalarConstraint::TYPE_BOOL)));
    }
1311969
protected function getPostedAction($message = true)
    {
        $action = $this->getPosted('action', array(), true, 'array');

        if (!empty($action)) {

            if (empty($action['name'])) {
                $error = $this->text('An error occurred');
            } else if (empty($action['items'])) {
                $error = $this->text('Please select at least one item');
            } else {
                $parts = explode('|', $action['name'], 2);
                return array($action['items'], $parts[0], isset($parts[1]) ? $parts[1] : null);
            }

            if (isset($error) && $message) {
                $this->setMessage($error, 'warning');
            }
        }

        return array(array(), null, null);
    }
16157
public static function __($message, $params = [], $language = null)
    {
        return Yii::t(static::$defaultContext, $message, $params, $language);
    }
357946
protected function choice($message, $expectedValues, $default = null
    )
    {
        /** @var QuestionHelper $q */
        $q = $this->getHelperSet()->get('question');

        $question = new ChoiceQuestion(
            $message . ($default ? (sprintf(' [%s]', $default)) : '') . ' : ',
            $expectedValues,
            $default
        );

        $question->setMaxAttempts(5);

        $response = $q->ask($this->getInput(), $this->getOutput(), $question);

        return $response;
    }
123919
public static function message($name, $message = null)
    {
        if (func_num_args() === 2) {
            return static::$_messages[$name] = $message;
        }
        return isset(static::$_messages[$name]) ? static::$_messages[$name] : static::$_messages['_default_'];
    }
599492
public function confirm($question, $default = 'yes')
    {
        //Show required message
        echo "\n";
        echo "\t", $this->colorize($question." [$default] ", 'info'); echo " ";
        //Get user input
        $response = trim(fgets(STDIN));
        //Check if $response is yes or not
        if($response == 'yes' || $response == 'no')
        {
            //If is yes or not return the response
            return $response;
        }
        else if(empty($response))
        {
            //If response is empty return default value
            return $default;
        }
        else
        {
            //If not passed argument, repeat confirmation.
            $this->confirm($question, $default);
        }
    }
732037
public function setDefaultMessage(string $rule, string $message): self
    {
        $this->defaultMessages[$rule] = $message;

        return $this;
    }
1276198
protected function get($parameter, $default=null) {
		return isset($this->parameters[$parameter]) ? $this->parameters[$parameter] : $default;
	}
536362
public function getRequestHeader($header, $default = false)
    {
        if ($this->hasRequestHeader($header)) {
            $headers = $this->getAllRequestHeaders();
            return $headers[$header];
        } else {
            return $default;
        }
    }
825509
public function askQuestion($message, $default = null)
    {
        $question = new Question($this->formatMessage($message, $default), $default);
        
        return $this->question->ask($this->input, $this->output, $question);
    }
111170
public function ask($message, $secret = false, $default = '')
    {
        $message = is_array($message) ? call_user_func_array('sprintf', $message) : $message;

        $this->send($message);
        $answer = $this->readline($secret);
        
        return $answer === '' ? $default : $answer;
    }
708038
public function getBool(string $key, bool $default = null) : bool 
    {
        if ($this->getString($key) === 'true') {
            return true;
        }

        if ($this->getString($key) === 'false') {
            return false;
        }

        return (bool) $this->get($key, $default);
    }
584214
public function confirm($text, $default = false)
    {
        $helper = $this->getHelper('question');
        //
        $question = new ConfirmationQuestion($this->console->question($text.' '), $default);
        //
        return $helper->ask($this->input, $this->output, $question);
    }
142066
protected function getWildcardCustomMessages($messages, $search, $default)
    {
        foreach ($messages as $key => $message) {
            if ($search === $key || (Str::contains($key, ['*']) && Str::is($key, $search))) {
                return $message;
            }
        }

        return $default;
    }