@param array $messages

@return array
775272
protected function getValidationMessagesForElements(array $messages = [])
    {
        $this->getElements()->onlyActive()->each(function ($element) use (&$messages) {
            $element = $this->getElementContainer($element);

            if ($element instanceof Validable) {
                $messages += $element->getValidationMessages();
            }
        });

        return $messages;
    }
965452
public function setMessages(Messages $messages)
    {
        return new self(
            $this->undefined,
            $this->enabled,
            $this->execute,
            $messages
        );
    }
674299
protected function getFormMessages(array $fields)
    {
        // Each message is defined by field and its own rules.
        // In our case, we need to prepend the field name (attribute)
        // using a "dot" notation. Ex.: email.required
        $messages = [];

        foreach ($fields as $field) {
            /** @var FieldTypeInterface $field */
            foreach ($field->getOption('messages') as $attr => $message) {
                $messages[$field->getName().'.'.$attr] = $message;
            }
        }

        return $messages;
    }
1135392
protected function notFound($messages = null)
	{
		$data = $this->getStatusData('not-found', $messages);
		return $this->jsonResponse($data, 404);
	}
757134
private function transformResponseMessages(array $responseMessages)
    {
        static $common = [
            'code' => 1,
        ],
        $trans = [
            'message' => 'phrase',
        ];
        $errorResponses = [];
        foreach ($responseMessages as $message) {
            $errorResponses[] = $this->transformArray($message, $common, $trans);
        }
        return $errorResponses;
    }
1297470
private function recordFilter(array $records)
    {
        $messages = [];
        foreach ($records as $record) {
            if (!isset($record['level'])) {
                continue;
            }
            if (!$this->isHandling($record)) {
                continue;
            }

            $record = $this->processRecord($record);
            $record['formatted'] = $this->getFormatter()->format($record);

            $messages[] = $record;
        }
        return $messages;
    }
720515
protected function formatMessage($message)
    {
        if (is_array($message)) {
            $message = var_export($message, true);
        } elseif (is_object($message)) {
            $message = get_object_vars($message);
        }

        return $message;
    }
956019
public function setMessages(array $messages)
    {
        $this->unsetMessages();
        foreach ($messages as $message) {
            $this->appendMessage($message);
        }

        return $this;
    }
832881
public function fillMessages(array $templates): array
    {
        $messages = [];
        foreach ($templates as $locale => $message) {
            $messages[] = $this->fillMessage($message, $locale);
        }

        return $messages;
    }
1268892
private function splitNewLines($messages)
    {
        $exploded = array_map(function ($line) {
            return explode("\n", $line);
        }, (array) $messages);
        $out = [];
        array_walk_recursive($exploded, function ($a) use (&$out) {
            $out[] = $a;
        });
        return $out;
    }
191967
private function formatDateTimeErrors(array $errors)
    {
        $formattedErrors = [];

        foreach ($errors as $pos => $message) {
            $formattedErrors[] = sprintf('at position %d: %s', $pos, $message);
        }

        return $formattedErrors;
    }
1362178
public function getMessagesArray()
    {
        $result = [];
        foreach ($this->getMessages() as $message) {
            $result[$message->getLocale()] = $message;
        }

        return $result;
    }
869926
public function errors(array $messages): string
    {
        if (!$messages) {
            return ''; // No error messages.
        }
        $messages      = $this->c::markdown($messages, ['no_p' => true]);
        return $markup = '<ul><li>'.implode('</li><li>', $messages).'</li></ul>';
    }
244999
protected function getMessages(string $type): array
    {
        $messages = [];
        $suites = $this->isSingle ? $this->suites : $this->suites[0]->suites;
        foreach ($suites as $suite) {
            $messages = array_merge($messages, array_reduce($suite->cases, function ($result, $case) use ($type) {
                return array_merge($result, array_reduce($case->$type, function ($msgs, $msg) {
                    $msgs[] = $msg['text'];

                    return $msgs;
                }, []));
            }, []));
        }

        return $messages;
    }
1187897
protected function response(array $messages = [])
    {
        $response = Response::json($messages, 200);
        $response->sendHeaders();
        $response->sendContent();
        app()->terminate();
        exit;
    }
461155
public function getFiles(array $message)
    {
        return Collection::make($message['message']['attachments'])->where('type',
            'file')->pluck('payload')->map(function ($item) {
                return new File($item['url'], $item);
            })->toArray();
    }
940502
public function messages($messages = [], $append = true)
    {
        if (func_num_args()) {
            $this->_messages = $append ? array_merge($this->_messages, $messages) : $messages;
        }
        $checker = $this->_classes['checker'];
        return $this->_messages + $checker::messages();
    }