Add a confirmation

@param string $msg - question to ask

@static

@return bool - true if yes, false if anything else
765241
public static function confirm($msg)
    {
        echo $msg;
        $input = trim(fgets(STDIN));

        if (strtolower($input) == 'y' || strtolower($input) == 'yes') {
            return true;
        } else {
            return false;
        }
    }
1292018
public static function fromMessage(Message $msg)
    {
        $request_id = $msg->shift();
        $result     = $msg->shift() ?: '';

        return new self($request_id, $result);
    }
1371539
public function url($msg)
    {
        if(strlen(trim($this->_value)) > 0 && filter_var($this->_value, FILTER_VALIDATE_URL) === FALSE) {
            $this->_errors[] = $msg;
        }
        return $this;
    }
620893
public function ask($msg = '', $default = null)
	{
		$value = parent::ask($msg, $default);

		if (is_null($value))
		{
			return $value;
		}

		$value = strtolower($value);

		if (in_array($value, $this->trueAlias))
		{
			return true;
		}
		elseif (in_array($value, $this->falseAlias))
		{
			return false;
		}

		return $default;
	}
552286
public function confirm($text)
    {
        $helper = $this->getHelper('question');

        $question = new ConfirmationQuestion($text, false);

        return $helper->ask($this->input, $this->getOutputInterface(), $question);
    }
753211
public function append($mbox, $msg){
    if ( $this->is_connected() ){
      return @imap_append($this->stream, $this->mbParam. $mbox, $msg);
    }
    return false;
  }
490655
public function send($msg): bool
    {
        // JSON encode message if supplied in array or object form
        if (is_array($msg) || is_object($msg)) {
            $msg = json_encode($msg);
        }

        // Ensure message is a string
        $msg = (string) $msg;

        // Check the message fits within the buffer
        if (strlen($msg) > $this->buffer) {
            throw new SocketCommunicationException('Tried to send data larger than buffer size of '.$this->buffer.' bytes. Recreate channel with a larger buffer to send this data');
        }

        // Pad the message to the buffer size
        $msg = str_pad($msg, $this->buffer, ' ');

        // Write the message to the socket
        return socket_write($this->socket, $msg, $this->buffer);
    }
127977
static function message($msg)
    {
        $msg = empty($msg) ? '' : $msg;

        if(!is_string($msg)) {
            $msg = json_encode($msg);
        }

        echo $msg;

        return true;
    }
434570
public function add($id, $msg) {
        if (isset($this->errors[$id]) && !is_array($this->errors[$id]))
            $this->errors[$id] = array($msg);
        else
            $this->errors[$id][] = $msg;
    }
838534
public function alert($msg)
    {
        if (is_array($msg)) {
            $msg = join("\n", $msg);
        }

        $this->last_selector = null;

        return $this->cmd(1, array($this->typecast($msg, true)));
    }
146726
public static function log($msg){
        Timer::add(1, function() use ($msg) {
            Worker::log($msg);
        }, null, false);
    }
900495
public function confirm($questionText, $default = true)
    {
        $questionText .= ' <question>' . ($default ? '[Y/n]' : '[y/N]') . '</question> ';

        $yes = $this->input->hasOption('yes') && $this->input->getOption('yes');
        $no = $this->input->hasOption('no') && $this->input->getOption('no');
        if ($yes && !$no) {
            $this->output->writeln($questionText . 'y');
            return true;
        } elseif ($no && !$yes) {
            $this->output->writeln($questionText . 'n');
            return false;
        } elseif (!$this->input->isInteractive()) {
            $this->output->writeln($questionText . ($default ? 'y' : 'n'));
            return $default;
        }
        $question = new ConfirmationQuestion($questionText, $default);

        return $this->ask($this->input, $this->output, $question);
    }
976140
protected function confirm(string $question, string $default = 'n')
	{
		return (new Confirmation($this->input, $this->output))->ask($question, $default);
	}
1257377
public static function isRequest($msg): bool
    {
        return is_object($msg) && property_exists($msg, 'id') && isset($msg->method);
    }
227040
protected function confirm($text, $default = true)
    {
        $choices = $default ? 'Yn' : 'yN';
        $confirm = new ConfirmationQuestion("$text [$choices] ", $default);

        return $this->getHelper('question')->ask($this->input, $this->output, $confirm);
    }
915465
public function addWarning (int $type, string $msg = null) : bool
    {
        $this->_warning[] = ['type' => $type, 'msg' => $msg];

        return true;
    }
954621
public function confirm($message)
    {
        if ($this->console->option('no-question')) {
            return true;
        }

        return $this->console->confirm($message);
    }