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
|
108
|
|
|
108
|
|
68300
|
use strict; |
|
108
|
|
|
|
|
210
|
|
|
108
|
|
|
|
|
2789
|
|
6
|
108
|
|
|
108
|
|
525
|
use warnings; |
|
108
|
|
|
|
|
199
|
|
|
108
|
|
|
|
|
2869
|
|
7
|
|
|
|
|
|
|
|
8
|
108
|
|
|
108
|
|
544
|
use base 'Validation::Class::Directive'; |
|
108
|
|
|
|
|
201
|
|
|
108
|
|
|
|
|
7578
|
|
9
|
|
|
|
|
|
|
|
10
|
108
|
|
|
108
|
|
580
|
use Validation::Class::Util; |
|
108
|
|
|
|
|
230
|
|
|
108
|
|
|
|
|
718
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '7.900057'; # VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has 'mixin' => 0; |
16
|
|
|
|
|
|
|
has 'field' => 1; |
17
|
|
|
|
|
|
|
has 'multi' => 0; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub normalize { |
20
|
|
|
|
|
|
|
|
21
|
1002
|
|
|
1002
|
0
|
1718
|
my ($self, $proto, $field) = @_; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# static messages may contain multiline strings for the sake of |
24
|
|
|
|
|
|
|
# aesthetics, flatten them here |
25
|
|
|
|
|
|
|
|
26
|
1002
|
100
|
|
|
|
2899
|
if (defined $field->{label}) { |
27
|
|
|
|
|
|
|
|
28
|
355
|
|
|
|
|
1040
|
$field->{label} =~ s/^[\n\s\t\r]+//g; |
29
|
355
|
|
|
|
|
1047
|
$field->{label} =~ s/[\n\s\t\r]+$//g; |
30
|
355
|
|
|
|
|
1249
|
$field->{label} =~ s/[\n\s\t\r]+/ /g; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
1002
|
|
|
|
|
2902
|
return $self; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |