lib/HTML/FormFu/Processor.pm

filter: Statementstmt 86.1% 31 / 36 Branchbran 50.0% 4 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 2 totaltotal 79.2% 42 / 53 CC 5 SCAR 13.9
CC
5
Cov
80%
localize_args
7.7
BEGIN
1.0
BEGIN
1.0
CRAP 4.0
« lib/HTML/FormFu/Filter/CopyValue.pm ↑ Summary lib/HTML/FormFu/Role/FormAndElementMethods.pm »
1 452 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2  
3 package HTML::FormFu::Processor;
4 452 $HTML::FormFu::Processor::VERSION = '2.09';
5 # ABSTRACT: base class for constraints
6  
7 452 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 452 ▶use MooseX::Attribute::Chained;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 452 with 'HTML::FormFu::Role::NestedHashUtils',
11 'HTML::FormFu::Role::HasParent',
12 'HTML::FormFu::Role::Populate';
13  
14 452 ▶use HTML::FormFu::Attribute qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
15 mk_output_accessors
16 mk_inherited_accessors
17 452 );
18 452 ▶use HTML::FormFu::ObjectUtil qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
19 form
20 name nested_name
21 452 nested_names parent );
22  
23 452 has type => ( is => 'rw', traits => ['Chained'] );
24  
25 452 __PACKAGE__->mk_output_accessors(qw( message ));
26  
27 452 __PACKAGE__->mk_inherited_accessors(qw( locale ));
28  
29 452 *field = \&parent;
30  
31 40 ▶sub localize_args {
Subroutine localize_args: called CC=5 SCAR=20.4
Pod undocumented
32 40 my $self = shift;
33  
34 40 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 40 40
35  
36 # user's passing their own args - save them
37 0 ▶ if ( @_ == 1 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_ == 1) { } 0 0 0
38 0 $self->{localize_args} = $_[0];
39 }
40 else {
41 0 $self->{localize_args} = [@_];
42 }
43 0 return $self;
44 }
45  
46 # if the user passed a value, use that - even if it's undef
47 40 ▶ if ( exists $self->{localize_args} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->{"localize_args"}) 0 40 40
48 0 return $self->{localize_args};
49 }
50  
51 # do we have a method to build our own args?
52 40 ▶ if ( my $method = $self->can('_localize_args') ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $method = $self->can("_localize_args")) 6 34 40
53 6 return $self->$method;
54 }
55  
56 34 return;
57 }
58  
59 53 ▶sub clone {
Subroutine clone: called CC=1 SCAR=0.0
Pod undocumented
60 53 my ($self) = @_;
61  
62 53 my %new = %$self;
63  
64 53 return bless \%new, ref $self;
65 }
66  
67 452 1;
68  
69 __END__
« lib/HTML/FormFu/Filter/CopyValue.pm ↑ Summary lib/HTML/FormFu/Role/FormAndElementMethods.pm »