| 1 | 77 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | package HTML::FormFu::Role::Element::ProcessOptionsFromModel; | ||||||||||||||||||||||||||||
| 4 | # ABSTRACT: process_options_from_model role | ||||||||||||||||||||||||||||
| 5 | 77 | $HTML::FormFu::Role::Element::ProcessOptionsFromModel::VERSION = '2.09'; | |||||||||||||||||||||||||||
| 6 | 77 | ▶ | use Moose::Role; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 288 | ▶ | sub _process_options_from_model { | ||||||||||||||||||||||||||
|
Subroutine
_process_options_from_model: called CC=6 SCAR=30.5
| |||||||||||||||||||||||||||||
| 9 | 288 | my ($self) = @_; | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 288 | my $args = $self->model_config; | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 288 | ▶ | return if !$args || !keys %$args; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$args and keys %$args
MC/DC0%0/2
$args and keys %$args
$args
keys %$args
Truth table33%1/3
A and B
A= $argsB= keys %$args
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 0 | ▶ | return if @{ $self->options }; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | # don't run if {options_from_model} is set and is 0 | ||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | my $option_flag | ||||||||||||||||||||||||||||
| 20 | = exists $args->{options_from_model} | ||||||||||||||||||||||||||||
| 21 | ? $args->{options_from_model} | ||||||||||||||||||||||||||||
| 22 | 0 | ▶ | : 1; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 0 | ▶ | return if !$option_flag; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 0 | $self->options( | |||||||||||||||||||||||||||
| 27 | [ $self->form->model->options_from_model( $self, $args ) ] ); | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 0 | return; | |||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 77 | 1; | |||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | __END__ | ||||||||||||||||||||||||||||