Nested.pm

filter: Statementstmt 100% 24 / 24 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 96.8% 31 / 32 CC 2 SCAR 2.9
CC
2
Cov
100%
validate
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Nested/Validator/NotBlank.pm ↑ Summary Nested/FilterInvalid.pm »
1 package FormValidator::Nested;
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 18 our $VERSION = '0.07';
5  
6 18 ▶use FormValidator::Nested::ProfileProvider;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 18 ▶use FormValidator::Nested::Messages::ja;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 18 our $MESSAGES = $FormValidator::Nested::Messages::ja::MESSAGES;
10  
11 18 has 'profile_provider' => (
12 is => 'ro',
13 isa => 'FormValidator::Nested::ProfileProvider',
14 required => 1,
15 handles => [qw/get_profile/],
16 );
17 18 __PACKAGE__->meta->make_immutable;
18  
19 119 ▶sub validate {
Subroutine validate: called CC=2 SCAR=6.9
Pod undocumented
20 119 my $self = shift;
21 119 my $req = shift;
22 119 my $profile_key = shift;
23  
24  
25 119 my $profile = $self->get_profile($profile_key);
26 119 ▶ if ( !$profile ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($profile) 1 118 119
27 1 die("not found profile " . $profile_key);
28 }
29 118 return $profile->validate($req);
30 }
31  
32 18 1;
33 __END__
« Nested/Validator/NotBlank.pm ↑ Summary Nested/FilterInvalid.pm »