line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Label Directive for Validation Class Field Definitions |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Validation::Class::Directive::Label; |
4
|
|
|
|
|
|
|
|
5
|
109
|
|
|
109
|
|
44972
|
use strict; |
|
109
|
|
|
|
|
238
|
|
|
109
|
|
|
|
|
2889
|
|
6
|
109
|
|
|
109
|
|
537
|
use warnings; |
|
109
|
|
|
|
|
228
|
|
|
109
|
|
|
|
|
2596
|
|
7
|
|
|
|
|
|
|
|
8
|
109
|
|
|
109
|
|
500
|
use base 'Validation::Class::Directive'; |
|
109
|
|
|
|
|
186
|
|
|
109
|
|
|
|
|
8935
|
|
9
|
|
|
|
|
|
|
|
10
|
109
|
|
|
109
|
|
686
|
use Validation::Class::Util; |
|
109
|
|
|
|
|
190
|
|
|
109
|
|
|
|
|
578
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '7.900058'; # VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has 'mixin' => 0; |
16
|
|
|
|
|
|
|
has 'field' => 1; |
17
|
|
|
|
|
|
|
has 'multi' => 0; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub normalize { |
20
|
|
|
|
|
|
|
|
21
|
1009
|
|
|
1009
|
0
|
1977
|
my ($self, $proto, $field) = @_; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# static messages may contain multiline strings for the sake of |
24
|
|
|
|
|
|
|
# aesthetics, flatten them here |
25
|
|
|
|
|
|
|
|
26
|
1009
|
100
|
|
|
|
2460
|
if (defined $field->{label}) { |
27
|
|
|
|
|
|
|
|
28
|
355
|
|
|
|
|
1767
|
$field->{label} =~ s/^[\n\s\t\r]+//g; |
29
|
355
|
|
|
|
|
1298
|
$field->{label} =~ s/[\n\s\t\r]+$//g; |
30
|
355
|
|
|
|
|
1169
|
$field->{label} =~ s/[\n\s\t\r]+/ /g; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
1009
|
|
|
|
|
2145
|
return $self; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |