line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Params::Profile::Params_Check; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
10
|
use strict; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
69
|
|
4
|
3
|
|
|
3
|
|
1401
|
use Params::Check; |
|
3
|
|
|
|
|
8654
|
|
|
3
|
|
|
|
|
474
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = $Params::Profile::VERSION; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Params::Profile::Params_Check - Backend module for Params::Profile |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 SYNOPSIS |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
See C |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 DESCRIPTION |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
C methods for C |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=cut |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
### params = HASHREF, profiles = ARRAYREF |
23
|
|
|
|
|
|
|
sub validate { |
24
|
0
|
|
|
0
|
0
|
0
|
my ($self, $params, %profile) = @_; |
25
|
0
|
|
|
|
|
0
|
Params::Check::check(\%profile, $params); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub _merge_profiles { |
29
|
3
|
|
|
3
|
|
3
|
my ($self, @profiles) = @_; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
### Insert first profile in (tobe) merged_profile |
32
|
3
|
|
|
|
|
2
|
my $merged_profile = shift(@profiles); |
33
|
3
|
|
|
|
|
5
|
foreach my $profile (@profiles) { |
34
|
0
|
|
|
|
|
0
|
foreach my $key (keys %{$profile}) { |
|
0
|
|
|
|
|
0
|
|
35
|
0
|
|
|
|
|
0
|
$merged_profile->{$key} = $profile->{$key}; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
3
|
|
|
|
|
12
|
return $merged_profile; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub get_profile { |
43
|
3
|
|
|
3
|
0
|
4
|
my ($self, $params, @profiles) = @_; |
44
|
3
|
|
|
|
|
6
|
return $self->_merge_profiles(@profiles); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub check { |
48
|
1
|
|
|
1
|
0
|
3
|
my ($self, $params, %profile) = @_; |
49
|
1
|
|
|
|
|
2
|
Params::Check::check(\%profile, $params); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
__END__ |