blib/lib/PDF/Make/Builder/Form/Field/Combo.pm

filter: Statementstmt 100% 19 / 19 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 100% 26 / 26 CC 3 SCAR 6.2
CC
3
Cov
100%
_create_field
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.9
« blib/lib/PDF/Make/Builder/Form/Field/Radio.pm ↑ Summary blib/lib/PDF/Make/Builder/Shape/Pie.pm »
1 package PDF::Make::Builder::Form::Field::Combo;
2 53 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 53 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 53 ▶use Object::Proto;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 53 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
7 53 Object::Proto::define('PDF::Make::Builder::Form::Field::Combo',
8 extends => 'PDF::Make::Builder::Form::Field',
9 'options:ArrayRef:default([])',
10 );
11 53 Object::Proto::import_accessors('PDF::Make::Builder::Form::Field::Combo');
12 }
13  
14 2 ▶sub _create_field {
Subroutine _create_field: called CC=3 SCAR=11.0
15 2 my ($self, $doc, $name, $fx, $fy, $fw, $fh) = @_;
16 2 my $field = PDF::Make::FieldPtr::combo($doc, $name, $fx, $fy, $fw, $fh);
17 2 my $opts = options $self;
18 2 for my $opt (@$opts) {
19 5 ▶ my ($val, $display) = ref $opt ? @$opt : ($opt, $opt);
Branch: 1 branch
BranchTrueFalseTotal
ref $opt ? : 2 3 5
20 5 $field->add_option($display, $val);
21 }
22 2 return $field;
23 }
24  
25 53 1;
26  
27 __END__
« blib/lib/PDF/Make/Builder/Form/Field/Radio.pm ↑ Summary blib/lib/PDF/Make/Builder/Shape/Pie.pm »