format.

@param $message
@param array $references
434746
public function format($message, array $references = array())
    {
        // sort references by start indice
        // for testing issue we need to add @
        // @see https://github.com/phpspec/prophecy/issues/161
        @uasort($references, function ($a, $b) {
            return $a->getStartIndice() > $b->getStartIndice();
        });

        $messageParts = $this->buildMessageParts($message, $references);

        // build message
        $formattedMessageParts = array();

        foreach ($messageParts as $messagePart) {
            if (is_null($messagePart)) {
                continue;
            }

            $formattedMessageParts[] = $this->formatMessagePart($messagePart);
        }

        return implode($formattedMessageParts);
    }
1314932
private function updateMessages(array $messages)
    {
        $this->reset();

        foreach ($messages as $message) {
            $messageSize = strlen($message);

            $this->data['messages_size'] += $messageSize;
            $this->data['messages_count']++;

            $this->data['messages'] []= array(
                'content' => $message,
                'size' => $messageSize,
                'decoded' => unserialize($message),
            );
        }
    }
352224
public function format(string $level, string $message, array $context)
    {
        if ($this->formatter !== null)
            return $this->formatter->format($level, $message, $context);

        // Fall back to the logger placeholder filler
        return Logger::fillPlaceholders($message, $context);
    }
237768
private function formatMessage(string $message, array $params): string
    {
        $params = \array_values($params);
        \array_unshift($params, $message);
        
        return \sprintf(...$params);
    }
411676
protected function setCliMessage($message)
    {
        if (GC_CLI) {
            $this->cli->line($this->translation->text($message));
        }
    }
301804
private function formatMessage(string $defaultMessage, array $args = []): string
    {
        $message = $this->getFormatter()->formatMessage($defaultMessage, $args);

        return $message;
    }
422846
protected function renderReferences($references)
    {
        foreach ($references as $reference) {
            $this->outputLine('Rendering Reference "%s"', [$reference]);
            $this->renderReference($reference);
        }
    }
465022
public function formatProfileMessage($message)
    {
        $sqlStart = strpos($message, '(') + 1;
        $sqlEnd = strrpos($message, ')');
        $sqlLength = $sqlEnd - $sqlStart;
        $message = substr($message, $sqlStart, $sqlLength);
        $message = strtr($message, array(
            ' FROM ' => "\nFROM ",
            ' VALUES ' => "\nVALUES ",
            ' WHERE ' => "\nWHERE ",
            ' ORDER BY ' => "\nORDER BY ",
            ' GROUP BY ' => "\nGROUP BY ",
            ' LIMIT ' => "\nLIMIT ",
            ' AND ' => "\n\tAND ",
            ', ' => ",\n\t ",
        ));
        if (strpos($message, '. Bound with ') !== false) {
            list($query, $params) = explode('. Bound with ', $message);
            $binds = array();
            $matchResult = preg_match_all("/(?<key>[a-z0-9\.\_\-\:]+)=(?<value>[\d\.e\-\+]+|''|'.+?(?<!\\\)')/ims", $params, $paramsMatched, PREG_SET_ORDER);
            if ($matchResult) {
                foreach ($paramsMatched as $paramsMatch)
                    if (isset($paramsMatch['key'], $paramsMatch['value']))
                        $binds[':' . trim($paramsMatch['key'], ': ')] = trim($paramsMatch['value']);
            }
            $message = strtr($query, $binds);
        }
        return strip_tags($this->getTextHighlighter()->highlight($message), '<div>,<span>');
    }
453942
public function addMessage($message)
    {
        collect((array) $message)->each(function ($item) {
            collect($item)->flatten()->each(function ($flattened) {
                $this->messageList->push($flattened);
            });
        });
    }
1072663
protected String formatMessage(String message, Object[] parameters) {
        String formatted;
        if (printfStyle) {
            formatted = String.format(message, parameters);
        } else {
            formatted = MessageFormat.format(message, parameters);
        }
        return formatted;
    }
151929
public static function info($message, array $extras = [])
    {
        if (self::$logger) {
            self::$logger->info($message, $extras);
        }
    }
758292
protected function appendMessage(Message $message): void
    {
        $this->messages[] = $message;

        if (sizeof($this->messages) > 100) {
            array_shift($this->messages);
        }
    }
1142113
public function overwrite($messages, $newline = true, $verbosity = self::VERBOSITY_NORMAL)
    {
        if ($this->hasSupportAnsiCommands() === false || $this->isFirstMessage === true) {
            $this->write($messages, $newline, $verbosity);

            return;
        }

        $messages = implode($newline ? PHP_EOL : '', (array) $messages);
        $numNewLines = substr_count($messages, PHP_EOL);

        $this->write("\x0D", false, $verbosity);
        $this->write("\x1B[2K", false, $verbosity);

        if ($numNewLines > 0) {
            $this->write(str_repeat("\x1B[1A\x1B[2K", $this->formatLineCount), false, $verbosity);
        }

        $this->write($messages, false, $verbosity);

        if ($newline) {
            $this->write('', true, $verbosity);
        }
    }
469420
public function write(string $level, string $message, array $context)
    {
        $lvl_num = Logger::getLevelNumeric($level);
        if ($lvl_num < $this->min_level)
            return;

        $fmt = $this->format($level, $message, $context);
        $this->writeLine($fmt);
    }
725446
private String formatMessage(final String message) {
        if (null != reformatter) {
            return reformatter.reformat(context, message);
        } else {
            return message;
        }
    }
864260
protected function format($message, array $params) {
		if($fm = $this->formatParameters)
			$fm($params);

		foreach($params as $k=>$v) {
			if(is_string($v) || is_numeric($v))
				$message = str_replace(':'.$k, $v, $message);
		}
		return ucfirst($message);
	}
79238
public static function expandToTree(array $messages)
    {
        $tree = [];

        foreach ($messages as $id => $value) {
            $referenceToElement = &self::getElementByPath($tree, explode('.', $id));

            $referenceToElement = $value;

            unset($referenceToElement);
        }

        return $tree;
    }