| 1 | 4 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | package HTML::FormFu::Filter::CopyValue; | ||||||||||||||||||||||||||||
| 4 | 4 | $HTML::FormFu::Filter::CopyValue::VERSION = '2.09'; | |||||||||||||||||||||||||||
| 5 | # ABSTRACT: copy the value from another field | ||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 4 | ▶ | use Moose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 4 | ▶ | use MooseX::Attribute::Chained; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 4 | extends 'HTML::FormFu::Filter'; | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 4 | with 'HTML::FormFu::Role::NestedHashUtils'; | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 4 | has field => ( is => 'rw', traits => ['Chained'] ); | |||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 1 | ▶ | sub filter { | ||||||||||||||||||||||||||
|
Subroutine
filter: called CC=5 SCAR=17.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 16 | 1 | my ( $self, $value ) = @_; | |||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 1 | ▶ | return $value | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $value and length $value
MC/DC0%0/2
defined $value and length $value
defined $value
length $value
Truth table33%1/3
A and B
A= defined $valueB= length $value
| |||||||||||||||||||||||||||||
| 19 | if ( defined $value && length $value ); | ||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 1 | ▶ | my $field_name = $self->field | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 22 | or die "Parameter 'field' is not defined."; | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 1 | ▶ | my $parent = $self->parent | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 25 | or die "Can't determine my parent."; | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 1 | my $field_value | |||||||||||||||||||||||||||
| 28 | = $self->get_nested_hash_value( $parent->form->input, $field_name, ); | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 1 | return $field_value; | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 4 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 4 | 1; | |||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | __END__ | ||||||||||||||||||||||||||||