| 1 | package Class::MixinFactory::NEXT; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 8 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | ######################################################################## | ||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 116 | ▶ | sub NEXT { | ||||||||||||||||||
|
Subroutine
NEXT: called CC=6 SCAR=18.3
Pod
undocumented
| |||||||||||||||||||||
| 8 | 116 | my ( $self, $method, @args ) = @_; | |||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 116 | my $package = caller(); | |||||||||||||||||||
| 11 | 116 | ▶ | my @classes = ref($self) || $self; | ||||||||||||||||||
|
Condition33%1/3
ref $self || $self
MC/DC0%0/2
ref $self || $self
ref $self
$self
Truth table33%1/3
A || B
A= ref $selfB= $self
| |||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 116 | my $found_current = 0; | |||||||||||||||||||
| 14 | 116 | ▶ | while ( my $class = shift @classes ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 15 | 406 | ▶ | if ( $class eq $package ) { | ||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||
| 16 | 116 | $found_current = 1 | |||||||||||||||||||
| 17 | ▶ | } elsif ( $found_current and my $sub = $class->can( $method ) ) { | |||||||||||||||||||
|
Condition66%2/3
$found_current and my $sub = $class->can($method)
MC/DC50%1/2
$found_current and my $sub = $class->can($method)
$found_current
my $sub = $class->can($method)
Truth table66%2/3
A and B
A= $found_currentB= my $sub = $class->can($method)
| |||||||||||||||||||||
| 18 | 116 | return &$sub( $self, @args ); | |||||||||||||||||||
| 19 | } | ||||||||||||||||||||
| 20 | 8 | ▶ | no strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 21 | 290 | unshift @classes, @{ $class . "::ISA" }; | |||||||||||||||||||
| 22 | } | ||||||||||||||||||||
| 23 | 0 | Carp::croak( "Can't find NEXT method for $method" ); | |||||||||||||||||||
| 24 | } | ||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | ######################################################################## | ||||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | 8 | 1; | |||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | __END__ | ||||||||||||||||||||