line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::FormFu::Exception::Input; |
2
|
|
|
|
|
|
|
|
3
|
401
|
|
|
401
|
|
169611
|
use strict; |
|
401
|
|
|
|
|
572
|
|
|
401
|
|
|
|
|
14817
|
|
4
|
|
|
|
|
|
|
our $VERSION = '2.05'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
401
|
|
|
401
|
|
1388
|
use Moose; |
|
401
|
|
|
|
|
462
|
|
|
401
|
|
|
|
|
1716
|
|
7
|
401
|
|
|
401
|
|
1600634
|
use MooseX::Attribute::FormFuChained; |
|
401
|
|
|
|
|
580
|
|
|
401
|
|
|
|
|
12381
|
|
8
|
|
|
|
|
|
|
extends 'HTML::FormFu::Exception'; |
9
|
|
|
|
|
|
|
|
10
|
401
|
|
|
401
|
|
2024
|
use HTML::FormFu::Attribute qw( mk_attrs ); |
|
401
|
|
|
|
|
487
|
|
|
401
|
|
|
|
|
19416
|
|
11
|
401
|
|
|
401
|
|
1574
|
use HTML::FormFu::Util qw( append_xml_attribute literal xml_escape ); |
|
401
|
|
|
|
|
501
|
|
|
401
|
|
|
|
|
254780
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has processor => ( is => 'rw', traits => ['FormFuChained'] ); |
14
|
|
|
|
|
|
|
has forced => ( is => 'rw', traits => ['FormFuChained'] ); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
__PACKAGE__->mk_attrs(qw( attributes )); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub BUILD { |
19
|
200
|
|
|
200
|
0
|
299
|
my ( $self, $args ) = @_; |
20
|
|
|
|
|
|
|
|
21
|
200
|
|
|
|
|
1303
|
$self->attributes({}); |
22
|
|
|
|
|
|
|
|
23
|
200
|
|
|
|
|
5115
|
return; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub name { |
27
|
291
|
|
|
291
|
0
|
1952
|
my ($self) = @_; |
28
|
|
|
|
|
|
|
|
29
|
291
|
|
|
|
|
621
|
return $self->parent->name; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub message { |
33
|
51
|
|
|
51
|
0
|
76
|
my ( $self, $message ) = @_; |
34
|
|
|
|
|
|
|
|
35
|
51
|
50
|
|
|
|
155
|
if ( @_ > 1 ) { |
36
|
0
|
|
|
|
|
0
|
return $self->{message} = $message; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
51
|
100
|
|
|
|
151
|
return $self->{message} if defined $self->{message}; |
40
|
|
|
|
|
|
|
|
41
|
41
|
100
|
|
|
|
1085
|
return $self->processor->message if defined $self->processor->message; |
42
|
|
|
|
|
|
|
|
43
|
38
|
100
|
|
|
|
248
|
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
|
38
|
|
|
|
|
127
|
$string{t} =~ s/::/_/g; |
51
|
38
|
|
|
|
|
83
|
$string{t} =~ s/\+//; |
52
|
|
|
|
|
|
|
|
53
|
38
|
|
|
|
|
114
|
my $error_message = $self->parent->auto_error_message; |
54
|
|
|
|
|
|
|
|
55
|
38
|
|
|
|
|
320
|
$error_message =~ s/%([fnts])/$string{$1}/g; |
56
|
|
|
|
|
|
|
|
57
|
38
|
|
|
|
|
150
|
$error_message = $self->form->localize( $error_message, |
58
|
|
|
|
|
|
|
$self->processor->localize_args ); |
59
|
|
|
|
|
|
|
|
60
|
38
|
|
|
|
|
285
|
return $self->{message} = $error_message; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub type { |
64
|
136
|
|
|
136
|
0
|
174
|
my ($self) = @_; |
65
|
|
|
|
|
|
|
|
66
|
136
|
|
|
|
|
3444
|
return $self->processor->type; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub clone { |
70
|
1
|
|
|
1
|
0
|
2
|
my ($self) = @_; |
71
|
|
|
|
|
|
|
|
72
|
1
|
|
|
|
|
4
|
my %new = %$self; |
73
|
|
|
|
|
|
|
|
74
|
1
|
|
|
|
|
7
|
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
|
47
|
|
|
47
|
|
69
|
my ( $self, $render ) = @_; |
96
|
|
|
|
|
|
|
|
97
|
47
|
|
|
|
|
181
|
my $attrs = xml_escape( $self->attributes ); |
98
|
|
|
|
|
|
|
|
99
|
47
|
|
|
|
|
129
|
my $auto_error_class = $self->parent->auto_error_class; |
100
|
|
|
|
|
|
|
|
101
|
47
|
100
|
|
|
|
139
|
if ( defined $auto_error_class ) { |
102
|
2
|
100
|
|
|
|
8
|
my %string = ( |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
103
|
|
|
|
|
|
|
f => defined $self->form->id ? $self->form->id : '', |
104
|
|
|
|
|
|
|
n => defined $self->name ? $self->name : '', |
105
|
|
|
|
|
|
|
t => defined $self->type ? lc( $self->type ) : '', |
106
|
|
|
|
|
|
|
s => $self->stage, |
107
|
|
|
|
|
|
|
); |
108
|
|
|
|
|
|
|
|
109
|
2
|
|
|
|
|
6
|
$string{t} =~ s/::/_/g; |
110
|
2
|
|
|
|
|
4
|
$string{t} =~ s/\+//; |
111
|
|
|
|
|
|
|
|
112
|
2
|
|
|
|
|
14
|
$auto_error_class =~ s/%([fnts])/$string{$1}/g; |
113
|
|
|
|
|
|
|
|
114
|
2
|
|
|
|
|
8
|
append_xml_attribute( $attrs, 'class', $auto_error_class ); |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
|
117
|
47
|
|
|
|
|
94
|
$render->{attributes} = $attrs; |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
1; |