line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FormValidator::Lite::Constraint::Mouse; |
2
|
4
|
|
|
4
|
|
24275
|
use strict; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
166
|
|
3
|
4
|
|
|
4
|
|
23
|
use warnings; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
125
|
|
4
|
4
|
|
|
4
|
|
784
|
use FormValidator::Lite::Constraint; |
|
4
|
|
|
|
|
332
|
|
|
4
|
|
|
|
|
40
|
|
5
|
4
|
|
|
4
|
|
1944
|
use Mouse::Util::TypeConstraints (); |
|
4
|
|
|
|
|
37969
|
|
|
4
|
|
|
|
|
698
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.05'; |
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__ |