line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use strict; |
3
|
2
|
|
|
2
|
|
1204
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
52
|
|
4
|
2
|
|
|
2
|
|
9
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
40
|
|
5
|
|
|
|
|
|
|
use Moo; |
6
|
2
|
|
|
2
|
|
8
|
use utf8; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
10
|
|
7
|
2
|
|
|
2
|
|
557
|
use Scalar::Util qw(looks_like_number); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
9
|
|
8
|
2
|
|
|
2
|
|
54
|
use namespace::clean; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
86
|
|
9
|
2
|
|
|
2
|
|
10
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
9
|
|
10
|
|
|
|
|
|
|
with 'Dancer2::Plugin::FormValidator::Role::Validator'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
return { |
13
|
|
|
|
|
|
|
en => '%s must be at least %d', |
14
|
|
|
|
|
|
|
ru => '%s должно быть не меньше %d', |
15
|
1
|
|
|
1
|
0
|
1243
|
de => '%s muss größer als %d sein', |
16
|
|
|
|
|
|
|
}; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
my ($self, $field, $input, $min) = @_; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
if ($self->_field_defined_and_non_empty($field, $input)) { |
22
|
2
|
|
|
2
|
0
|
8
|
my $maybe_num = $input->{$field}; |
23
|
|
|
|
|
|
|
|
24
|
2
|
50
|
|
|
|
8
|
if (looks_like_number($maybe_num)) { |
25
|
2
|
|
|
|
|
4
|
return $maybe_num >= $min; |
26
|
|
|
|
|
|
|
} |
27
|
2
|
50
|
|
|
|
21
|
else { |
28
|
2
|
|
|
|
|
12
|
return 0; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
} |
31
|
0
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
return 1; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
1; |