| 1 | package HTML::FormHandler::Widget::Field::Repeatable; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | # ABSTRACT: repeatable field widget | ||||||||||||||||||||||||||||||||||||||||||
| 3 | 28 | $HTML::FormHandler::Widget::Field::Repeatable::VERSION = '0.410002'; | |||||||||||||||||||||||||||||||||||||||||
| 4 | 28 | ▶ | use Moose::Role; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 28 | with 'HTML::FormHandler::Widget::Field::Compound'; | |||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||
| 8 | 28 | has 'wrap_repeatable_element_method' => ( | |||||||||||||||||||||||||||||||||||||||||
| 9 | traits => ['Code'], | ||||||||||||||||||||||||||||||||||||||||||
| 10 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||
| 11 | isa => 'CodeRef', | ||||||||||||||||||||||||||||||||||||||||||
| 12 | handles => { 'wrap_repeatable_element' => 'execute_method' }, | ||||||||||||||||||||||||||||||||||||||||||
| 13 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||
| 15 | 51 | ▶ | sub render_subfield { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
render_subfield: called CC=5 SCAR=18.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 16 | 51 | my ( $self, $result, $subfield ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||
| 18 | 51 | my $subresult = $result->field( $subfield->name ); | |||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||
| 20 | 51 | ▶ | return "" unless $subresult | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition16%1/6
$subresult or $self->has_flag("is_repeatable") and $subfield->name < $self->num_when_empty
$self->has_flag("is_repeatable") and $subfield->name < $self->num_when_empty
MC/DC0%0/3
$subresult or $self->has_flag("is_repeatable") and $subfield->name < $self->num_when_empty
$subresult
$self->has_flag("is_repeatable")
$subfield->name < $self->num_when_empty
Truth table25%1/4
A or B and C
A= $subresultB= $self->has_flag("is_repeatable")C= $subfield->name < $self->num_when_empty
| |||||||||||||||||||||||||||||||||||||||||||
| 21 | or ( $self->has_flag( "is_repeatable") | ||||||||||||||||||||||||||||||||||||||||||
| 22 | and $subfield->name < $self->num_when_empty | ||||||||||||||||||||||||||||||||||||||||||
| 23 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||
| 25 | 51 | my $output = $subfield->render($subresult); | |||||||||||||||||||||||||||||||||||||||||
| 26 | 51 | ▶ | if ( $self->wrap_repeatable_element_method ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 27 | 2 | $output = $self->wrap_repeatable_element($output, $subfield->name); | |||||||||||||||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||||||||||||||||
| 29 | 51 | return $output; | |||||||||||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||
| 32 | 28 | ▶ | use namespace::autoclean; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 33 | 28 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||
| 35 | __END__ | ||||||||||||||||||||||||||||||||||||||||||