Merges default messages, global messages and individual messages.

@param array $errors

@return string[]
160581
protected function mergeMessages(array $errors): array
    {
        $errors = array_filter(call_user_func_array('array_merge', $errors));

        return $this->showValidationRules ? $errors : array_values($errors);
    }
1335695
public static function withMessages(array $messages)
    {
        return new static(tap(ValidatorFacade::make([], []), function ($validator) use ($messages) {
            foreach ($messages as $key => $value) {
                foreach (Arr::wrap($value) as $message) {
                    $validator->errors()->add($key, $message);
                }
            }
        }));
    }
599505
public static function messages($messages = [], $append = true)
    {
        if (func_num_args()) {
            static::$_messages = $append ? array_merge(static::$_messages, $messages) : $messages + ['_default_' => 'is invalid'];
        }
        return static::$_messages;
    }
405886
protected function normaliseMessages($messages, $locale)
    {
        foreach ($messages as $key => $value) {
            $messages[$key] = $this->normaliseMessage($key, $value, $locale);
        }
        return $messages;
    }
1006062
protected function renderErrorsAsMarkupList(array $errors) {
		$markup = '';
		foreach ($errors as $error) {
			$markup .= '- Error code: ' . $error->getCode() . ' - ' . $error->getMessage() . PHP_EOL;
		}
		return TRUE === empty($markup) ? '' : PHP_EOL . $markup;
	}
1260036
public function getErrorMessages() {
        $messages = array();
        
        foreach($this->entries as $entry) {
            if($entry->isError()) {
                $messages[] = $entry->getMessage();
            }
        }
        
        return $messages;
    }
897570
public static function createUsingErrors(array $errors)
    {
        $message = "An error was encountered reading an XML document:\n";

        foreach ($errors as $error) {
            switch ($error->level) {
                case LIBXML_ERR_ERROR:
                    $message .= '[Error] ';
                    break;
                case LIBXML_ERR_FATAL:
                    $message .= '[Fatal] ';
                    break;
                case LIBXML_ERR_WARNING:
                    $message .= '[Warning] ';
                    break;
            }

            $message .= sprintf(
                "[line %d] [column %d] %s in \"%s\".\n",
                $error->line,
                $error->column,
                trim($error->message),
                $error->file
            );
        }

        return new self($message);
    }
191967
private function formatDateTimeErrors(array $errors)
    {
        $formattedErrors = [];

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

        return $formattedErrors;
    }
323981
protected function mergeConfigs(array $configs)
    {
        $mergedConfig = array();
        
        foreach($configs as $config)
        {
            $mergedConfig = array_merge_recursive($mergedConfig, $config);
        }
        
        return  array($mergedConfig);
    }
1340371
private function importErrors(array $errors): void
    {
        foreach ($errors as $field => $errors) {
            foreach ($errors as $message) {
                $this->addError($message, $field);
            }
        }
    }
1281663
protected function errors(array $errors): array
    {
        $final = [];
        foreach ($errors as $errorId => $details) {
            if ($details instanceOf ParamError) {
                $final[$errorId] = $details;
            } else {
                $final[$errorId] = ParamError::fromData($errorId, $details);
            }
        }

        return [null, $final];
    }
707841
private function validateNested(array $errors): array
    {
        foreach ($this->getFields(false) as $index => $value) {
            if (isset($errors[$index])) {
                //Invalid on parent level
                continue;
            }

            if ($value instanceof FilterInterface && !$value->isValid()) {
                $errors[$index] = $value->getErrors();
                continue;
            }

            //Array of nested entities for validation
            if (is_array($value) || $value instanceof \Traversable) {
                foreach ($value as $nIndex => $nValue) {
                    if ($nValue instanceof FilterInterface && !$nValue->isValid()) {
                        $errors[$index][$nIndex] = $nValue->getErrors();
                    }
                }
            }
        }

        return $errors;
    }
803476
public static function merge(array ...$arrays): array
    {
        $res = array_shift($arrays);
        while (!empty($arrays)) {
            foreach (array_shift($arrays) as $key => $value) {
                if (is_int($key)) {
                    if (array_key_exists($key, $res)) {
                        $res[] = $value;
                    } else {
                        $res[$key] = $value;
                    }
                } elseif (
                    is_array($value)
                    && isset($res[$key])
                    && is_array($res[$key])
                ) {
                    $res[$key] = static::merge($res[$key], $value);
                } else {
                    $res[$key] = $value;
                }
            }
        }
        return $res;
    }
879295
protected function getErrorMessage(array $errors)
    {
        $error_message = '';
        foreach ($errors as $error) {
            $error_message .= $this->parseError($error) . PHP_EOL . PHP_EOL;
        }

        return $error_message;
    }
1293229
private function formatErrors($errors)
    {
        if ($errors) {
            $errors = trim($errors);

            if (in_array(substr($errors, -1), ['.', '!', '?'], true)) {
                return $errors;
            }

            return $errors.'.';
        }
    }
284096
public function getOnlyMessages()
    {
        $messages = [];
        foreach ($this->errors as $key => $row) {
            foreach ($row as $keyRow => $valueRow) {
                $messages[] = $valueRow;
            }
        }

        return $messages;
    }
429564
protected function mergeLogDefaults(array $log)
    {
        $defaults = [];
        $controls = [];
        if (!empty($this->controls)) {
            foreach ($this->controls as $control) {
                $controls[] = $control->toArray();
            }
        }
        if ($this instanceof CacheableOperationInterface) {
            $defaults['Use Cache'] = var_export($this->getUseCache(), true);
            $defaults['Execute on Cache Miss'] = var_export($this->getExecuteOnCacheMiss(), true);
            $defaults['Invalidate Cache'] = var_export($this->getInvalidateCache(), true);
        }
        $defaults['Server'] = $this->server;
        $defaults['Controls'] = var_export($controls, true);

        return array_merge($log, $defaults);
    }