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

filter: Statementstmt 100% 22 / 22 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 96.5% 28 / 29 CC 3 SCAR 6.2
CC
3
Cov
96%
_create_field
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.9
« blib/lib/PDF/Make/Builder/Form/Field/Listbox.pm ↑ Summary blib/lib/PDF/Make/Builder/Form/Field/Combo.pm »
1 package PDF::Make::Builder::Form::Field::Radio;
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::Radio',
8 extends => 'PDF::Make::Builder::Form::Field',
9 'options:ArrayRef:default([])',
10 'spacing:Num:default(10)',
11 );
12 53 Object::Proto::import_accessors('PDF::Make::Builder::Form::Field::Radio');
13 }
14  
15 3 ▶sub _create_field {
Subroutine _create_field: called CC=3 SCAR=11.0
16 3 my ($self, $doc, $name, $fx, $fy, $fw, $fh) = @_;
17 3 my $group = PDF::Make::FieldPtr::radio_group($doc, $name);
18 3 my $opts = options $self;
19 3 my $ox = $fx;
20 3 my $sp = spacing $self;
21 3 for my $opt (@$opts) {
22 9 ▶ my $val = ref $opt ? $opt->[0] : $opt;
Branch: 1 branch
BranchTrueFalseTotal
ref $opt ? : 0 9 9
23 9 PDF::Make::FieldPtr::add_radio_option($group, $ox, $fy, $fh, $fh, $val);
24 9 $ox += $fh + $sp;
25 }
26 3 return $group;
27 }
28  
29 53 1;
30  
31 __END__
« blib/lib/PDF/Make/Builder/Form/Field/Listbox.pm ↑ Summary blib/lib/PDF/Make/Builder/Form/Field/Combo.pm »