line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
405
|
|
|
405
|
|
227878
|
use strict; |
|
405
|
|
|
|
|
967
|
|
|
405
|
|
|
|
|
20961
|
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package HTML::FormFu::Exception::Input; |
4
|
|
|
|
|
|
|
# ABSTRACT: Input exception |
5
|
|
|
|
|
|
|
$HTML::FormFu::Exception::Input::VERSION = '2.07'; |
6
|
405
|
|
|
405
|
|
2425
|
use Moose; |
|
405
|
|
|
|
|
791
|
|
|
405
|
|
|
|
|
2247
|
|
7
|
405
|
|
|
405
|
|
2636842
|
use MooseX::Attribute::Chained; |
|
405
|
|
|
|
|
1023
|
|
|
405
|
|
|
|
|
16196
|
|
8
|
|
|
|
|
|
|
extends 'HTML::FormFu::Exception'; |
9
|
|
|
|
|
|
|
|
10
|
405
|
|
|
405
|
|
3048
|
use HTML::FormFu::Attribute qw( mk_attrs ); |
|
405
|
|
|
|
|
861
|
|
|
405
|
|
|
|
|
25674
|
|
11
|
405
|
|
|
405
|
|
2812
|
use HTML::FormFu::Util qw( append_xml_attribute literal xml_escape _merge_hashes ); |
|
405
|
|
|
|
|
946
|
|
|
405
|
|
|
|
|
354705
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has processor => ( is => 'rw', traits => ['Chained'] ); |
14
|
|
|
|
|
|
|
has forced => ( is => 'rw', traits => ['Chained'] ); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
__PACKAGE__->mk_attrs(qw( attributes )); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub BUILD { |
19
|
202
|
|
|
202
|
0
|
662
|
my ( $self, $args ) = @_; |
20
|
|
|
|
|
|
|
|
21
|
202
|
|
|
|
|
1415
|
$self->attributes( {} ); |
22
|
|
|
|
|
|
|
|
23
|
202
|
|
|
|
|
6368
|
return; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub name { |
27
|
302
|
|
|
302
|
0
|
2932
|
my ($self) = @_; |
28
|
|
|
|
|
|
|
|
29
|
302
|
|
|
|
|
786
|
return $self->parent->name; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub message { |
33
|
58
|
|
|
58
|
0
|
187
|
my ( $self, $message ) = @_; |
34
|
|
|
|
|
|
|
|
35
|
58
|
50
|
|
|
|
253
|
if ( @_ > 1 ) { |
36
|
0
|
|
|
|
|
0
|
return $self->{message} = $message; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
58
|
100
|
|
|
|
251
|
return $self->{message} if defined $self->{message}; |
40
|
|
|
|
|
|
|
|
41
|
47
|
100
|
|
|
|
1544
|
return $self->processor->message if defined $self->processor->message; |
42
|
|
|
|
|
|
|
|
43
|
40
|
100
|
|
|
|
252
|
my %string = ( |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
44
|
|
|
|
|
|
|
f => defined $self->form->id ? $self->form->id : '', |
45
|
|
|
|
|
|
|
n => defined $self->name ? $self->name : '', |
46
|
|
|
|
|
|
|
t => defined $self->type ? lc( $self->type ) : '', |
47
|
|
|
|
|
|
|
s => $self->stage, |
48
|
|
|
|
|
|
|
); |
49
|
|
|
|
|
|
|
|
50
|
40
|
|
|
|
|
194
|
$string{t} =~ s/::/_/g; |
51
|
40
|
|
|
|
|
120
|
$string{t} =~ s/\+//; |
52
|
|
|
|
|
|
|
|
53
|
40
|
|
|
|
|
171
|
my $error_message = $self->parent->auto_error_message; |
54
|
|
|
|
|
|
|
|
55
|
40
|
|
|
|
|
452
|
$error_message =~ s/%([fnts])/$string{$1}/g; |
56
|
|
|
|
|
|
|
|
57
|
40
|
|
|
|
|
320
|
$error_message = $self->form->localize( $error_message, |
58
|
|
|
|
|
|
|
$self->processor->localize_args ); |
59
|
|
|
|
|
|
|
|
60
|
40
|
|
|
|
|
346
|
return $self->{message} = $error_message; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub type { |
64
|
146
|
|
|
146
|
0
|
358
|
my ($self) = @_; |
65
|
|
|
|
|
|
|
|
66
|
146
|
|
|
|
|
4715
|
return $self->processor->type; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub clone { |
70
|
1
|
|
|
1
|
0
|
3
|
my ($self) = @_; |
71
|
|
|
|
|
|
|
|
72
|
1
|
|
|
|
|
6
|
my %new = %$self; |
73
|
|
|
|
|
|
|
|
74
|
1
|
|
|
|
|
8
|
return bless \%new, ref $self; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
around render_data_non_recursive => sub { |
78
|
|
|
|
|
|
|
my ( $orig, $self, $args ) = @_; |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
my $render = $self->$orig( |
81
|
|
|
|
|
|
|
{ processor => $self->processor, |
82
|
|
|
|
|
|
|
forced => $self->forced, |
83
|
|
|
|
|
|
|
name => $self->name, |
84
|
|
|
|
|
|
|
message => $self->message, |
85
|
|
|
|
|
|
|
type => $self->type, |
86
|
|
|
|
|
|
|
$args ? %$args : (), |
87
|
|
|
|
|
|
|
} ); |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
$self->_render_attributes($render); |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
return $render; |
92
|
|
|
|
|
|
|
}; |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub _render_attributes { |
95
|
54
|
|
|
54
|
|
155
|
my ( $self, $render ) = @_; |
96
|
|
|
|
|
|
|
|
97
|
54
|
|
|
|
|
231
|
my $attrs = xml_escape( |
98
|
|
|
|
|
|
|
$self->parent->error_attributes, |
99
|
|
|
|
|
|
|
$self->attributes, |
100
|
|
|
|
|
|
|
); |
101
|
|
|
|
|
|
|
|
102
|
54
|
|
|
|
|
202
|
my $auto_error_class = $self->parent->auto_error_class; |
103
|
|
|
|
|
|
|
|
104
|
54
|
100
|
|
|
|
205
|
if ( defined $auto_error_class ) { |
105
|
2
|
100
|
|
|
|
7
|
my %string = ( |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
106
|
|
|
|
|
|
|
f => defined $self->form->id ? $self->form->id : '', |
107
|
|
|
|
|
|
|
n => defined $self->name ? $self->name : '', |
108
|
|
|
|
|
|
|
t => defined $self->type ? lc( $self->type ) : '', |
109
|
|
|
|
|
|
|
s => $self->stage, |
110
|
|
|
|
|
|
|
); |
111
|
|
|
|
|
|
|
|
112
|
2
|
|
|
|
|
9
|
$string{t} =~ s/::/_/g; |
113
|
2
|
|
|
|
|
6
|
$string{t} =~ s/\+//; |
114
|
|
|
|
|
|
|
|
115
|
2
|
|
|
|
|
18
|
$auto_error_class =~ s/%([fnts])/$string{$1}/g; |
116
|
|
|
|
|
|
|
|
117
|
2
|
|
|
|
|
9
|
append_xml_attribute( $attrs, 'class', $auto_error_class ); |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
|
120
|
54
|
|
|
|
|
173
|
$render->{attributes} = $attrs; |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
1; |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
__END__ |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=pod |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=encoding UTF-8 |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=head1 NAME |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
HTML::FormFu::Exception::Input - Input exception |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=head1 VERSION |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
version 2.07 |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=head1 AUTHOR |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
Carl Franks <cpan@fireartist.com> |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
This software is copyright (c) 2018 by Carl Franks. |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
150
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=cut |