Nested/Result/Param.pm

filter: Statementstmt 92.0% 23 / 25 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 100% 1 / 1 totaltotal 90.9% 30 / 33 CC 2 SCAR 4.1
CC
2
Cov
93%
_build_key
2.0
_build_msg
2.0
BEGIN
1.0
CRAP 1.5
« Nested/Validator/Number.pm ↑ Summary Nested/Validator/Internal.pm »
1 package FormValidator::Nested::Result::Param;
2 18 ▶use Any::Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 18 ▶use namespace::clean -except => 'meta';
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5  
6 18 has 'key' => (
7 is => 'ro',
8 isa => 'Str',
9 lazy_build => 1,
10 );
11 18 has 'validator' => (
12 is => 'ro',
13 isa => 'FormValidator::Nested::Profile::Param::Validator',
14 required => 1,
15 weak_ref => 1,
16 );
17 18 has 'has_error' => (
18 is => 'ro',
19 isa => 'Bool',
20 default => 0,
21 );
22 18 has 'msg' => (
23 is => 'ro',
24 isa => 'Str',
25 lazy_build => 1,
26 );
27 18 __PACKAGE__->meta->make_immutable;
28  
29 0 ▶sub _build_key {
Subroutine _build_key: not called CC=1 SCAR=6.9
30 0 my $self = shift;
31  
32 0 $self->validator->param->key;
33 }
34  
35 56 ▶sub _build_msg {
Subroutine _build_msg: called CC=2 SCAR=6.9
36 56 my $self = shift;
37  
38 56 my $template = '';
39 56 ▶ if ( $self->validator->options->{msg} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->validator->options->{'msg'}) { } 1 55 56
40 1 $template = $self->validator->options->{msg};
41 }
42 else {
43 55 $template = $self->validator->msg;
44 }
45  
46 my %vars = (
47 name => $self->validator->param->name,
48 56 %{$self->validator->options},
49 );
50 56 $template =~ s/\${([^}]*)}/$vars{$1}/g;
51  
52 56 return $template;
53 }
54  
55 342 ▶sub BUILD {
Subroutine BUILD: called CC=1 SCAR=0.0
Pod documented
56 342 my $self = shift;
57  
58 342 $self->key;
59 }
60  
61 18 1;
62  
« Nested/Validator/Number.pm ↑ Summary Nested/Validator/Internal.pm »