FormHandler/Field/PrimaryKey.pm

filter: Statementstmt 90.0% 18 / 20 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 0.0% 0 / 1 totaltotal 82.1% 23 / 28 CC 3 SCAR 9.3
CC
3
Cov
83%
BUILD
3.6
BEGIN
1.0
BEGIN
1.0
CRAP 2.5
« FormHandler/Field/Multiple.pm ↑ Summary FormHandler/Field/Duration.pm »
1 package HTML::FormHandler::Field::PrimaryKey;
2 # ABSTRACT: primary key field
3 29 $HTML::FormHandler::Field::PrimaryKey::VERSION = '0.410002';
4 29 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 29 extends 'HTML::FormHandler::Field';
6  
7  
8 29 has 'is_primary_key' => ( isa => 'Bool', is => 'ro', default => '1' );
9 29 has '+widget' => ( default => 'Hidden' );
10 29 has '+do_label' => ( default => 0 );
11 29 has '+no_value_if_empty' => ( default => 1 );
12  
13 16 ▶sub BUILD {
Subroutine BUILD: called CC=3 SCAR=12.7
Pod undocumented
14 16 my $self = shift;
15 16 ▶ if ( $self->has_parent ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->has_parent) 16 0 16
16 16 ▶ if ( $self->parent->has_primary_key ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->parent->has_primary_key) { } 0 16 16
17 0 push @{ $self->parent->primary_key }, $self;
18 }
19 else {
20 16 $self->parent->primary_key( [ $self ] );
21 }
22 }
23 }
24  
25 29 __PACKAGE__->meta->make_immutable;
26 29 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 29 1;
28  
29 __END__
« FormHandler/Field/Multiple.pm ↑ Summary FormHandler/Field/Duration.pm »