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

filter: Statementstmt 100% 19 / 19 Branchbran 66.6% 4 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 93.3% 28 / 30 CC 4 SCAR 9.3
CC
4
Cov
92%
_create_field
4.1
BEGIN
1.0
BEGIN
1.0
CRAP 2.5
« blib/lib/PDF/Make/Builder/Layout.pm ↑ Summary blib/lib/PDF/Make/Builder/Page.pm »
1 package PDF::Make::Builder::Form::Field::Text;
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::Text',
8 extends => 'PDF::Make::Builder::Form::Field',
9 'multiline:Bool:default(0)',
10 'password:Bool:default(0)',
11 'max_length:Int',
12 );
13 53 Object::Proto::import_accessors('PDF::Make::Builder::Form::Field::Text');
14 }
15  
16 11 ▶sub _create_field {
Subroutine _create_field: called CC=4 SCAR=14.0
17 11 my ($self, $doc, $name, $fx, $fy, $fw, $fh) = @_;
18 11 my $field = PDF::Make::FieldPtr::text($doc, $name, $fx, $fy, $fw, $fh);
19 11 ▶ $field->multiline if $self->multiline;
Branch: 1 branch
BranchTrueFalseTotal
if $self->multiline 1 10 11
20 11 ▶ $field->password if $self->password;
Branch: 1 branch
BranchTrueFalseTotal
if $self->password 0 11 11
21 11 my $ml = $self->max_length;
22 11 ▶ $field->set_max_len($ml) if defined $ml;
Branch: 1 branch
BranchTrueFalseTotal
if defined $ml 0 11 11
23 11 return $field;
24 }
25  
26 53 1;
27  
28 __END__
« blib/lib/PDF/Make/Builder/Layout.pm ↑ Summary blib/lib/PDF/Make/Builder/Page.pm »