| 1 | package YATT::Lite::Partial::MarkAfterNew; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 52 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 52 | ▶ | use warnings qw(FATAL all NONFATAL misc); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 52 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 52 | ▶ | use mro 'c3'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 52 | ▶ | use YATT::Lite::MFields qw/__after_new_is_called__/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | sub MY () {__PACKAGE__} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 52 | ▶ | use YATT::Lite::Util qw/globref/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 52 | ▶ | use constant DEBUG => $ENV{DEBUG_YATT_IMPORT} // 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=2 SCAR=7.1
Condition50%1/2
$ENV{"DEBUG_YATT_IMPORT"} // 0
MC/DC0%0/1
$ENV{"DEBUG_YATT_IMPORT"} // 0
$ENV{"DEBUG_YATT_IMPORT"}
Truth table50%1/2
A
A= $ENV{"DEBUG_YATT_IMPORT"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | #======================================== | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 343 | ▶ | sub after_new { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
after_new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 343 | (my MY $self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 343 | $self->{__after_new_is_called__} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 343 | &maybe::next::method; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 175 | ▶ | sub after_new_is_called { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
after_new_is_called: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 175 | (my MY $self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 175 | $self->{__after_new_is_called__}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | #======================================== | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | # XXX: use YATT::Lite::Util::AsBase qw/-as_base import/; was not ok... | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 99 | ▶ | sub import { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
import: called CC=6 SCAR=21.6
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 99 | my ($pack, @args) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 99 | ▶ | return unless @args; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 98 | ▶ | if (@args == 1 and $args[0] and $args[0] =~ /^-(\w+)/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%3/9
@args == 1 and $args[0] and $args[0] =~ /^-(\w+)/ and my $sub = $pack->can("declare_$1")
@args == 1 and $args[0] and $args[0] =~ /^-(\w+)/
@args == 1 and $args[0]
MC/DC0%0/4
@args == 1 and $args[0] and $args[0] =~ /^-(\w+)/ and my $sub = $pack->can("declare_$1")
@args == 1
$args[0]
$args[0] =~ /^-(\w+)/
my $sub = $pack->can("declare_$1")
Truth table20%1/5
A and B and C and D
A= @args == 1B= $args[0]C= $args[0] =~ /^-(\w+)/D= my $sub = $pack->can("declare_$1")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | and my $sub = $pack->can("declare_$1")) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 98 | my $callpack = caller; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 98 | $sub->($pack, $callpack); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | Carp::croak("Invalid use spec: ", @args); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 98 | ▶ | sub declare_as_base { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
declare_as_base: called CC=3 SCAR=11.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 98 | my ($myPack, $callpack) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 98 | print STDERR "$myPack->declare_as_base($callpack)\n" if DEBUG; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 98 | my $sym = globref($callpack, 'ISA'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 98 | my $isa; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 98 | ▶ | unless ($isa = *{$sym}{ARRAY}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 0 | *$sym = $isa = []; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 98 | mro::set_mro($callpack, 'c3'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 98 | ▶ | unless (grep {$_ eq $myPack} @$isa) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 98 | unshift @$isa, $myPack; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 98 | print STDERR " => $callpack isa: @$isa\n" if DEBUG; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 52 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||