Overtrue\Validation\MessageBag::transform PHP Метод

transform() защищенный Метод

Format an array of messages.
protected transform ( array $messages, string $format, string $messageKey ) : array
$messages array
$format string
$messageKey string
Результат array
    protected function transform($messages, $format, $messageKey)
    {
        $messages = (array) $messages;
        // We will simply spin through the given messages and transform each one
        // replacing the :message place holder with the real message allowing
        // the messages to be easily formatted to each developer's desires.
        foreach ($messages as $key => &$message) {
            $replace = [':message', ':key'];
            $message = str_replace($replace, [$message, $messageKey], $format);
        }
        return $messages;
    }