A wrapper around symfony's formatter helper to output a block.

@param string|array $messages Messages to output
@param string       $type     The type of message to output
503895
public function block($messages, $type = 'error')
    {
        $output = [];
        if (!is_array($messages)) {
            $messages = (array) $messages;
        }
        foreach ($messages as $message) {
            $output[] = trim($message);
        }
        $formatter = new FormatterHelper();
        $this->line($formatter->formatBlock($output, $type, true));
    }
154974
public function write($message, $newline = false, $type = 0)
    {
        $messages = (array) $message;

        if ($this->getLogger()) {
            foreach ($messages as $message) {
                $this->getLogger()->info($this->getFormatter()->format(strip_tags($message)));
            }
        }

        parent::write($messages, $newline, $type);
    }
728073
public function wrapMessages($messages, $type)
    {
        $type = ($type == 'success') ? 'green' : $type;
        $type = ($type == 'info') ? 'blue' : $type;
        $type = ($type == 'warning') ? 'orange' : $type;
        $type = ($type == 'error') ? 'red' : $type;

        return sprintf($this->getWrapper(), $type, $type, $type, $messages);
    }
183508
protected function bufferize($types = [])
    {
        while (true) {
            $this->buffer = $this->findNextMessages($types);

            if (\count($this->buffer) > 0) {
                break;
            }

            usleep($this->pause);
        }
    }
310974
function show_message($message, $type = 'notice', $vars = null, $override = true, $timeout = 0)
    {
        if ($this->app->text_exists($message)) {
            $message = $this->app->gettext(array('name' => $message, 'vars' => $vars));
        }

        printf("[%s] %s\n", strtoupper($type), $message);
    }
983205
protected function formatMessages($messages, $format, $type = '')
    {

        if ($format === self::Format_Array) {
            $result = $messages;
        } else {
            $result = array();
            foreach ($messages as $message) {
                if (is_array($message)) {
                    $messagePart = "{$message['code']}: ";
                    $messagePart .= $this->t($message['message']);
                    if ($message['codetag']) {
                        $messagePart .= " ({$message['codetag']})";
                    }
                    $message = $this->t($type) . ' ' . $messagePart;
                }
                if ($format === self::Format_FormattedText) {
                    $message = "* $message\n\n";
                } elseif ($format === self::Format_Html) {
                    $message = "<li>" . nl2br(htmlspecialchars($message, ENT_NOQUOTES)) . "</li>\n";
                }
                $result[] = $message;
            }
            if ($format === self::Format_FormattedText) {
                $result = implode('', $result);
            } elseif ($format === self::Format_Html) {
                $result = "<ul>\n" . implode('', $result) . "</ul>\n";
            }
        }
        return $result;
    }
866303
public function setOutputType($type)
    {
        if (preg_match('/(png|gif|jpe?g|tif?f|webp)/i', $type)) {
            $this->outputType = sprintf('image/%s', strtolower($type));
            return;
        } else {
            throw new \InvalidArgumentException(sprintf('Invalid output format %s', $type));
        }
    }
310623
public function addMessage($messages, $type = null)
    {
        switch ($type) {
            case 'success':
            case 'green':
                $tag = '<info>%s</info>';
                break;

            case 'warning':
            case 'yellow':
                $tag = '<comment>%s</comment>';
                break;

            case 'info':
            case 'blue':
                $tag = '<option>%s</option>';
                break;

            case 'error':
            case 'danger':
            case 'red':
                $tag = '<error>%s</error>';
                break;

            default:
                $tag = '%s';
                break;
        }

        foreach ((array) $messages as $message) {
            $time = gmdate('Y-m-d H:i:s');

            $this->out(sprintf('[%s] ' . $tag, $time, $message));
        }

        return $this;
    }
552735
protected function outputBlock(array $aLines, string $sType): void
    {
        $aLengths   = array_map('strlen', $aLines);
        $iMaxLength = max($aLengths);

        $this->oOutput->writeln('<' . $sType . '> ' . str_pad('', $iMaxLength, ' ') . ' </' . $sType . '>');
        foreach ($aLines as $sLine) {
            $this->oOutput->writeln('<' . $sType . '> ' . str_pad($sLine, $iMaxLength, ' ') . ' </' . $sType . '>');
        }
        $this->oOutput->writeln('<' . $sType . '> ' . str_pad('', $iMaxLength, ' ') . ' </' . $sType . '>');
    }
411036
public function output(string $type, string $style, string $message, $status = true)
    {
        $text = '....';

        if ($status === true) {
            $text .= '<success>OK</>';
        } elseif ($status === false) {
            $text = '';
        } else {
            $text .= "<info>{$status}</>";
        }

        $type = "<{$style}>{$type}</>";

        $this->output->writeln(
            sprintf(
                '%s: %s %s',
                $type,
                $message,
                $text
            )
        );
    }
558669
public function message($message, $type = 'line')
    {
        if (! is_null($this->command)) {
            $this->command->{$type}($message);
        }
    }
687671
protected function write($message, array $record = array())
    {
        $record = array_merge($this->defautlRecord, $record);
        $record['msg'] = $message;
        $this->output->writeln($this->formatter->format($record));
    }
599375
public function write($messages, $newline = false, $type = self::OUTPUT_NORMAL) {
        $this->handle->write($messages, $newline, $type);
    }
696620
public function setMessage($message, $type = 'info', $key = 'messages')
    {
        if ($message !== '') {

            $messages = (array) $this->get("$key.$type", array());

            if (!in_array($message, $messages)) {
                $messages[] = $message;
                $this->set("$key.$type", $messages);
            }
        }
    }
285748
public function add($message, $type)
    {
        $this->messages[$type][] = $message;

        $this->getSessionBag()->set($type, $this->messages[$type]);
    }
51034
public function setMessage($type, $message) {
		if (!$this->session->has('flashmsgs')) {
			$this->session->set('flashmsgs', array());
		}
		$temp = $this->session->get('flashmsgs');
		$temp[] = array('type' => $type, 'content' => $message);
		$this->session->set('flashmsgs', $temp);
	}
1321385
public function write($message, $newLine = false, $formatType = self::OUTPUT_NORMAL) {
        if ($formatType === self::OUTPUT_NORMAL) {
            $message = $this->getFormatter()->format($message);
        }

        if ($newLine) {
            $message .= \PHP_EOL;
        }
        return \fwrite($this->stream, $message);
    }