| 1 | package Reaction::UI::ViewPort::Field::Mutable::Array; | ||||||||||
| 2 | |||||||||||
| 3 | 4 | ▶ | use Reaction::Class; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 4 | ▶ | use namespace::clean -except => [ qw(meta) ]; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 4 | extends 'Reaction::UI::ViewPort::Field::Array'; | |||||||||
| 7 | |||||||||||
| 8 | 4 | with 'Reaction::UI::ViewPort::Field::Role::Mutable'; | |||||||||
| 9 | |||||||||||
| 10 | 0 | ▶ | around value => sub { | ||||||||
|
Subroutine
__ANON__: not called CC=4 SCAR=30.0
| |||||||||||
| 11 | 0 | my $orig = shift; | |||||||||
| 12 | 0 | my $self = shift; | |||||||||
| 13 | 0 | ▶ | return $orig->($self) unless @_; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | 0 | ▶ | my $value = defined $_[0] ? $_[0] : []; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 15 | 0 | ▶ | $orig->($self, (ref $value eq 'ARRAY' ? $value : [ $value ])); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | 4 | }; | |||||||||
| 17 | |||||||||||
| 18 | # value_string doesn't make sense in an Array field | ||||||||||
| 19 | 0 | ▶ | override _value_string_from_value => sub { shift->_empty_string_value }; | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||
| 20 | |||||||||||
| 21 | 4 | __PACKAGE__->meta->make_immutable; | |||||||||
| 22 | |||||||||||
| 23 | 4 | 1; | |||||||||
| 24 | |||||||||||