| 1 | package TUI::toolkit::UO::Base; | ||||||||||||
| 2 | # ABSTRACT: Derived UNIVERSAL::Object class for TUI::toolkit | ||||||||||||
| 3 | |||||||||||||
| 4 | 161 | ▶ | use 5.008; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 161 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 161 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | 161 | our $VERSION = '0.02'; | |||||||||||
| 9 | 161 | our $AUTHORITY = 'cpan:BRICKPOOL'; | |||||||||||
| 10 | |||||||||||||
| 11 | 161 | ▶ | use Hash::Util (); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 12 | 161 | ▶ | use Scalar::Util (); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 13 | 161 | ▶ | use UNIVERSAL::Object; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 14 | |||||||||||||
| 15 | 161 | ▶ | BEGIN { require Devel::GlobalDestruction unless $] >= 5.014 } | ||||||||||
|
Subroutine
BEGIN: called CC=2 SCAR=7.6
Branch: 1 branch
| |||||||||||||
| 16 | 161 | ▶ | BEGIN { $] >= 5.010 ? require mro : require MRO::Compat } | ||||||||||
|
Subroutine
BEGIN: called CC=2 SCAR=7.6
Branch: 1 branch
| |||||||||||||
| 17 | |||||||||||||
| 18 | 161 | our @ISA; | |||||||||||
| 19 | 161 | ▶ | BEGIN { @ISA = ( 'UNIVERSAL::Object' ) } | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 20 | |||||||||||||
| 21 | 79 | ▶ | sub DESTROY { | ||||||||||
|
Subroutine
DESTROY: called CC=5 SCAR=16.2
| |||||||||||||
| 22 | 79 | my $self = shift; | |||||||||||
| 23 | 79 | ▶ | my $class = ref $self || return; | ||||||||||
|
Condition50%1/2
ref $self || (return)
MC/DC0%0/1
ref $self || (return)
ref $self
Truth table50%1/2
A
A= ref $self
| |||||||||||||
| 24 | |||||||||||||
| 25 | 79 | my $repr = Scalar::Util::reftype $self; | |||||||||||
| 26 | 79 | ▶ | if ( $repr eq 'HASH' ) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 27 | 79 | Hash::Util::unlock_keys( %$self ); | |||||||||||
| 28 | } | ||||||||||||
| 29 | |||||||||||||
| 30 | 79 | ▶ | my $in_global_destruction = defined ${^GLOBAL_PHASE} | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 31 | ? ${^GLOBAL_PHASE} eq 'DESTRUCT' | ||||||||||||
| 32 | : Devel::GlobalDestruction::in_global_destruction(); | ||||||||||||
| 33 | |||||||||||||
| 34 | # Call all DEMOLISH methods starting with the derived classes. | ||||||||||||
| 35 | DEMOLISHALL: { | ||||||||||||
| 36 | 161 | ▶ | no strict 'refs'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 37 | map { | ||||||||||||
| 38 | 348 | my $demolish = *{ $_ . '::DEMOLISH' }{CODE}; | |||||||||||
| 39 | 348 | ▶ | $demolish->( $self, $in_global_destruction ) if $demolish; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 40 | 79 | } @{ mro::get_linear_isa( $class ) }; | |||||||||||
| 41 | } | ||||||||||||
| 42 | 79 | return; | |||||||||||
| 43 | } | ||||||||||||
| 44 | |||||||||||||
| 45 | 161 | 1 | |||||||||||
| 46 | |||||||||||||
| 47 | __END__ | ||||||||||||