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
|
109
|
|
|
109
|
|
53959
|
use strict; |
|
109
|
|
|
|
|
310
|
|
|
109
|
|
|
|
|
3105
|
|
6
|
109
|
|
|
109
|
|
610
|
use warnings; |
|
109
|
|
|
|
|
235
|
|
|
109
|
|
|
|
|
2760
|
|
7
|
|
|
|
|
|
|
|
8
|
109
|
|
|
109
|
|
573
|
use base 'Validation::Class::Directive'; |
|
109
|
|
|
|
|
241
|
|
|
109
|
|
|
|
|
10473
|
|
9
|
|
|
|
|
|
|
|
10
|
109
|
|
|
109
|
|
800
|
use Validation::Class::Util; |
|
109
|
|
|
|
|
298
|
|
|
109
|
|
|
|
|
699
|
|
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
|
2446
|
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
|
|
|
|
2815
|
if (defined $field->{error}) { |
27
|
|
|
|
|
|
|
|
28
|
185
|
|
|
|
|
696
|
$field->{error} =~ s/^[\n\s\t\r]+//g; |
29
|
185
|
|
|
|
|
672
|
$field->{error} =~ s/[\n\s\t\r]+$//g; |
30
|
185
|
|
|
|
|
948
|
$field->{error} =~ s/[\n\s\t\r]+/ /g; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
1009
|
|
|
|
|
2476
|
return $self; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |