line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Form::Processor::Field::Integer; |
2
|
|
|
|
|
|
|
$Form::Processor::Field::Integer::VERSION = '1.162360'; |
3
|
2
|
|
|
2
|
|
941
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
56
|
|
4
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
61
|
|
5
|
2
|
|
|
2
|
|
7
|
use base 'Form::Processor::Field::Text'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
1006
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
0
|
13
|
sub init_size {10} |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub validate { |
12
|
20
|
|
|
20
|
1
|
15
|
my $self = shift; |
13
|
|
|
|
|
|
|
|
14
|
20
|
50
|
|
|
|
35
|
return unless $self->SUPER::validate; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# remove plus sign. |
17
|
20
|
|
|
|
|
21
|
my $value = $self->input; |
18
|
20
|
100
|
|
|
|
39
|
if ( $value =~ s/^\+// ) { |
19
|
2
|
|
|
|
|
5
|
$self->input( $value ); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
20
|
100
|
|
|
|
83
|
return $self->add_error( 'Value must be an integer' ) |
23
|
|
|
|
|
|
|
unless $self->input =~ /^-?\d+$/; |
24
|
|
|
|
|
|
|
|
25
|
16
|
|
|
|
|
35
|
return 1; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# ABSTRACT: validate an integer value |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |