| 1 | 6 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | package HTML::FormFu::Transformer; | ||||||||||||||||||||||||||||
| 4 | 6 | $HTML::FormFu::Transformer::VERSION = '2.09'; | |||||||||||||||||||||||||||
| 5 | # ABSTRACT: Transformer Base Class | ||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 6 | ▶ | use Moose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 6 | extends 'HTML::FormFu::Processor'; | |||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 6 | ▶ | use HTML::FormFu::Exception::Transformer; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 6 | ▶ | use Scalar::Util qw( blessed ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 5 | ▶ | sub process { | ||||||||||||||||||||||||||
|
Subroutine
process: called CC=5 SCAR=16.5
Pod
undocumented
| |||||||||||||||||||||||||||||
| 14 | 5 | my ( $self, $values, $params ) = @_; | |||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 5 | my $return; | |||||||||||||||||||||||||||
| 17 | my @errors; | ||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 5 | ▶ | if ( ref $values eq 'ARRAY' ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 20 | 2 | my @return; | |||||||||||||||||||||||||||
| 21 | 2 | for my $value (@$values) { | |||||||||||||||||||||||||||
| 22 | 6 | my ($return) = eval { $self->transformer( $value, $params ) }; | |||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 6 | ▶ | if ($@) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 25 | 0 | push @errors, $self->return_error($@); | |||||||||||||||||||||||||||
| 26 | 0 | push @return, undef; | |||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | else { | ||||||||||||||||||||||||||||
| 29 | 6 | push @return, $return; | |||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | 2 | $return = \@return; | |||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||
| 34 | else { | ||||||||||||||||||||||||||||
| 35 | 3 | ($return) = eval { $self->transformer( $values, $params ) }; | |||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 3 | ▶ | if ($@) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 38 | 0 | push @errors, $self->return_error($@); | |||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | 5 | $self->set_nested_hash_value( $params, $self->nested_name, $return ); | |||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 5 | return (@errors); | |||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | 0 | ▶ | sub return_error { | ||||||||||||||||||||||||||
|
Subroutine
return_error: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 48 | 0 | my ( $self, $err ) = @_; | |||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 0 | ▶ | if ( !blessed $err || !$err->isa('HTML::FormFu::Exception::Transformer') ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
builtin::blessed($err) and $err->isa("HTML::FormFu::Exception::Transformer")
MC/DC0%0/2
builtin::blessed($err) and $err->isa("HTML::FormFu::Exception::Transformer")
builtin::blessed($err)
$err->isa("HTML::FormFu::Exception::Transformer")
Truth table0%0/3
A and B
A= builtin::blessed($err)B= $err->isa("HTML::FormFu::Exception::Transformer")
| |||||||||||||||||||||||||||||
| 51 | 0 | $err = HTML::FormFu::Exception::Transformer->new; | |||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | 0 | return $err; | |||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | 6 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | 6 | 1; | |||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | __END__ | ||||||||||||||||||||||||||||