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
|
|
53393
|
use strict; |
|
109
|
|
|
|
|
294
|
|
|
109
|
|
|
|
|
3345
|
|
6
|
109
|
|
|
109
|
|
660
|
use warnings; |
|
109
|
|
|
|
|
278
|
|
|
109
|
|
|
|
|
3002
|
|
7
|
|
|
|
|
|
|
|
8
|
109
|
|
|
109
|
|
623
|
use base 'Validation::Class::Directive'; |
|
109
|
|
|
|
|
296
|
|
|
109
|
|
|
|
|
10330
|
|
9
|
|
|
|
|
|
|
|
10
|
109
|
|
|
109
|
|
764
|
use Validation::Class::Util; |
|
109
|
|
|
|
|
276
|
|
|
109
|
|
|
|
|
681
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '7.900059'; # VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has 'mixin' => 0; |
16
|
|
|
|
|
|
|
has 'field' => 1; |
17
|
|
|
|
|
|
|
has 'multi' => 0; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub normalize { |
20
|
|
|
|
|
|
|
|
21
|
1009
|
|
|
1009
|
0
|
2397
|
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
|
|
|
|
3024
|
if (defined $field->{label}) { |
27
|
|
|
|
|
|
|
|
28
|
355
|
|
|
|
|
1563
|
$field->{label} =~ s/^[\n\s\t\r]+//g; |
29
|
355
|
|
|
|
|
1267
|
$field->{label} =~ s/[\n\s\t\r]+$//g; |
30
|
355
|
|
|
|
|
1331
|
$field->{label} =~ s/[\n\s\t\r]+/ /g; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
1009
|
|
|
|
|
2565
|
return $self; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |