lib/HTML/FormFu/Filter.pm

filter: Statementstmt 94.1% 32 / 34 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 2 totaltotal 88.8% 40 / 45 CC 2 SCAR 2.4
CC
2
Cov
92%
process
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« lib/HTML/FormFu/Filter/Callback.pm ↑ Summary lib/HTML/FormFu/OutputProcessor.pm »
1 426 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2  
3 package HTML::FormFu::Filter;
4 426 $HTML::FormFu::Filter::VERSION = '2.09';
5 # ABSTRACT: Filter Base Class
6  
7 426 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 426 ▶use MooseX::Attribute::Chained;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 426 with 'HTML::FormFu::Role::NestedHashUtils',
11 'HTML::FormFu::Role::HasParent',
12 'HTML::FormFu::Role::Populate';
13  
14 426 ▶use HTML::FormFu::Attribute qw( mk_inherited_accessors );
Subroutine BEGIN: called CC=1 SCAR=0.0
15 426 ▶use HTML::FormFu::ObjectUtil qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
16 426 form name parent nested_name nested_names );
17  
18 426 has type => ( is => 'rw', traits => ['Chained'] );
19  
20 426 has localize_args => ( is => 'rw', traits => ['Chained'] );
21  
22 56 ▶sub process {
Subroutine process: called CC=2 SCAR=7.2
Pod undocumented
23 56 my ( $self, $result, $params ) = @_;
24  
25 56 my $name = $self->nested_name;
26 56 my $value = $self->get_nested_hash_value( $params, $name );
27  
28 56 my $filtered;
29  
30 56 ▶ if ( ref $value eq 'ARRAY' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $value eq 'ARRAY') { } 0 56 56
31 0 $filtered = [ map { $self->filter( $_, $params ) } @$value ];
32 }
33 else {
34 56 $filtered = $self->filter( $value, $params );
35 }
36  
37 56 $self->set_nested_hash_value( $params, $name, $filtered );
38  
39 56 return;
40 }
41  
42 6 ▶sub clone {
Subroutine clone: called CC=1 SCAR=0.0
Pod undocumented
43 6 my ($self) = @_;
44  
45 6 my %new = %$self;
46  
47 6 return bless \%new, ref $self;
48 }
49  
50 426 __PACKAGE__->meta->make_immutable;
51  
52 426 1;
53  
54 __END__
« lib/HTML/FormFu/Filter/Callback.pm ↑ Summary lib/HTML/FormFu/OutputProcessor.pm »