| 1 | package App::CLI::Extension::Component::Config; | ||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||
| 3 | =pod | ||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||
| 5 | =head1 NAME | ||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||
| 7 | App::CLI::Extension::Component::Config - for App::CLI::Extension config module | ||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||
| 9 | =head1 VERSION | ||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||
| 11 | 1.421 | ||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||
| 13 | =cut | ||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||
| 15 | 18 | ▶ | use strict; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 16 | 18 | ▶ | use base qw(Class::Accessor::Grouped); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||
| 18 | 18 | our $VERSION = '1.421'; | |||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||
| 20 | 18 | __PACKAGE__->mk_group_accessors( "inherited" => "_config" ); | |||||||||||||||||||||||||||||||
| 21 | 18 | __PACKAGE__->_config({}); | |||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||
| 23 | 0 | ▶ | sub config { | ||||||||||||||||||||||||||||||
|
Subroutine
config: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||
| 25 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||
| 27 | 0 | my %hash; | |||||||||||||||||||||||||||||||
| 28 | 0 | ▶ | if(scalar(@_) == 1 && ref($_[0]) eq "HASH"){ | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
scalar @_ == 1 and ref $_[0] eq "HASH"
MC/DC0%0/2
scalar @_ == 1 and ref $_[0] eq "HASH"
scalar @_ == 1
ref $_[0] eq "HASH"
Truth table0%0/3
A and B
A= scalar @_ == 1B= ref $_[0] eq "HASH"
| |||||||||||||||||||||||||||||||||
| 29 | 0 | %hash = %{$_[0]}; | |||||||||||||||||||||||||||||||
| 30 | } elsif(scalar(@_) > 1) { | ||||||||||||||||||||||||||||||||
| 31 | 0 | %hash = @_; | |||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||
| 33 | 0 | my @keys = keys %hash; | |||||||||||||||||||||||||||||||
| 34 | 0 | ▶ | if (scalar(@keys) > 0) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 35 | 0 | map { $self->_config->{$_} = $hash{$_} } @keys; | |||||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||||||
| 37 | 0 | return $self->_config; | |||||||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||
| 40 | 18 | 1; | |||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||
| 42 | __END__ | ||||||||||||||||||||||||||||||||