| 1 | package Sub::Meta::Parameters; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | 34 | ▶ | use 5.010; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 3 | 34 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 34 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||
| 6 | 34 | our $VERSION = "0.15"; | |||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||
| 8 | 34 | ▶ | use Carp (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | 34 | ▶ | use Scalar::Util (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||
| 11 | 34 | ▶ | use Sub::Meta::Param; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||
| 13 | use overload | ||||||||||||||||||||||||||||||||||||||||||
| 14 | 34 | ▶ | fallback => 1, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | eq => \&is_same_interface | ||||||||||||||||||||||||||||||||||||||||||
| 16 | 34 | ; | |||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||
| 18 | 5 | ▶ | sub _croak { require Carp; goto &Carp::croak } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_croak: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||
| 20 | 132 | ▶ | sub param_class { return 'Sub::Meta::Param' } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
param_class: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||
| 22 | 296 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=6 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 23 | 296 | my ($class, @args) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 24 | 296 | ▶ | my %args = @args == 1 ? %{$args[0]} : @args; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | 294 | my $self = bless \%args => $class; | |||||||||||||||||||||||||||||||||||||||||
| 27 | 294 | ▶ | $self->set_args($args{args}) if exists $args{args}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 28 | 294 | ▶ | $self->set_invocant(delete $args{invocant}) if defined $args{invocant}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 29 | 294 | ▶ | $self->set_nshift(delete $args{nshift}) if defined $args{nshift}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 30 | 294 | ▶ | $self->set_slurpy(delete $args{slurpy}) if defined $args{slurpy}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||
| 32 | 294 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||
| 35 | 741 | ▶ | sub nshift() { my $self = shift; return $self->{nshift} // 0 } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
nshift: called CC=2 SCAR=6.9
Pod
documented
Condition100%2/2
$self->{"nshift"} // 0
MC/DC100%1/1
$self->{"nshift"} // 0
$self->{"nshift"}
Truth table100%2/2
A
A= $self->{"nshift"}
| |||||||||||||||||||||||||||||||||||||||||||
| 36 | 278 | ▶ | sub slurpy() { my $self = shift; return $self->{slurpy} } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
slurpy: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 37 | 2255 | ▶ | sub args() { my $self = shift; return $self->{args} // [] } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
args: called CC=2 SCAR=6.9
Pod
documented
Condition100%2/2
$self->{"args"} // []
MC/DC100%1/1
$self->{"args"} // []
$self->{"args"}
Truth table100%2/2
A
A= $self->{"args"}
| |||||||||||||||||||||||||||||||||||||||||||
| 38 | 332 | ▶ | sub invocant() { my $self = shift; return $self->{invocant} } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
invocant: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 39 | 1800 | ▶ | sub invocants() { my $self = shift; return $self->has_invocant ? [ $self->{invocant} ] : [] } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
invocants: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 40 | 1629 | ▶ | sub all_args() { my $self = shift; return [ @{$self->invocants}, @{$self->args} ] } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
all_args: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||
| 42 | 117 | ▶ | sub has_args() { my $self = shift; return defined $self->{args} } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
has_args: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 43 | 1881 | ▶ | sub has_invocant() { my $self = shift; return defined $self->{invocant} } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
has_invocant: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 44 | 507 | ▶ | sub has_slurpy() { my $self = shift; return defined $self->{slurpy} } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
has_slurpy: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||
| 46 | 30 | ▶ | sub set_slurpy { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_slurpy: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 47 | 30 | my ($self, $v) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 48 | 30 | ▶ | $self->{slurpy} = Scalar::Util::blessed($v) && $v->isa('Sub::Meta::Param') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
builtin::blessed($v) and $v->isa("Sub::Meta::Param")
MC/DC100%2/2
builtin::blessed($v) and $v->isa("Sub::Meta::Param")
builtin::blessed($v)
$v->isa("Sub::Meta::Param")
Truth table100%3/3
A and B
A= builtin::blessed($v)B= $v->isa("Sub::Meta::Param")
| |||||||||||||||||||||||||||||||||||||||||||
| 49 | ? $v | ||||||||||||||||||||||||||||||||||||||||||
| 50 | : $self->param_class->new($v); | ||||||||||||||||||||||||||||||||||||||||||
| 51 | 30 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||
| 54 | 178 | ▶ | sub set_args { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_args: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 55 | 178 | my ($self, @args) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 56 | 178 | $self->{args} = $self->_normalize_args(@args); | |||||||||||||||||||||||||||||||||||||||||
| 57 | 175 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||
| 60 | 258 | ▶ | sub set_nshift { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_nshift: called CC=9 SCAR=22.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 61 | 258 | my ($self, $v) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||
| 63 | 258 | ▶ | unless (defined $v && ($v == 0 || $v == 1) ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%6/6
defined $v and $v == 0 || $v == 1
$v == 0 or $v == 1
MC/DC100%3/3
defined $v and $v == 0 || $v == 1
defined $v
$v == 0
$v == 1
Truth table100%4/4
A and B or C
A= defined $vB= $v == 0C= $v == 1
| |||||||||||||||||||||||||||||||||||||||||||
| 64 | 2 | ▶ | _croak sprintf("Can't set this nshift: %s", $v//''); | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$v // ""
MC/DC100%1/1
$v // ""
$v
Truth table100%2/2
A
A= $v
| |||||||||||||||||||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||||||||||
| 67 | 256 | $self->{nshift} = $v; | |||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||
| 69 | 256 | ▶ | if ($v == 1 && !defined $self->invocant) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$v == 1 and not defined $self->invocant
MC/DC100%2/2
$v == 1 and not defined $self->invocant
$v == 1
not defined $self->invocant
Truth table100%3/3
A and not(B)
A= $v == 1B= not defined $self->invocant
| |||||||||||||||||||||||||||||||||||||||||||
| 70 | 40 | my $default_invocant = $self->param_class->new(invocant => 1); | |||||||||||||||||||||||||||||||||||||||||
| 71 | 40 | $self->set_invocant($default_invocant) | |||||||||||||||||||||||||||||||||||||||||
| 72 | } | ||||||||||||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||||||||||||
| 74 | 256 | ▶ | if ($v == 0 && defined $self->invocant) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$v == 0 and defined $self->invocant
MC/DC100%2/2
$v == 0 and defined $self->invocant
$v == 0
defined $self->invocant
Truth table100%3/3
A and B
A= $v == 0B= defined $self->invocant
| |||||||||||||||||||||||||||||||||||||||||||
| 75 | delete $self->{invocant} | ||||||||||||||||||||||||||||||||||||||||||
| 76 | 1 | } | |||||||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||||||||
| 78 | 256 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 79 | } | ||||||||||||||||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||||||||||||||||
| 81 | 64 | ▶ | sub set_invocant { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_invocant: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 82 | 64 | my ($self, $v) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||||||||||
| 84 | 64 | ▶ | my $invocant = Scalar::Util::blessed($v) && $v->isa('Sub::Meta::Param') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
builtin::blessed($v) and $v->isa("Sub::Meta::Param")
MC/DC100%2/2
builtin::blessed($v) and $v->isa("Sub::Meta::Param")
builtin::blessed($v)
$v->isa("Sub::Meta::Param")
Truth table100%3/3
A and B
A= builtin::blessed($v)B= $v->isa("Sub::Meta::Param")
| |||||||||||||||||||||||||||||||||||||||||||
| 85 | ? $v | ||||||||||||||||||||||||||||||||||||||||||
| 86 | : $self->param_class->new($v); | ||||||||||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||||||||||
| 88 | 64 | $invocant->set_invocant(1); | |||||||||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||||||||||
| 90 | 64 | $self->{invocant} = $invocant; | |||||||||||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||||||||||||
| 92 | 64 | ▶ | if ($self->nshift == 0) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 93 | 15 | $self->set_nshift(1); | |||||||||||||||||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||||||||||||
| 96 | 64 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 97 | } | ||||||||||||||||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||||||||||||||||
| 99 | 178 | ▶ | sub _normalize_args { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_normalize_args: called CC=10 SCAR=23.0
| |||||||||||||||||||||||||||||||||||||||||||
| 100 | 178 | my ($self, @args) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 101 | 178 | my $args = $args[0]; | |||||||||||||||||||||||||||||||||||||||||
| 102 | 178 | ▶ | _croak 'args must be a single reference' unless @args == 1 && ref $args; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
@args == 1 and ref $args
MC/DC100%2/2
@args == 1 and ref $args
@args == 1
ref $args
Truth table100%3/3
A and B
A= @args == 1B= ref $args
| |||||||||||||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||||||||||
| 104 | 175 | my @normalized_args; | |||||||||||||||||||||||||||||||||||||||||
| 105 | 175 | ▶ | if (ref $args eq 'ARRAY') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 106 | 165 | @normalized_args = @{$args}; | |||||||||||||||||||||||||||||||||||||||||
| 107 | } | ||||||||||||||||||||||||||||||||||||||||||
| 108 | elsif (ref $args eq 'HASH') { | ||||||||||||||||||||||||||||||||||||||||||
| 109 | 5 | for my $name (sort { $a cmp $b } keys %{$args}) { | |||||||||||||||||||||||||||||||||||||||||
| 110 | 5 | my $v = $args->{$name}; | |||||||||||||||||||||||||||||||||||||||||
| 111 | 5 | ▶ | my $f = ref $v && ref $v eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
ref $v && ref $v eq 'HASH'
MC/DC50%1/2
ref $v && ref $v eq 'HASH'
ref $v
ref $v eq 'HASH'
Truth table66%2/3
A && B
A= ref $vB= ref $v eq 'HASH'
| |||||||||||||||||||||||||||||||||||||||||||
| 112 | 5 | ▶ | push @normalized_args => { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 113 | name => $name, | ||||||||||||||||||||||||||||||||||||||||||
| 114 | named => 1, | ||||||||||||||||||||||||||||||||||||||||||
| 115 | ($f ? %$v : (type => $v) ), | ||||||||||||||||||||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||||||||||||||||
| 119 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 120 | 5 | @normalized_args = ($args); | |||||||||||||||||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||||||||||
| 123 | return [ | ||||||||||||||||||||||||||||||||||||||||||
| 124 | map { | ||||||||||||||||||||||||||||||||||||||||||
| 125 | 175 | ▶ | Scalar::Util::blessed($_) && $_->isa('Sub::Meta::Param') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
builtin::blessed($_) and $_->isa("Sub::Meta::Param")
MC/DC100%2/2
builtin::blessed($_) and $_->isa("Sub::Meta::Param")
builtin::blessed($_)
$_->isa("Sub::Meta::Param")
Truth table100%3/3
A and B
A= builtin::blessed($_)B= $_->isa("Sub::Meta::Param")
| |||||||||||||||||||||||||||||||||||||||||||
| 126 | ? $_ | ||||||||||||||||||||||||||||||||||||||||||
| 127 | : $self->param_class->new($_) | ||||||||||||||||||||||||||||||||||||||||||
| 128 | } @normalized_args | ||||||||||||||||||||||||||||||||||||||||||
| 129 | ] | ||||||||||||||||||||||||||||||||||||||||||
| 130 | } | ||||||||||||||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||||||||||||||
| 132 | 125 | ▶ | sub _all_positional_required() { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_all_positional_required: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 133 | 125 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 134 | 125 | return [ @{$self->invocants}, @{$self->positional_required} ]; | |||||||||||||||||||||||||||||||||||||||||
| 135 | } | ||||||||||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||||||||||
| 138 | 45 | ▶ | sub positional() { my $self = shift; return [ grep { $_->positional } @{$self->args} ] } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
positional: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 139 | 170 | ▶ | sub positional_required() { my $self = shift; return [ grep { $_->positional && $_->required } @{$self->args} ] } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
positional_required: called CC=2 SCAR=6.9
Pod
documented
Condition100%3/3
$_->positional && $_->required
MC/DC100%2/2
$_->positional && $_->required
$_->positional
$_->required
Truth table100%3/3
A && B
A= $_->positionalB= $_->required
| |||||||||||||||||||||||||||||||||||||||||||
| 140 | 80 | ▶ | sub positional_optional() { my $self = shift; return [ grep { $_->positional && $_->optional } @{$self->args} ] } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
positional_optional: called CC=2 SCAR=6.9
Pod
documented
Condition100%3/3
$_->positional && $_->optional
MC/DC100%2/2
$_->positional && $_->optional
$_->positional
$_->optional
Truth table100%3/3
A && B
A= $_->positionalB= $_->optional
| |||||||||||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||||||||||
| 142 | 88 | ▶ | sub named() { my $self = shift; return [ grep { $_->named } @{$self->args} ] } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
named: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 143 | 90 | ▶ | sub named_required() { my $self = shift; return [ grep { $_->named && $_->required } @{$self->args} ] } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
named_required: called CC=2 SCAR=6.9
Pod
documented
Condition100%3/3
$_->named && $_->required
MC/DC100%2/2
$_->named && $_->required
$_->named
$_->required
Truth table100%3/3
A && B
A= $_->namedB= $_->required
| |||||||||||||||||||||||||||||||||||||||||||
| 144 | 45 | ▶ | sub named_optional() { my $self = shift; return [ grep { $_->named && $_->optional } @{$self->args} ] } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
named_optional: called CC=2 SCAR=6.9
Pod
documented
Condition100%3/3
$_->named && $_->optional
MC/DC100%2/2
$_->named && $_->optional
$_->named
$_->optional
Truth table100%3/3
A && B
A= $_->namedB= $_->optional
| |||||||||||||||||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||||||||||||||||
| 146 | 45 | ▶ | sub args_min() { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
args_min: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 147 | 45 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 148 | 45 | my $r = 0; | |||||||||||||||||||||||||||||||||||||||||
| 149 | 45 | $r += @{$self->_all_positional_required}; | |||||||||||||||||||||||||||||||||||||||||
| 150 | 45 | $r += @{$self->named_required} * 2; | |||||||||||||||||||||||||||||||||||||||||
| 151 | 45 | return $r | |||||||||||||||||||||||||||||||||||||||||
| 152 | } | ||||||||||||||||||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||||||||||||||||||
| 154 | 45 | ▶ | sub args_max() { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
args_max: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 155 | 45 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 156 | 45 | ▶ | return 0 + 'Inf' if $self->slurpy || @{$self->named}; ## no critic (ProhibitMismatchedOperators) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$self->slurpy or @{$self->named;}
MC/DC100%2/2
$self->slurpy or @{$self->named;}
$self->slurpy
@{$self->named;}
Truth table100%3/3
A or B
A= $self->slurpyB= @{$self->named;}
| |||||||||||||||||||||||||||||||||||||||||||
| 157 | 35 | my $r = 0; | |||||||||||||||||||||||||||||||||||||||||
| 158 | 35 | $r += @{$self->_all_positional_required}; | |||||||||||||||||||||||||||||||||||||||||
| 159 | 35 | $r += @{$self->positional_optional}; | |||||||||||||||||||||||||||||||||||||||||
| 160 | 35 | return $r | |||||||||||||||||||||||||||||||||||||||||
| 161 | } | ||||||||||||||||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||||||||||||||||
| 163 | 81 | ▶ | sub is_same_interface { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_same_interface: called CC=10 SCAR=23.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 164 | 81 | my ($self, $other) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||||||||||||||
| 166 | 81 | ▶ | return unless Scalar::Util::blessed($other) && $other->isa('Sub::Meta::Parameters'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
builtin::blessed($other) and $other->isa("Sub::Meta::Parameters")
MC/DC100%2/2
builtin::blessed($other) and $other->isa("Sub::Meta::Parameters")
builtin::blessed($other)
$other->isa("Sub::Meta::Parameters")
Truth table100%3/3
A and B
A= builtin::blessed($other)B= $other->isa("Sub::Meta::Parameters")
| |||||||||||||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||||||||||||
| 168 | 79 | ▶ | if ($self->has_slurpy) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 169 | 11 | ▶ | return unless $self->slurpy->is_same_interface($other->slurpy) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 170 | } | ||||||||||||||||||||||||||||||||||||||||||
| 171 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 172 | 68 | ▶ | return if $other->has_slurpy; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 173 | } | ||||||||||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||||||||||
| 175 | 73 | ▶ | return unless $self->nshift == $other->nshift; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 176 | |||||||||||||||||||||||||||||||||||||||||||
| 177 | 67 | ▶ | return unless @{$self->all_args} == @{$other->all_args}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 178 | |||||||||||||||||||||||||||||||||||||||||||
| 179 | 54 | ▶ | for (my $i = 0; $i < @{$self->all_args}; $i++) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 180 | 38 | ▶ | return unless $self->all_args->[$i]->is_same_interface($other->all_args->[$i]); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 181 | } | ||||||||||||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||||||||||||
| 183 | 41 | return !!1; | |||||||||||||||||||||||||||||||||||||||||
| 184 | } | ||||||||||||||||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||||||||||||||||
| 186 | 87 | ▶ | sub is_relaxed_same_interface { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_relaxed_same_interface: called CC=9 SCAR=22.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 187 | 87 | my ($self, $other) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||||||||||||||||
| 189 | 87 | ▶ | return unless Scalar::Util::blessed($other) && $other->isa('Sub::Meta::Parameters'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
builtin::blessed($other) and $other->isa("Sub::Meta::Parameters")
MC/DC100%2/2
builtin::blessed($other) and $other->isa("Sub::Meta::Parameters")
builtin::blessed($other)
$other->isa("Sub::Meta::Parameters")
Truth table100%3/3
A and B
A= builtin::blessed($other)B= $other->isa("Sub::Meta::Parameters")
| |||||||||||||||||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||||||||||||||||
| 191 | 85 | ▶ | if ($self->has_slurpy) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 192 | 11 | ▶ | return unless $self->slurpy->is_same_interface($other->slurpy) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 193 | } | ||||||||||||||||||||||||||||||||||||||||||
| 194 | |||||||||||||||||||||||||||||||||||||||||||
| 195 | 82 | ▶ | return unless $self->nshift == $other->nshift; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||||||||||||||||
| 197 | 76 | ▶ | return unless @{$self->all_args} <= @{$other->all_args}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||||||||||||||||
| 199 | 70 | ▶ | for (my $i = 0; $i < @{$self->all_args}; $i++) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 200 | 49 | ▶ | return unless $self->all_args->[$i]->is_relaxed_same_interface($other->all_args->[$i]); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 201 | } | ||||||||||||||||||||||||||||||||||||||||||
| 202 | |||||||||||||||||||||||||||||||||||||||||||
| 203 | 59 | return !!1; | |||||||||||||||||||||||||||||||||||||||||
| 204 | } | ||||||||||||||||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||||||||||||||||
| 206 | 20 | ▶ | sub is_same_interface_inlined { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_same_interface_inlined: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 207 | 20 | my ($self, $v) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||||||||||||||||
| 209 | 20 | my @src; | |||||||||||||||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||||||||||||||||
| 211 | 20 | push @src => sprintf("Scalar::Util::blessed(%s) && %s->isa('Sub::Meta::Parameters')", $v, $v); | |||||||||||||||||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||||||||||||||||||
| 213 | 20 | ▶ | push @src => $self->has_slurpy ? $self->slurpy->is_same_interface_inlined(sprintf('%s->slurpy', $v)) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 214 | : sprintf('!%s->has_slurpy', $v); | ||||||||||||||||||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||||||||||||||||
| 216 | 20 | push @src => sprintf('%d == %s->nshift', $self->nshift, $v); | |||||||||||||||||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||||||||||||||||||
| 218 | 20 | push @src => sprintf('%d == @{%s->all_args}', scalar @{$self->all_args}, $v); | |||||||||||||||||||||||||||||||||||||||||
| 219 | |||||||||||||||||||||||||||||||||||||||||||
| 220 | 20 | ▶ | for (my $i = 0; $i < @{$self->all_args}; $i++) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 221 | 15 | push @src => $self->all_args->[$i]->is_same_interface_inlined(sprintf('%s->all_args->[%d]', $v, $i)) | |||||||||||||||||||||||||||||||||||||||||
| 222 | } | ||||||||||||||||||||||||||||||||||||||||||
| 223 | |||||||||||||||||||||||||||||||||||||||||||
| 224 | 20 | return join "\n && ", @src; | |||||||||||||||||||||||||||||||||||||||||
| 225 | } | ||||||||||||||||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||||||||||||||||
| 227 | 24 | ▶ | sub is_relaxed_same_interface_inlined { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_relaxed_same_interface_inlined: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 228 | 24 | my ($self, $v) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 229 | |||||||||||||||||||||||||||||||||||||||||||
| 230 | 24 | my @src; | |||||||||||||||||||||||||||||||||||||||||
| 231 | |||||||||||||||||||||||||||||||||||||||||||
| 232 | 24 | push @src => sprintf("Scalar::Util::blessed(%s) && %s->isa('Sub::Meta::Parameters')", $v, $v); | |||||||||||||||||||||||||||||||||||||||||
| 233 | |||||||||||||||||||||||||||||||||||||||||||
| 234 | 24 | ▶ | push @src => $self->slurpy->is_relaxed_same_interface_inlined(sprintf('%s->slurpy', $v)) if $self->has_slurpy; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 235 | |||||||||||||||||||||||||||||||||||||||||||
| 236 | 24 | push @src => sprintf('%d == %s->nshift', $self->nshift, $v); | |||||||||||||||||||||||||||||||||||||||||
| 237 | |||||||||||||||||||||||||||||||||||||||||||
| 238 | 24 | push @src => sprintf('%d <= @{%s->all_args}', scalar @{$self->all_args}, $v); | |||||||||||||||||||||||||||||||||||||||||
| 239 | |||||||||||||||||||||||||||||||||||||||||||
| 240 | 24 | ▶ | for (my $i = 0; $i < @{$self->all_args}; $i++) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 241 | 21 | push @src => $self->all_args->[$i]->is_relaxed_same_interface_inlined(sprintf('%s->all_args->[%d]', $v, $i)) | |||||||||||||||||||||||||||||||||||||||||
| 242 | } | ||||||||||||||||||||||||||||||||||||||||||
| 243 | |||||||||||||||||||||||||||||||||||||||||||
| 244 | 24 | return join "\n && ", @src; | |||||||||||||||||||||||||||||||||||||||||
| 245 | } | ||||||||||||||||||||||||||||||||||||||||||
| 246 | |||||||||||||||||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||||||||||||||||
| 248 | 25 | ▶ | sub error_message { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
error_message: called CC=12 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 249 | 25 | my ($self, $other) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 250 | |||||||||||||||||||||||||||||||||||||||||||
| 251 | 25 | ▶ | return sprintf('other parameters must be Sub::Meta::Parameters. got: %s', $other // 'Undef') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%5/5
builtin::blessed($other) and $other->isa("Sub::Meta::Parameters")
$other // "Undef"
MC/DC100%2/2
builtin::blessed($other) and $other->isa("Sub::Meta::Parameters")
builtin::blessed($other)
$other->isa("Sub::Meta::Parameters")
MC/DC100%1/1
$other // "Undef"
$other
Truth table100%3/3
A and B
A= builtin::blessed($other)B= $other->isa("Sub::Meta::Parameters")
Truth table100%2/2
A
A= $other
| |||||||||||||||||||||||||||||||||||||||||||
| 252 | unless Scalar::Util::blessed($other) && $other->isa('Sub::Meta::Parameters'); | ||||||||||||||||||||||||||||||||||||||||||
| 253 | |||||||||||||||||||||||||||||||||||||||||||
| 254 | 23 | ▶ | if ($self->has_slurpy) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 255 | 3 | ▶ | return sprintf('invalid slurpy. got: %s, expected: %s', $other->has_slurpy ? $other->slurpy->display : '', $self->slurpy->display) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 256 | unless $self->slurpy->is_same_interface($other->slurpy) | ||||||||||||||||||||||||||||||||||||||||||
| 257 | } | ||||||||||||||||||||||||||||||||||||||||||
| 258 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 259 | 20 | ▶ | return 'should not have slurpy' if $other->has_slurpy; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 260 | } | ||||||||||||||||||||||||||||||||||||||||||
| 261 | |||||||||||||||||||||||||||||||||||||||||||
| 262 | 20 | ▶ | return sprintf('nshift is not equal. got: %d, expected: %d', $other->nshift, $self->nshift) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 263 | unless $self->nshift == $other->nshift; | ||||||||||||||||||||||||||||||||||||||||||
| 264 | |||||||||||||||||||||||||||||||||||||||||||
| 265 | 4 | return sprintf('invalid args length. got: %d, expected: %d', scalar @{$other->all_args}, scalar @{$self->all_args}) | |||||||||||||||||||||||||||||||||||||||||
| 266 | 17 | ▶ | unless @{$self->all_args} == @{$other->all_args}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 267 | |||||||||||||||||||||||||||||||||||||||||||
| 268 | 13 | ▶ | for (my $i = 0; $i < @{$self->all_args}; $i++) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 269 | 10 | my $s = $self->all_args->[$i]; | |||||||||||||||||||||||||||||||||||||||||
| 270 | 10 | my $o = $other->all_args->[$i]; | |||||||||||||||||||||||||||||||||||||||||
| 271 | 10 | ▶ | return sprintf('args[%d] is invalid. got: %s, expected: %s', $i, $o->display, $s->display) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 272 | unless $s->is_same_interface($o); | ||||||||||||||||||||||||||||||||||||||||||
| 273 | } | ||||||||||||||||||||||||||||||||||||||||||
| 274 | |||||||||||||||||||||||||||||||||||||||||||
| 275 | 8 | return ''; | |||||||||||||||||||||||||||||||||||||||||
| 276 | } | ||||||||||||||||||||||||||||||||||||||||||
| 277 | |||||||||||||||||||||||||||||||||||||||||||
| 278 | 25 | ▶ | sub relaxed_error_message { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
relaxed_error_message: called CC=11 SCAR=24.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 279 | 25 | my ($self, $other) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 280 | |||||||||||||||||||||||||||||||||||||||||||
| 281 | 25 | ▶ | return sprintf('other parameters must be Sub::Meta::Parameters. got: %s', $other // 'Undef') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%5/5
builtin::blessed($other) and $other->isa("Sub::Meta::Parameters")
$other // "Undef"
MC/DC100%2/2
builtin::blessed($other) and $other->isa("Sub::Meta::Parameters")
builtin::blessed($other)
$other->isa("Sub::Meta::Parameters")
MC/DC100%1/1
$other // "Undef"
$other
Truth table100%3/3
A and B
A= builtin::blessed($other)B= $other->isa("Sub::Meta::Parameters")
Truth table100%2/2
A
A= $other
| |||||||||||||||||||||||||||||||||||||||||||
| 282 | unless Scalar::Util::blessed($other) && $other->isa('Sub::Meta::Parameters'); | ||||||||||||||||||||||||||||||||||||||||||
| 283 | |||||||||||||||||||||||||||||||||||||||||||
| 284 | 23 | ▶ | if ($self->has_slurpy) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 285 | 3 | ▶ | return sprintf('invalid slurpy. got: %s, expected: %s', $other->has_slurpy ? $other->slurpy->display : '', $self->slurpy->display) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 286 | unless $self->slurpy->is_same_interface($other->slurpy) | ||||||||||||||||||||||||||||||||||||||||||
| 287 | } | ||||||||||||||||||||||||||||||||||||||||||
| 288 | |||||||||||||||||||||||||||||||||||||||||||
| 289 | 21 | ▶ | return sprintf('nshift is not equal. got: %d, expected: %d', $other->nshift, $self->nshift) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 290 | unless $self->nshift == $other->nshift; | ||||||||||||||||||||||||||||||||||||||||||
| 291 | |||||||||||||||||||||||||||||||||||||||||||
| 292 | 3 | return sprintf('invalid args length. got: %d, expected: %d', scalar @{$other->all_args}, scalar @{$self->all_args}) | |||||||||||||||||||||||||||||||||||||||||
| 293 | 18 | ▶ | unless @{$self->all_args} <= @{$other->all_args}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 294 | |||||||||||||||||||||||||||||||||||||||||||
| 295 | 15 | ▶ | for (my $i = 0; $i < @{$self->all_args}; $i++) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 296 | 10 | my $s = $self->all_args->[$i]; | |||||||||||||||||||||||||||||||||||||||||
| 297 | 10 | my $o = $other->all_args->[$i]; | |||||||||||||||||||||||||||||||||||||||||
| 298 | 10 | ▶ | return sprintf('args[%d] is invalid. got: %s, expected: %s', $i, $o->display, $s->display) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 299 | unless $s->is_relaxed_same_interface($o); | ||||||||||||||||||||||||||||||||||||||||||
| 300 | } | ||||||||||||||||||||||||||||||||||||||||||
| 301 | |||||||||||||||||||||||||||||||||||||||||||
| 302 | 10 | return ''; | |||||||||||||||||||||||||||||||||||||||||
| 303 | } | ||||||||||||||||||||||||||||||||||||||||||
| 304 | 36 | ▶ | sub display { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
display: called CC=8 SCAR=20.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 305 | 36 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 306 | |||||||||||||||||||||||||||||||||||||||||||
| 307 | 36 | my $s = ''; | |||||||||||||||||||||||||||||||||||||||||
| 308 | 36 | ▶ | if ($self->has_invocant) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 309 | 4 | my $d = $self->invocant->display; | |||||||||||||||||||||||||||||||||||||||||
| 310 | 4 | ▶ | $s .= "$d: " if $d; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 311 | } | ||||||||||||||||||||||||||||||||||||||||||
| 312 | |||||||||||||||||||||||||||||||||||||||||||
| 313 | 36 | ▶ | if ($self->has_args) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 314 | 24 | $s .= join ', ', map { $_->display } @{$self->args}; | |||||||||||||||||||||||||||||||||||||||||
| 315 | } | ||||||||||||||||||||||||||||||||||||||||||
| 316 | |||||||||||||||||||||||||||||||||||||||||||
| 317 | 36 | ▶ | if ($self->has_slurpy) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 318 | 3 | ▶ | $s .= ', ' if $s; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 319 | 3 | $s .= $self->slurpy->display; | |||||||||||||||||||||||||||||||||||||||||
| 320 | } | ||||||||||||||||||||||||||||||||||||||||||
| 321 | |||||||||||||||||||||||||||||||||||||||||||
| 322 | 36 | ▶ | if(!$self->has_args && !$self->has_slurpy) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$self->has_args or $self->has_slurpy
MC/DC100%2/2
$self->has_args or $self->has_slurpy
$self->has_args
$self->has_slurpy
Truth table100%3/3
A or B
A= $self->has_argsB= $self->has_slurpy
| |||||||||||||||||||||||||||||||||||||||||||
| 323 | 11 | $s .= '*'; | |||||||||||||||||||||||||||||||||||||||||
| 324 | } | ||||||||||||||||||||||||||||||||||||||||||
| 325 | |||||||||||||||||||||||||||||||||||||||||||
| 326 | 36 | return $s; | |||||||||||||||||||||||||||||||||||||||||
| 327 | } | ||||||||||||||||||||||||||||||||||||||||||
| 328 | |||||||||||||||||||||||||||||||||||||||||||
| 329 | 34 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 330 | __END__ | ||||||||||||||||||||||||||||||||||||||||||