| 1 | package Reaction::UI::WidgetClass::_OVER; | ||||||||||||||||||||||||||||||||||||||||||
| 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 | |||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||
| 8 | 4 | has 'collection' => (is => 'ro', required => 1); | |||||||||||||||||||||||||||||||||||||||||
| 9 | 20 | ▶ | sub BUILD { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BUILD: called CC=4 SCAR=19.7
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 10 | 20 | my ($self, $args) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 11 | 20 | my $coll = $args->{collection}; | |||||||||||||||||||||||||||||||||||||||||
| 12 | 20 | ▶ | unless (ref $coll eq 'ARRAY' || (blessed($coll) && $coll->can('next'))) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition16%1/6
ref $coll eq "ARRAY" or builtin::blessed($coll) and $coll->can("next")
builtin::blessed($coll) and $coll->can("next")
MC/DC0%0/3
ref $coll eq "ARRAY" or builtin::blessed($coll) and $coll->can("next")
ref $coll eq "ARRAY"
builtin::blessed($coll)
$coll->can("next")
Truth table25%1/4
A or B and C
A= ref $coll eq "ARRAY"B= builtin::blessed($coll)C= $coll->can("next")
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | 0 | confess _OVER."->new collection arg ${coll} is neither" | |||||||||||||||||||||||||||||||||||||||||
| 14 | ." arrayref nor implements next()"; | ||||||||||||||||||||||||||||||||||||||||||
| 15 | } | ||||||||||||||||||||||||||||||||||||||||||
| 16 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 17 | 20 | ▶ | sub each { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
each: called CC=5 SCAR=22.7
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | 20 | my ($self, $do) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 19 | 20 | my $coll = $self->collection; | |||||||||||||||||||||||||||||||||||||||||
| 20 | 20 | ▶ | if (ref $coll eq 'ARRAY') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 21 | 20 | foreach my $el (@$coll) { | |||||||||||||||||||||||||||||||||||||||||
| 22 | 319 | $do->($el); | |||||||||||||||||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||||||||||||||||
| 24 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 25 | 0 | ▶ | $coll->reset if $coll->can('reset'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | ▶ | while (my $el = $coll->next) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | $do->($el); | |||||||||||||||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||||||||||||||||
| 30 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 31 | 4 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||
| 34 | 4 | 1; | |||||||||||||||||||||||||||||||||||||||||