| 1 | package Class::props ; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 9 | $VERSION = 2.40 ; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 9 | ▶ | use 5.006_001 ; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 9 | ▶ | use strict ; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | # This file uses the "Perlish" coding style | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | # please read http://perl.4pro.net/perlish_coding_style.html | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | ; use Carp | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 9 | ▶ | ; $Carp::Internal{+__PACKAGE__}++ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | ; sub import | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 15 | ▶ | { my $tool = shift | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
import: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 15 | ; $tool->add_to(scalar caller, @_) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | ; sub add_to | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 15 | ▶ | { my ($tool, $pkg, @args) = @_ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_to: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 15 | ; foreach my $prop ( @args ) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 43 | { $prop = $tool->_init_prop_param( $prop ) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 43 | ; $tool->_add_prop( $pkg, $prop ) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | ; sub _init_prop_param | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 54 | ▶ | { my ( $tool, $prop ) = @_ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_init_prop_param: called CC=5 SCAR=16.3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 54 | ▶ | ; $prop = { name => $prop } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | unless ref $prop eq 'HASH' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | ; $$prop{name} = [ $$prop{name} ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 54 | ▶ | unless ref $$prop{name} eq 'ARRAY' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | ; $$prop{allowed} &&= [ $$prop{allowed} ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 54 | ▶ | unless ref $$prop{allowed} eq 'ARRAY' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$prop->{"allowed"} &&= [$prop->{"allowed"}]
MC/DC0%0/1
$prop->{"allowed"} &&= [$prop->{"allowed"}]
$prop->{"allowed"}
Truth table50%1/2
A
A= $prop->{"allowed"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 54 | ; $prop | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | ; sub _add_prop | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 54 | ▶ | { my ( $tool, $pkg, $prop ) = @_ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_add_prop: called CC=6 SCAR=18.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | ; my $gr = delete $$prop{group} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 54 | ; my $to_tie = ( defined $$prop{default} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | || defined $$prop{protected} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | || defined $$prop{allowed} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | || defined $$prop{validation} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | || defined $$prop{post_process} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 54 | ▶ | ; foreach my $n ( @{$$prop{name}} ) # foreach property | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition83%10/12
defined $prop->{'default'} || defined $prop->{'protected'} || defined $prop->{'allowed'} || defined $prop->{'validation'} || defined $prop->{'post_process'}
defined $prop->{"default"} or defined $prop->{"protected"} or defined $prop->{"allowed"} or defined $prop->{"validation"}
defined $prop->{"default"} or defined $prop->{"protected"} or defined $prop->{"allowed"}
defined $prop->{"default"} or defined $prop->{"protected"}
MC/DC60%3/5
defined $prop->{'default'} || defined $prop->{'protected'} || defined $prop->{'allowed'} || defined $prop->{'validation'} || defined $prop->{'post_process'}
defined $prop->{"default"}
defined $prop->{"protected"}
defined $prop->{"allowed"}
defined $prop->{"validation"}
defined $prop->{'post_process'}
Truth table66%4/6
A or B or C or D || E
A= defined $prop->{"default"}B= defined $prop->{"protected"}C= defined $prop->{"allowed"}D= defined $prop->{"validation"}E= defined $prop->{'post_process'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 9 | { no strict 'refs' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 9 | ▶ | ; *{$pkg.'::'.$n} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | = sub : lvalue | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 235 | ▶ | { (@_ > 2) && croak qq(Too many arguments for "$n" property, died) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=11 SCAR=24.1
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | ; my $scalar | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | = $tool =~ /^Class/ ? $gr | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 22 | ▶ | ? \${(ref $_[0]||$_[0]).'::'.$gr}{$n} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
ref $_[0] || $_[0]
MC/DC0%0/2
ref $_[0] || $_[0]
ref $_[0]
$_[0]
Truth table66%2/3
A || B
A= ref $_[0]B= $_[0]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 52 | ▶ | : \${(ref $_[0]||$_[0]).'::'.$n} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition66%2/3
ref $_[0] || $_[0]
MC/DC0%0/2
ref $_[0] || $_[0]
ref $_[0]
$_[0]
Truth table66%2/3
A || B
A= ref $_[0]B= $_[0]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | : $tool =~ /^Package/ ? $gr | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 15 | ? \${$pkg.'::'.$gr}{$n} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 62 | ▶ | : \${$pkg.'::'.$n} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | : $gr | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | ? \$_[0]{$gr}{$n} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 235 | ▶ | : \$_[0]{$n} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 235 | ; my $Tscalar | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 235 | ▶ | ; if ( $to_tie ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 168 | { tie $$Tscalar | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | , 'Class::props::Tie' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | , $_[0] # [0] object/class | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | , $n # [1] prop name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | , $scalar # [2] lvalue ref | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | , $prop # [3] options ref | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 67 | { $Tscalar = $scalar | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 235 | ▶ | ; @_ == 2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | ? ( $$Tscalar = $_[1] ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | : $$Tscalar | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 64 | } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | ; package Class::props::Tie | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | ; use Carp | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 9 | ▶ | ; $Carp::Internal{+__PACKAGE__}++ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | ; use strict | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 9 | ▶ | ; sub TIESCALAR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 168 | ▶ | { bless \@_, shift | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
TIESCALAR: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | ; sub FETCH | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | { my $val = do | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 102 | ▶ | { if ( defined ${$_[0][2]} ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
FETCH: called CC=6 SCAR=18.3
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 58 | { ${$_[0][2]} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | elsif ( defined $_[0][3]{default} ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | { my $def = ref $_[0][3]{default} eq 'CODE' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | ? $_[0][3]{default}( $_[0][0] ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | : $_[0][3]{default} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 44 | ▶ | ; $_[0][3]{no_strict} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 44 | ▶ | ? ${$_[0][2]} = $def | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | : $_[0]->STORE( $def ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | { undef | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 0 | } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 102 | ; local $_ = $val | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | ; defined $_[0][3]{post_process} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 102 | ▶ | ? $_[0][3]{post_process}( $_[0][0], $val ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | : $val | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | ; sub STORE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 128 | ▶ | { my $from_FETCH = (caller(1))[3] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
STORE: called CC=18 SCAR=33.8
Condition100%3/3
(caller 1)[3] && (caller 1)[3] =~ /::FETCH$/
MC/DC100%2/2
(caller 1)[3] && (caller 1)[3] =~ /::FETCH$/
(caller 1)[3]
(caller 1)[3] =~ /::FETCH$/
Truth table100%3/3
A && B
A= (caller 1)[3]B= (caller 1)[3] =~ /::FETCH$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | && (caller(1))[3] =~ /::FETCH$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 128 | ▶ | ; my $default = $from_FETCH | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | ? 'default ' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | : '' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 128 | ▶ | ; if ( $_[0][3]{protected} # if protected | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
$_[0][3]{"protected"} and not $from_FETCH and not $Class::props::force
$_[0][3]{"protected"} and not $from_FETCH
MC/DC66%2/3
$_[0][3]{"protected"} and not $from_FETCH and not $Class::props::force
$_[0][3]{"protected"}
not $from_FETCH
not $Class::props::force
Truth table75%3/4
A and not(B) and not(C)
A= $_[0][3]{"protected"}B= not $from_FETCHC= not $Class::props::force
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | &&! $from_FETCH # bypass for default | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | &&! $Class::props::force # bypass deliberately | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 18 | { my ($OK, $f) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 18 | ▶ | ; until ( $OK ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 36 | ▶ | { last unless my $caller = caller($f++) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 30 | ; $OK = $caller->can($_[0][1]) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 18 | ▶ | ; $OK || croak qq("$_[0][1]" is a read-only property, died) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 122 | ▶ | ; if ( $_[0][3]{allowed} # if restricted | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$_[0][3]{"allowed"} and not $from_FETCH and not $Class::props::force
$_[0][3]{"allowed"} and not $from_FETCH
MC/DC0%0/3
$_[0][3]{"allowed"} and not $from_FETCH and not $Class::props::force
$_[0][3]{"allowed"}
not $from_FETCH
not $Class::props::force
Truth table25%1/4
A and not(B) and not(C)
A= $_[0][3]{"allowed"}B= not $from_FETCHC= not $Class::props::force
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | &&! $from_FETCH # bypass for default | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | &&! $Class::props::force # bypass deliberately | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 0 | { my ($OK, $f) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 0 | ▶ | ; until ( $OK ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 0 | ▶ | { last unless my $caller = (caller($f++))[3] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 0 | ; $OK = grep { $caller =~ qr/$_/ } @{$_[0][3]{allowed}} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 0 | ▶ | ; $OK || croak qq("$_[0][1]" is a read-only property, died) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 122 | ; local $_ = $_[1] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 122 | ▶ | ; if ( defined $_[0][3]{validation} # validation subref | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $_[0][3]{"validation"} and defined $_
MC/DC50%1/2
defined $_[0][3]{"validation"} and defined $_
defined $_[0][3]{"validation"}
defined $_
Truth table66%2/3
A and B
A= defined $_[0][3]{"validation"}B= defined $_
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | && defined $_ # bypass for undef (reset to default) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 41 | ▶ | { $_[0][3]{validation}( $_[0][0], $_) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | || croak qq(Invalid ${default}value for "$_[0][1]" property, died) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 116 | ; ${$_[0][2]} = $_ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 9 | 1 ; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||