src/Validation.php
private function errorMessages(string $field, array $errors): array {
        $messages = [];

        foreach ($errors as $error) {
            $messages[] = $this->formatErrorMessage($error + ['field' => $field]);
        }
        return $messages;
    }
private function errorMessages(string $field, array $errors): array {
        $messages = [];

        foreach ($errors as $error) {
            $messages[] = $this->formatErrorMessage($error + ['field' => $field]);
        }
        return $messages;
    }
private function errorMessages ( string $ field , array $ errors ) : array { $ messages = [ ] ; foreach ( $ errors as $ error ) { $ messages [ ] = $ this -> formatErrorMessage ( $ error + [ 'field' => $ field ] ) ; } return $ messages ; }
Format an array of error messages.

@param string $field The name of the field.
@param array $errors The errors array from a field.
@return array Returns the error array.
Format an array of error messages .