line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Class::Business::DK::FI; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
87144
|
use strict; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
114
|
|
4
|
4
|
|
|
4
|
|
14
|
use warnings; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
126
|
|
5
|
4
|
|
|
4
|
|
2215
|
use Class::InsideOut qw( private register id ); |
|
4
|
|
|
|
|
26462
|
|
|
4
|
|
|
|
|
27
|
|
6
|
4
|
|
|
4
|
|
484
|
use Carp qw(croak); |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
169
|
|
7
|
4
|
|
|
4
|
|
1082
|
use English qw(-no_match_vars); |
|
4
|
|
|
|
|
8806
|
|
|
4
|
|
|
|
|
25
|
|
8
|
4
|
|
|
4
|
|
4687
|
use Try::Tiny; |
|
4
|
|
|
|
|
7161
|
|
|
4
|
|
|
|
|
285
|
|
9
|
|
|
|
|
|
|
|
10
|
4
|
|
|
4
|
|
2161
|
use Business::DK::FI qw(validateFI); |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
1430
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.09'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
private number => my %number; # read-only accessor: number() |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub new { |
17
|
6
|
|
|
6
|
1
|
161
|
my ( $class, $number ) = @_; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
## no critic (Variables::ProhibitUnusedVariables) |
20
|
6
|
|
|
|
|
22
|
my $self = \( my $scalar ); |
21
|
|
|
|
|
|
|
|
22
|
6
|
|
|
|
|
18
|
bless $self, $class; |
23
|
|
|
|
|
|
|
|
24
|
6
|
|
|
|
|
52
|
register($self); |
25
|
|
|
|
|
|
|
|
26
|
6
|
100
|
|
|
|
217
|
if ($number) { |
27
|
5
|
|
|
|
|
25
|
$self->set_number($number); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
else { |
30
|
1
|
|
|
|
|
23
|
croak 'You must provide a FI number'; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
4
|
|
|
|
|
29
|
return $self; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
## no critic (Subroutines::RequireFinalReturn) |
37
|
1
|
|
|
1
|
1
|
27
|
sub number { $number{ id $_[0] } } |
38
|
|
|
|
|
|
|
|
39
|
1
|
|
|
1
|
1
|
15
|
sub get_number { $number{ id $_[0] } } |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub set_number { |
42
|
8
|
|
|
8
|
1
|
96
|
my ( $self, $unvalidated_fi ) = @_; |
43
|
|
|
|
|
|
|
|
44
|
8
|
|
|
|
|
14
|
my $rv = 0; |
45
|
|
|
|
|
|
|
|
46
|
8
|
100
|
|
|
|
27
|
if ($unvalidated_fi) { |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
try { |
49
|
7
|
|
|
7
|
|
592
|
$rv = validateFI($unvalidated_fi); |
50
|
|
|
|
|
|
|
|
51
|
5
|
50
|
|
|
|
30
|
if ( $rv == 0 ) { |
52
|
0
|
|
|
|
|
0
|
croak; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
catch { |
56
|
2
|
|
|
2
|
|
2153
|
croak 'Invalid FI number parameter'; |
57
|
7
|
|
|
|
|
95
|
}; |
58
|
|
|
|
|
|
|
|
59
|
5
|
|
|
|
|
175
|
$number{ id $self } = $unvalidated_fi; |
60
|
|
|
|
|
|
|
|
61
|
5
|
|
|
|
|
24
|
return $rv; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
else { |
65
|
1
|
|
|
|
|
32
|
croak 'You must provide a FI number'; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
__END__ |