| 1 | { | ||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 24 | package Mite::App::Command; | |||||||||||||||||||||||||||||||||||||||||||||
| 4 | 24 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 24 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 24 | ▶ | no warnings qw( once void ); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 24 | our $USES_MITE = "Mite::Class"; | |||||||||||||||||||||||||||||||||||||||||||||
| 9 | 24 | our $MITE_SHIM = "Mite::Shim"; | |||||||||||||||||||||||||||||||||||||||||||||
| 10 | 24 | our $MITE_VERSION = "0.013000"; | |||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||
| 12 | # Mite keywords | ||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 24 | ▶ | BEGIN { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=1.2
| |||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 24 | my ( $SHIM, $CALLER ) = | |||||||||||||||||||||||||||||||||||||||||||||
| 15 | ( "Mite::Shim", "Mite::App::Command" ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 16 | ( | ||||||||||||||||||||||||||||||||||||||||||||||
| 17 | *after, *around, *before, *extends, *field, | ||||||||||||||||||||||||||||||||||||||||||||||
| 18 | *has, *param, *signature_for, *with | ||||||||||||||||||||||||||||||||||||||||||||||
| 19 | ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 24 | = do { | |||||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||||||
| 22 | package Mite::Shim; | ||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 24 | ▶ | no warnings 'redefine'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 24 | ( | ||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 0 | ▶ | sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) }, | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | ▶ | sub { $SHIM->HANDLE_around( $CALLER, "class", @_ ) }, | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | ▶ | sub { $SHIM->HANDLE_before( $CALLER, "class", @_ ) }, | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | ▶ | sub { }, | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | ▶ | sub { $SHIM->HANDLE_has( $CALLER, field => @_ ) }, | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 48 | ▶ | sub { $SHIM->HANDLE_has( $CALLER, has => @_ ) }, | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 0 | ▶ | sub { $SHIM->HANDLE_has( $CALLER, param => @_ ) }, | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 0 | ▶ | sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) }, | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 0 | ▶ | sub { $SHIM->HANDLE_with( $CALLER, @_ ) }, | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 24 | ); | |||||||||||||||||||||||||||||||||||||||||||||
| 35 | }; | ||||||||||||||||||||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||||||
| 38 | # Mite imports | ||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 24 | ▶ | BEGIN { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 24 | require Scalar::Util; | |||||||||||||||||||||||||||||||||||||||||||||
| 41 | 24 | *STRICT = \&Mite::Shim::STRICT; | |||||||||||||||||||||||||||||||||||||||||||||
| 42 | 24 | *bare = \&Mite::Shim::bare; | |||||||||||||||||||||||||||||||||||||||||||||
| 43 | 24 | *blessed = \&Scalar::Util::blessed; | |||||||||||||||||||||||||||||||||||||||||||||
| 44 | 24 | *carp = \&Mite::Shim::carp; | |||||||||||||||||||||||||||||||||||||||||||||
| 45 | 24 | *confess = \&Mite::Shim::confess; | |||||||||||||||||||||||||||||||||||||||||||||
| 46 | 24 | *croak = \&Mite::Shim::croak; | |||||||||||||||||||||||||||||||||||||||||||||
| 47 | 24 | *false = \&Mite::Shim::false; | |||||||||||||||||||||||||||||||||||||||||||||
| 48 | 24 | *guard = \&Mite::Shim::guard; | |||||||||||||||||||||||||||||||||||||||||||||
| 49 | 24 | *lazy = \&Mite::Shim::lazy; | |||||||||||||||||||||||||||||||||||||||||||||
| 50 | 24 | *lock = \&Mite::Shim::lock; | |||||||||||||||||||||||||||||||||||||||||||||
| 51 | 24 | *ro = \&Mite::Shim::ro; | |||||||||||||||||||||||||||||||||||||||||||||
| 52 | 24 | *rw = \&Mite::Shim::rw; | |||||||||||||||||||||||||||||||||||||||||||||
| 53 | 24 | *rwp = \&Mite::Shim::rwp; | |||||||||||||||||||||||||||||||||||||||||||||
| 54 | 24 | *true = \&Mite::Shim::true; | |||||||||||||||||||||||||||||||||||||||||||||
| 55 | 24 | *unlock = \&Mite::Shim::unlock; | |||||||||||||||||||||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||||||||||||
| 58 | # Gather metadata for constructor and destructor | ||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 120 | ▶ | sub __META__ { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__META__: called CC=4 SCAR=14.1
| |||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 24 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 120 | my $class = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 62 | 120 | ▶ | $class = ref($class) || $class; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
ref $class || $class
MC/DC0%0/2
ref $class || $class
ref $class
$class
Truth table33%1/3
A || B
A= ref $classB= $class
| |||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 120 | my $linear_isa = mro::get_linear_isa($class); | |||||||||||||||||||||||||||||||||||||||||||||
| 64 | return { | ||||||||||||||||||||||||||||||||||||||||||||||
| 65 | BUILD => [ | ||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 240 | ▶ | map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 240 | map { "$_\::BUILD" } reverse @$linear_isa | |||||||||||||||||||||||||||||||||||||||||||||
| 68 | ], | ||||||||||||||||||||||||||||||||||||||||||||||
| 69 | DEMOLISH => [ | ||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 0 | ▶ | map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 120 | map { "$_\::DEMOLISH" } @$linear_isa | |||||||||||||||||||||||||||||||||||||||||||||
| 72 | ], | ||||||||||||||||||||||||||||||||||||||||||||||
| 73 | HAS_BUILDARGS => $class->can('BUILDARGS'), | ||||||||||||||||||||||||||||||||||||||||||||||
| 74 | HAS_FOREIGNBUILDARGS => $class->can('FOREIGNBUILDARGS'), | ||||||||||||||||||||||||||||||||||||||||||||||
| 75 | }; | ||||||||||||||||||||||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||||||||||||
| 78 | # Standard Moose/Moo-style constructor | ||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 120 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=15 SCAR=34.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 120 | ▶ | my $class = ref( $_[0] ) ? ref(shift) : shift; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 120 | ▶ | my $meta = ( $Mite::META{$class} ||= $class->__META__ ); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$Mite::META{$class} ||= $class->__META__
MC/DC0%0/2
$Mite::META{$class} ||= $class->__META__
$Mite::META{$class}
$class->__META__
Truth table33%1/3
A ||= B
A= $Mite::META{$class}B= $class->__META__
| |||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 120 | my $self = bless {}, $class; | |||||||||||||||||||||||||||||||||||||||||||||
| 83 | my $args = | ||||||||||||||||||||||||||||||||||||||||||||||
| 84 | $meta->{HAS_BUILDARGS} | ||||||||||||||||||||||||||||||||||||||||||||||
| 85 | ? $class->BUILDARGS(@_) | ||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 0 | ▶ | : { ( @_ == 1 ) ? %{ $_[0] } : @_ }; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 120 | my $no_build = delete $args->{__no_BUILD__}; | |||||||||||||||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||||||||||||||||
| 89 | # Attribute app (type: Object) | ||||||||||||||||||||||||||||||||||||||||||||||
| 90 | # has declaration, file lib/Mite/App/Command.pm, line 11 | ||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 120 | ▶ | croak "Missing key in constructor: app" unless exists $args->{"app"}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 120 | ▶ | blessed( $args->{"app"} ) | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 93 | or croak "Type check failed in constructor: %s should be %s", "app", | ||||||||||||||||||||||||||||||||||||||||||||||
| 94 | "Object"; | ||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 120 | $self->{"app"} = $args->{"app"}; | |||||||||||||||||||||||||||||||||||||||||||||
| 96 | require Scalar::Util && Scalar::Util::weaken( $self->{"app"} ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 120 | ▶ | if ref $self->{"app"}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%2/4
ref $self->{'app'} && (require Scalar::Util && builtin::weaken($self->{'app'}))
require Scalar::Util and builtin::weaken($self->{"app"})
MC/DC0%0/3
ref $self->{'app'} && (require Scalar::Util && builtin::weaken($self->{'app'}))
ref $self->{'app'}
require Scalar::Util
builtin::weaken($self->{"app"})
Truth table0%0/4
A && B and C
A= ref $self->{'app'}B= require Scalar::UtilC= builtin::weaken($self->{"app"})
| |||||||||||||||||||||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||||||||||||||||||||
| 99 | # Attribute kingpin_command (type: Object) | ||||||||||||||||||||||||||||||||||||||||||||||
| 100 | # has declaration, file lib/Mite/App/Command.pm, line 19 | ||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 120 | ▶ | if ( exists $args->{"kingpin_command"} ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 0 | ▶ | blessed( $args->{"kingpin_command"} ) | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 103 | or croak "Type check failed in constructor: %s should be %s", | ||||||||||||||||||||||||||||||||||||||||||||||
| 104 | "kingpin_command", "Object"; | ||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | $self->{"kingpin_command"} = $args->{"kingpin_command"}; | |||||||||||||||||||||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||||||
| 108 | # Call BUILD methods | ||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 120 | ▶ | $self->BUILDALL($args) if ( !$no_build and @{ $meta->{BUILD} || [] } ); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition40%2/5
not $no_build and @{$meta->{"BUILD"} or [];}
$meta->{'BUILD'} || []
MC/DC0%0/2
not $no_build and @{$meta->{"BUILD"} or [];}
not $no_build
@{$meta->{"BUILD"} or [];}
MC/DC0%0/1
$meta->{'BUILD'} || []
$meta->{'BUILD'}
Truth table33%1/3
not(A) and B
A= not $no_buildB= @{$meta->{"BUILD"} or [];}
Truth table50%1/2
A
A= $meta->{'BUILD'}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||||||||||||||||||||
| 111 | # Unrecognized parameters | ||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 120 | my @unknown = grep not(/\A(?:app|kingpin_command)\z/), keys %{$args}; | |||||||||||||||||||||||||||||||||||||||||||||
| 113 | @unknown | ||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 120 | ▶ | and croak( | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 115 | "Unexpected keys in constructor: " . join( q[, ], sort @unknown ) ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 120 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||||||
| 120 | # Used by constructor to call BUILD methods | ||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 120 | ▶ | sub BUILDALL { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BUILDALL: called CC=4 SCAR=15.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 120 | my $class = ref( $_[0] ); | |||||||||||||||||||||||||||||||||||||||||||||
| 123 | 120 | ▶ | my $meta = ( $Mite::META{$class} ||= $class->__META__ ); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$Mite::META{$class} ||= $class->__META__
MC/DC0%0/2
$Mite::META{$class} ||= $class->__META__
$Mite::META{$class}
$class->__META__
Truth table33%1/3
A ||= B
A= $Mite::META{$class}B= $class->__META__
| |||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 120 | ▶ | $_->(@_) for @{ $meta->{BUILD} || [] }; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$meta->{'BUILD'} || []
MC/DC0%0/1
$meta->{'BUILD'} || []
$meta->{'BUILD'}
Truth table50%1/2
A
A= $meta->{'BUILD'}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 125 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||||||||||||||
| 127 | # Destructor should call DEMOLISH methods | ||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 120 | ▶ | sub DESTROY { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
DESTROY: called CC=7 SCAR=25.7
| |||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 120 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 130 | 120 | ▶ | my $class = 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
| |||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 120 | ▶ | my $meta = ( $Mite::META{$class} ||= $class->__META__ ); | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$Mite::META{$class} ||= $class->__META__
MC/DC0%0/2
$Mite::META{$class} ||= $class->__META__
$Mite::META{$class}
$class->__META__
Truth table33%1/3
A ||= B
A= $Mite::META{$class}B= $class->__META__
| |||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 120 | ▶ | my $in_global_destruction = | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 133 | defined ${^GLOBAL_PHASE} | ||||||||||||||||||||||||||||||||||||||||||||||
| 134 | ? ${^GLOBAL_PHASE} eq 'DESTRUCT' | ||||||||||||||||||||||||||||||||||||||||||||||
| 135 | : Devel::GlobalDestruction::in_global_destruction(); | ||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 120 | ▶ | for my $demolisher ( @{ $meta->{DEMOLISH} || [] } ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$meta->{'DEMOLISH'} || []
MC/DC0%0/1
$meta->{'DEMOLISH'} || []
$meta->{'DEMOLISH'}
Truth table50%1/2
A
A= $meta->{'DEMOLISH'}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 0 | my $e = do { | |||||||||||||||||||||||||||||||||||||||||||||
| 138 | 0 | local ( $?, $@ ); | |||||||||||||||||||||||||||||||||||||||||||||
| 139 | 0 | eval { $demolisher->( $self, $in_global_destruction ) }; | |||||||||||||||||||||||||||||||||||||||||||||
| 140 | 0 | $@; | |||||||||||||||||||||||||||||||||||||||||||||
| 141 | }; | ||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 24 | ▶ | no warnings 'misc'; # avoid (in cleanup) warnings | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 0 | ▶ | die $e if $e; # rethrow | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 144 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 120 | return; | |||||||||||||||||||||||||||||||||||||||||||||
| 146 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||||||||||||||||||||
| 148 | my $__XS = !$ENV{PERL_ONLY} | ||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 24 | ▶ | && eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") }; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
!$ENV{'PERL_ONLY'} && eval {
do {
require Class::XSAccessor;
'Class::XSAccessor'->VERSION('1.19')
}
}
MC/DC0%0/2
!$ENV{'PERL_ONLY'} && eval {
do {
require Class::XSAccessor;
'Class::XSAccessor'->VERSION('1.19')
}
}
!$ENV{'PERL_ONLY'}
eval {
do {
require Class::XSAccessor;
'Class::XSAccessor'->VERSION('1.19')
}
}
Truth table33%1/3
not(A) && B
A= !$ENV{'PERL_ONLY'}B= eval {
do {
require Class::XSAccessor;
'Class::XSAccessor'->VERSION('1.19')
}
}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||||||||||||||||||
| 151 | # Accessors for app | ||||||||||||||||||||||||||||||||||||||||||||||
| 152 | # has declaration, file lib/Mite/App/Command.pm, line 11 | ||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 24 | ▶ | if ($__XS) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 24 | Class::XSAccessor->import( | |||||||||||||||||||||||||||||||||||||||||||||
| 155 | chained => 1, | ||||||||||||||||||||||||||||||||||||||||||||||
| 156 | "getters" => { "app" => "app" }, | ||||||||||||||||||||||||||||||||||||||||||||||
| 157 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 159 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 0 | ▶ | *app = sub { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 0 | ▶ | @_ == 1 or croak('Reader "app" usage: $self->app()'); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 0 | $_[0]{"app"}; | |||||||||||||||||||||||||||||||||||||||||||||
| 163 | 0 | }; | |||||||||||||||||||||||||||||||||||||||||||||
| 164 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 163 | ▶ | sub _assert_blessed_app { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_assert_blessed_app: called CC=2 SCAR=7.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 167 | 163 | my $object = do { $_[0]{"app"} }; | |||||||||||||||||||||||||||||||||||||||||||||
| 168 | 163 | ▶ | blessed($object) or croak("app is not a blessed object"); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 169 | 163 | $object; | |||||||||||||||||||||||||||||||||||||||||||||
| 170 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||||||||||||||||||||
| 172 | # Delegated methods for app | ||||||||||||||||||||||||||||||||||||||||||||||
| 173 | # has declaration, file lib/Mite/App/Command.pm, line 11 | ||||||||||||||||||||||||||||||||||||||||||||||
| 174 | 27 | ▶ | sub config { shift->_assert_blessed_app->config(@_) } | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
config: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 120 | ▶ | sub kingpin { shift->_assert_blessed_app->kingpin(@_) } | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
kingpin: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 176 | 16 | ▶ | sub project { shift->_assert_blessed_app->project(@_) } | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
project: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||||||||||||||||||||
| 178 | # Accessors for kingpin_command | ||||||||||||||||||||||||||||||||||||||||||||||
| 179 | # has declaration, file lib/Mite/App/Command.pm, line 19 | ||||||||||||||||||||||||||||||||||||||||||||||
| 180 | 128 | ▶ | sub kingpin_command { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
kingpin_command: called CC=4 SCAR=14.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 128 | ▶ | @_ == 1 | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 182 | or croak('Reader "kingpin_command" usage: $self->kingpin_command()'); | ||||||||||||||||||||||||||||||||||||||||||||||
| 183 | ( | ||||||||||||||||||||||||||||||||||||||||||||||
| 184 | exists( $_[0]{"kingpin_command"} ) ? $_[0]{"kingpin_command"} : ( | ||||||||||||||||||||||||||||||||||||||||||||||
| 185 | 128 | ▶ | $_[0]{"kingpin_command"} = do { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 186 | 120 | my $default_value = $_[0]->_build_kingpin_command; | |||||||||||||||||||||||||||||||||||||||||||||
| 187 | 120 | ▶ | blessed($default_value) | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 188 | or croak( "Type check failed in default: %s should be %s", | ||||||||||||||||||||||||||||||||||||||||||||||
| 189 | "kingpin_command", "Object" ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 120 | $default_value; | |||||||||||||||||||||||||||||||||||||||||||||
| 191 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 192 | ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 193 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 194 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||||||||||||||||||||
| 196 | # See UNIVERSAL | ||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 0 | ▶ | sub DOES { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
DOES: not called CC=8 SCAR=42.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 198 | 0 | my ( $self, $role ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 199 | 0 | our %DOES; | |||||||||||||||||||||||||||||||||||||||||||||
| 200 | 0 | ▶ | return $DOES{$role} if exists $DOES{$role}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 0 | ▶ | return 1 if $role eq __PACKAGE__; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 0 | ▶ | if ( $INC{'Moose/Util.pm'} | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$INC{"Moose/Util.pm"} and my $meta = Moose::Util::find_meta(ref $self || $self)
ref $self || $self
MC/DC0%0/2
$INC{"Moose/Util.pm"} and my $meta = Moose::Util::find_meta(ref $self || $self)
$INC{"Moose/Util.pm"}
my $meta = Moose::Util::find_meta(ref $self || $self)
MC/DC0%0/2
ref $self || $self
ref $self
$self
Truth table0%0/3
A and B
A= $INC{"Moose/Util.pm"}B= my $meta = Moose::Util::find_meta(ref $self || $self)
Truth table0%0/3
A || B
A= ref $selfB= $self
| |||||||||||||||||||||||||||||||||||||||||||||||
| 203 | and my $meta = Moose::Util::find_meta( ref $self or $self ) ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 204 | { | ||||||||||||||||||||||||||||||||||||||||||||||
| 205 | 0 | ▶ | $meta->can('does_role') and $meta->does_role($role) and return 1; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$meta->can("does_role") and $meta->does_role($role)
MC/DC0%0/2
$meta->can("does_role") and $meta->does_role($role)
$meta->can("does_role")
$meta->does_role($role)
Truth table0%0/3
A and B
A= $meta->can("does_role")B= $meta->does_role($role)
| |||||||||||||||||||||||||||||||||||||||||||||||
| 206 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 207 | 0 | return $self->SUPER::DOES($role); | |||||||||||||||||||||||||||||||||||||||||||||
| 208 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 209 | |||||||||||||||||||||||||||||||||||||||||||||||
| 210 | # Alias for Moose/Moo-compatibility | ||||||||||||||||||||||||||||||||||||||||||||||
| 211 | 0 | ▶ | sub does { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
does: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 212 | 0 | shift->DOES(@_); | |||||||||||||||||||||||||||||||||||||||||||||
| 213 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 214 | |||||||||||||||||||||||||||||||||||||||||||||||
| 215 | 24 | 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 216 | } | ||||||||||||||||||||||||||||||||||||||||||||||