File Coverage

blib/lib/OptArgs2/SubCmd_CI.pm
Criterion Covered Total %
statement 52 57 91.2
branch 10 18 55.5
condition 5 9 55.5
subroutine 11 12 91.6
pod 0 3 0.0
total 78 99 78.7


line stmt bran cond sub pod time code
1             # Generated by Class::Inline version 0.0.1
2             # Date: Mon Oct 3 17:29:06 2022
3 3     3   18 use strict;
  3         5  
  3         76  
4 3     3   12 use warnings;
  3         4  
  3         118  
5              
6              
7 3 50 66 3 0 15 package OptArgs2::SubCmd;BEGIN {require OptArgs2::CmdBase;our@ISA=('OptArgs2::CmdBase')};our$_HAS;sub OptArgs2::SubCmd_CI::import {shift;$_HAS={@_ > 1 ? @_ : %{$_[0]}};$_HAS=$_HAS->{'has'}if exists$_HAS->{'has'}}our%_ATTRS;my%_BUILD_CHECK;sub new {my$class=shift;my$self={@_ ? @_ > 1 ? @_ : %{$_[0]}: ()};%_ATTRS=map {($_=>1)}keys %$self;bless$self,ref$class || $class;$_BUILD_CHECK{$class}//= do {my@possible=($class);my@BUILD;my@CHECK;while (@possible){no strict 'refs';my$c=shift@possible;push@BUILD,$c .'::BUILD' if exists &{$c .'::BUILD'};push@CHECK,$c .'::__CHECK' if exists &{$c .'::__CHECK'};push@possible,@{$c .'::ISA'}}[reverse(@CHECK),reverse(@BUILD)]};map {$self->$_}@{$_BUILD_CHECK{$class}};Carp::carp("OptArgs2::SubCmd attribute '$_' unexpected")for keys%_ATTRS;$self}sub __RO {my (undef,undef,undef,$sub)=caller(1);Carp::croak("attribute $sub is read-only")}sub __CHECK {map {delete $_[0]->{$_}}'name';if (my@missing=grep {not exists $_[0]->{$_}}'parent'){Carp::croak('OptArgs2::SubCmd attribute(s) required: ' .join(', ',@missing))}no strict 'refs';my$_attrs=*{ref($_[0]).'::_ATTRS'};map {delete$_attrs->{$_}}keys %$_HAS}sub name {$_[0]->__RO($_[1])if @_ > 1;$_[0]{'name'}//= $_HAS->{'name'}->{'default'}->($_[0])}sub parent {$_[0]->__RO($_[1])if @_ > 1;$_[0]{'parent'}}BEGIN {$INC{'OptArgs2/SubCmd.pm'}=__FILE__}
  3 50 33 3 0 560  
  3 50 66 3 0 19  
  3 50   3   4  
  3 50   5   742  
  3 50   0   18  
  3 100   3   8  
  3 50   20   501  
  3 50   5   77  
  5     12   8  
  5         26  
  5         10  
  5         16  
  0         0  
  5         7  
  5         15  
  5         11  
  10         20  
  0         0  
  0         0  
  3         6  
  3         12  
  0         0  
  3         174  
  20         35  
  20         78  
  5         12  
  5         36  
  0         0  
  5         18  
  30         54  
  5         21  
  5         20  
  2         6  
  2         5  
  2         11  
  4         8  
  4         4  
  4         23  
  4         6  
  4         17  
  4         6  
  4         14  
  2         10  
  5         7  
  15         41  
  5         12  
  5         26  
  5         12  
  12         19  
  12         38  
8             1;