line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Error Directive for Validation Class Field Definitions |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Validation::Class::Directive::Error; |
4
|
|
|
|
|
|
|
|
5
|
108
|
|
|
108
|
|
68443
|
use strict; |
|
108
|
|
|
|
|
289
|
|
|
108
|
|
|
|
|
2851
|
|
6
|
108
|
|
|
108
|
|
560
|
use warnings; |
|
108
|
|
|
|
|
202
|
|
|
108
|
|
|
|
|
2862
|
|
7
|
|
|
|
|
|
|
|
8
|
108
|
|
|
108
|
|
565
|
use base 'Validation::Class::Directive'; |
|
108
|
|
|
|
|
183
|
|
|
108
|
|
|
|
|
7699
|
|
9
|
|
|
|
|
|
|
|
10
|
108
|
|
|
108
|
|
622
|
use Validation::Class::Util; |
|
108
|
|
|
|
|
229
|
|
|
108
|
|
|
|
|
741
|
|
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
|
1735
|
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
|
|
|
|
2830
|
if (defined $field->{error}) { |
27
|
|
|
|
|
|
|
|
28
|
185
|
|
|
|
|
506
|
$field->{error} =~ s/^[\n\s\t\r]+//g; |
29
|
185
|
|
|
|
|
634
|
$field->{error} =~ s/[\n\s\t\r]+$//g; |
30
|
185
|
|
|
|
|
874
|
$field->{error} =~ s/[\n\s\t\r]+/ /g; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
1002
|
|
|
|
|
2926
|
return $self; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |