line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FormValidator::Lite::Constraint::Mouse; |
2
|
4
|
|
|
4
|
|
35741
|
use strict; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
164
|
|
3
|
4
|
|
|
4
|
|
20
|
use warnings; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
119
|
|
4
|
4
|
|
|
4
|
|
1091
|
use FormValidator::Lite::Constraint; |
|
4
|
|
|
|
|
869
|
|
|
4
|
|
|
|
|
40
|
|
5
|
4
|
|
|
4
|
|
2502
|
use Mouse::Util::TypeConstraints (); |
|
4
|
|
|
|
|
49815
|
|
|
4
|
|
|
|
|
717
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my $get_constraint = \&Mouse::Util::TypeConstraints::find_type_constraint; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my @types = Mouse::Util::TypeConstraints::list_all_type_constraints(); |
12
|
|
|
|
|
|
|
for my $name (@types) { |
13
|
|
|
|
|
|
|
my $constraint = $get_constraint->($name); |
14
|
|
|
|
|
|
|
rule $name => sub { |
15
|
|
|
|
|
|
|
my $value = $_; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
$constraint->check($value) or do { |
18
|
|
|
|
|
|
|
return unless $constraint->has_coercion; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
$value = $constraint->coerce($value); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
return $constraint->check($value); |
23
|
|
|
|
|
|
|
}; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
}; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
__END__ |