| 1 | package Class::DBI::Plugin::PseudoColumns; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use Data::Dumper (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use vars qw($VERSION); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | 1 | $VERSION = 0.03; | |||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||
| 10 | 1 | ▶ | sub import { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
import: called CC=6 SCAR=35.9
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | 1 | my $class = shift; | |||||||||||||||||||||||||||||||||||||||||
| 12 | 1 | my $pkg = caller; | |||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||
| 14 | 1 | ▶ | return unless $pkg->isa('Class::DBI'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | 0 | ▶ | if ($pkg->isa('Class::DBI')) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 16 | 0 | $pkg->mk_classdata('_p_column_groups'); | |||||||||||||||||||||||||||||||||||||||||
| 17 | 0 | $pkg->mk_classdata('_serializer'); | |||||||||||||||||||||||||||||||||||||||||
| 18 | } | ||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||
| 20 | 1 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||
| 22 | 0 | ▶ | *{"$pkg\::pseudo_columns"} = sub { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=12 SCAR=50.5
| |||||||||||||||||||||||||||||||||||||||||||
| 23 | 0 | my $class = shift; | |||||||||||||||||||||||||||||||||||||||||
| 24 | 0 | ▶ | croak "You must set table before call pseudo_columns()" | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 25 | unless defined $class->table; | ||||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | my $parent_column = shift; | |||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | my $p_col_groups = $class->_p_column_groups; | |||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | ▶ | if (defined $_[0]) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | my @colnames = @_; | |||||||||||||||||||||||||||||||||||||||||
| 30 | 0 | $p_col_groups->{$class}->{$parent_column} = \@colnames; | |||||||||||||||||||||||||||||||||||||||||
| 31 | 0 | $class->_p_column_groups($p_col_groups); | |||||||||||||||||||||||||||||||||||||||||
| 32 | 0 | for my $p_column (@colnames) { | |||||||||||||||||||||||||||||||||||||||||
| 33 | 0 | ▶ | *{"$class\::$p_column"} = sub { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||
| 34 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 35 | 0 | my $property = $self->__deserialize($parent_column); | |||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | $property->{$p_column} = shift; | |||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | my $serialized = | |||||||||||||||||||||||||||||||||||||||||
| 39 | $self->__serialize($parent_column => $property); | ||||||||||||||||||||||||||||||||||||||||||
| 40 | 0 | $self->$parent_column($serialized); | |||||||||||||||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||||||||||||||||
| 42 | 0 | return $property->{$p_column}; | |||||||||||||||||||||||||||||||||||||||||
| 43 | 0 | }; | |||||||||||||||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||||||||||||||
| 46 | elsif (defined $parent_column) { | ||||||||||||||||||||||||||||||||||||||||||
| 47 | return unless ref($p_col_groups) eq 'HASH' && | ||||||||||||||||||||||||||||||||||||||||||
| 48 | ref($p_col_groups->{$class}) eq 'HASH' && | ||||||||||||||||||||||||||||||||||||||||||
| 49 | 0 | ▶ | ref($p_col_groups->{$class}->{$parent_column}) eq 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
ref $p_col_groups eq "HASH" and ref $p_col_groups->{$class} eq "HASH" and ref $p_col_groups->{$class}{$parent_column} eq "ARRAY"
ref $p_col_groups eq "HASH" and ref $p_col_groups->{$class} eq "HASH"
MC/DC0%0/3
ref $p_col_groups eq "HASH" and ref $p_col_groups->{$class} eq "HASH" and ref $p_col_groups->{$class}{$parent_column} eq "ARRAY"
ref $p_col_groups eq "HASH"
ref $p_col_groups->{$class} eq "HASH"
ref $p_col_groups->{$class}{$parent_column} eq "ARRAY"
Truth table0%0/4
A and B and C
A= ref $p_col_groups eq "HASH"B= ref $p_col_groups->{$class} eq "HASH"C= ref $p_col_groups->{$class}{$parent_column} eq "ARRAY"
| |||||||||||||||||||||||||||||||||||||||||||
| 50 | 0 | return @{$p_col_groups->{$class}->{$parent_column}}; | |||||||||||||||||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||||||||||||||||
| 52 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 53 | return unless ref($p_col_groups) eq 'HASH' && | ||||||||||||||||||||||||||||||||||||||||||
| 54 | 0 | ▶ | ref($p_col_groups->{$class}) eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
ref $p_col_groups eq "HASH" and ref $p_col_groups->{$class} eq "HASH"
MC/DC0%0/2
ref $p_col_groups eq "HASH" and ref $p_col_groups->{$class} eq "HASH"
ref $p_col_groups eq "HASH"
ref $p_col_groups->{$class} eq "HASH"
Truth table0%0/3
A and B
A= ref $p_col_groups eq "HASH"B= ref $p_col_groups->{$class} eq "HASH"
| |||||||||||||||||||||||||||||||||||||||||||
| 55 | 0 | my @pseudo_cols = (); | |||||||||||||||||||||||||||||||||||||||||
| 56 | 0 | for my $col (keys %{$p_col_groups->{$class}}) { | |||||||||||||||||||||||||||||||||||||||||
| 57 | 0 | ▶ | next unless ref($p_col_groups->{$class}->{$col}) eq 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 58 | 0 | push @pseudo_cols, @{$p_col_groups->{$class}->{$col}}; | |||||||||||||||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||||||||||||||||
| 60 | 0 | return @pseudo_cols; | |||||||||||||||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||||||||||||||||
| 62 | 0 | }; | |||||||||||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||||||||||||
| 64 | 0 | my $super_create = $pkg->can('create'); | |||||||||||||||||||||||||||||||||||||||||
| 65 | 0 | ▶ | croak "create() method can not be called in $pkg" unless $super_create; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 66 | 0 | ▶ | *{"$pkg\::create"} = sub { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=7 SCAR=40.3
| |||||||||||||||||||||||||||||||||||||||||||
| 67 | 0 | my($class, $hashref) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 68 | 0 | ▶ | croak "create needs a hashref" unless ref($hashref) eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 69 | 0 | ▶ | croak "You must set table before call create()" | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 70 | unless defined $class->table; | ||||||||||||||||||||||||||||||||||||||||||
| 71 | 0 | my %cols_check = map { $_ => 1 } $class->pseudo_columns; | |||||||||||||||||||||||||||||||||||||||||
| 72 | 0 | my %p_values = (); | |||||||||||||||||||||||||||||||||||||||||
| 73 | 0 | for my $col (keys %$hashref) { | |||||||||||||||||||||||||||||||||||||||||
| 74 | 0 | ▶ | next unless $cols_check{$col}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 75 | 0 | $p_values{$col} = delete $hashref->{$col}; | |||||||||||||||||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||||||||||||||||
| 77 | 0 | my $row = $class->$super_create($hashref); # create() | |||||||||||||||||||||||||||||||||||||||||
| 78 | 0 | ▶ | if (%p_values) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 79 | 0 | for my $col (keys %p_values) { | |||||||||||||||||||||||||||||||||||||||||
| 80 | 0 | $row->$col($p_values{$col}); | |||||||||||||||||||||||||||||||||||||||||
| 81 | } | ||||||||||||||||||||||||||||||||||||||||||
| 82 | 0 | $row->update; | |||||||||||||||||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | return $row; | |||||||||||||||||||||||||||||||||||||||||
| 85 | 0 | }; | |||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||
| 87 | 0 | my $super_set = $pkg->can('set'); | |||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | ▶ | croak "set() method can not be called in $pkg" unless $super_set; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 89 | 0 | ▶ | *{"$pkg\::set"} = sub { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=7 SCAR=40.3
| |||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 91 | 0 | my $column_values = {@_}; | |||||||||||||||||||||||||||||||||||||||||
| 92 | 0 | ▶ | my $class = ref($self) || $self; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
ref $self || $self
MC/DC0%0/2
ref $self || $self
ref $self
$self
Truth table0%0/3
A || B
A= ref $selfB= $self
| |||||||||||||||||||||||||||||||||||||||||||
| 93 | 0 | my %cols_check = map { $_ => 1 } $class->pseudo_columns; | |||||||||||||||||||||||||||||||||||||||||
| 94 | 0 | my %p_values = (); | |||||||||||||||||||||||||||||||||||||||||
| 95 | 0 | for my $col (keys %$column_values) { | |||||||||||||||||||||||||||||||||||||||||
| 96 | 0 | ▶ | next unless $cols_check{$col}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 97 | 0 | $p_values{$col} = delete $column_values->{$col}; | |||||||||||||||||||||||||||||||||||||||||
| 98 | } | ||||||||||||||||||||||||||||||||||||||||||
| 99 | 0 | ▶ | $self->$super_set(%$column_values) if %$column_values; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 100 | 0 | ▶ | if (%p_values) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 101 | 0 | for my $col (keys %p_values) { | |||||||||||||||||||||||||||||||||||||||||
| 102 | 0 | $self->$col($p_values{$col}); | |||||||||||||||||||||||||||||||||||||||||
| 103 | } | ||||||||||||||||||||||||||||||||||||||||||
| 104 | } | ||||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | }; | |||||||||||||||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||||||||||||||
| 107 | 0 | for my $export (qw(__serialize __deserialize serializer deserializer)) { | |||||||||||||||||||||||||||||||||||||||||
| 108 | 0 | *{"$pkg\::$export"} = \&$export; | |||||||||||||||||||||||||||||||||||||||||
| 109 | } | ||||||||||||||||||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||||||||||||||||
| 112 | 0 | ▶ | sub serializer { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
serializer: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 113 | 0 | my($class, $parent_column, $subref) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 114 | 0 | ▶ | croak "You must set table before call serializer()" | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 115 | unless defined $class->table; | ||||||||||||||||||||||||||||||||||||||||||
| 116 | 0 | my $serializer = $class->_serializer; | |||||||||||||||||||||||||||||||||||||||||
| 117 | 0 | ▶ | if (ref($subref) eq 'CODE') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 118 | 0 | $serializer->{serializer} = { $parent_column => $subref }; | |||||||||||||||||||||||||||||||||||||||||
| 119 | 0 | $class->_serializer($serializer); | |||||||||||||||||||||||||||||||||||||||||
| 120 | } | ||||||||||||||||||||||||||||||||||||||||||
| 121 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 122 | 0 | carp "Usage: __PACKAGE__->serializer(parent_column => \$subref)"; | |||||||||||||||||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | ▶ | sub deserializer { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
deserializer: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 127 | 0 | my($class, $parent_column, $subref) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 128 | 0 | ▶ | croak "You must set table before call deserializer()" | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 129 | unless defined $class->table; | ||||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | my $serializer = $class->_serializer; | |||||||||||||||||||||||||||||||||||||||||
| 131 | 0 | ▶ | if (ref($subref) eq 'CODE') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 132 | 0 | $serializer->{deserializer} = { $parent_column => $subref }; | |||||||||||||||||||||||||||||||||||||||||
| 133 | 0 | $class->_serializer($serializer); | |||||||||||||||||||||||||||||||||||||||||
| 134 | } | ||||||||||||||||||||||||||||||||||||||||||
| 135 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 136 | 0 | carp "Usage: __PACKAGE__->deserializer(parent_column => \$subref)"; | |||||||||||||||||||||||||||||||||||||||||
| 137 | } | ||||||||||||||||||||||||||||||||||||||||||
| 138 | } | ||||||||||||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||||||||||
| 140 | 0 | ▶ | sub __serialize { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__serialize: not called CC=6 SCAR=37.4
| |||||||||||||||||||||||||||||||||||||||||||
| 141 | 0 | my($self, $column, $var) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 142 | 0 | ▶ | my $class = ref($self) || $self; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
ref $self || $self
MC/DC0%0/2
ref $self || $self
ref $self
$self
Truth table0%0/3
A || B
A= ref $selfB= $self
| |||||||||||||||||||||||||||||||||||||||||||
| 143 | 0 | ▶ | croak "Can't lookup the table name via table() method." | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 144 | unless defined $class->table; | ||||||||||||||||||||||||||||||||||||||||||
| 145 | 0 | my $serializer = $class->_serializer; | |||||||||||||||||||||||||||||||||||||||||
| 146 | 0 | ▶ | if (ref($serializer->{serializer}) eq 'HASH' && | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
ref $serializer->{"serializer"} eq "HASH" and exists $serializer->{"serializer"}{$column} and ref $serializer->{"serializer"}{$column} eq "CODE"
ref $serializer->{"serializer"} eq "HASH" and exists $serializer->{"serializer"}{$column}
MC/DC0%0/3
ref $serializer->{"serializer"} eq "HASH" and exists $serializer->{"serializer"}{$column} and ref $serializer->{"serializer"}{$column} eq "CODE"
ref $serializer->{"serializer"} eq "HASH"
exists $serializer->{"serializer"}{$column}
ref $serializer->{"serializer"}{$column} eq "CODE"
Truth table0%0/4
A and B and C
A= ref $serializer->{"serializer"} eq "HASH"B= exists $serializer->{"serializer"}{$column}C= ref $serializer->{"serializer"}{$column} eq "CODE"
| |||||||||||||||||||||||||||||||||||||||||||
| 147 | exists $serializer->{serializer}->{$column} && | ||||||||||||||||||||||||||||||||||||||||||
| 148 | ref($serializer->{serializer}->{$column}) eq 'CODE') { | ||||||||||||||||||||||||||||||||||||||||||
| 149 | 0 | return $serializer->{serializer}->{$column}->($var); | |||||||||||||||||||||||||||||||||||||||||
| 150 | } | ||||||||||||||||||||||||||||||||||||||||||
| 151 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 152 | 0 | local $Data::Dumper::Terse = 1; | |||||||||||||||||||||||||||||||||||||||||
| 153 | 0 | local $Data::Dumper::Indent = 0; | |||||||||||||||||||||||||||||||||||||||||
| 154 | 0 | return Data::Dumper::Dumper($var); | |||||||||||||||||||||||||||||||||||||||||
| 155 | } | ||||||||||||||||||||||||||||||||||||||||||
| 156 | } | ||||||||||||||||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||||||||||||||||
| 158 | 0 | ▶ | sub __deserialize { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__deserialize: not called CC=9 SCAR=45.0
| |||||||||||||||||||||||||||||||||||||||||||
| 159 | 0 | my($self, $column) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 160 | 0 | ▶ | my $class = ref($self) || $self; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
ref $self || $self
MC/DC0%0/2
ref $self || $self
ref $self
$self
Truth table0%0/3
A || B
A= ref $selfB= $self
| |||||||||||||||||||||||||||||||||||||||||||
| 161 | 0 | ▶ | croak "Can't lookup the table name via table() method." | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 162 | unless defined $class->table; | ||||||||||||||||||||||||||||||||||||||||||
| 163 | 0 | my $prop; | |||||||||||||||||||||||||||||||||||||||||
| 164 | 0 | my $dumped = $self->$column; | |||||||||||||||||||||||||||||||||||||||||
| 165 | 0 | ▶ | if (defined $dumped) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 166 | 0 | my $serializer = $class->_serializer; | |||||||||||||||||||||||||||||||||||||||||
| 167 | 0 | ▶ | if (ref($serializer->{deserializer}) eq 'HASH' && | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
ref $serializer->{"deserializer"} eq "HASH" and exists $serializer->{"deserializer"}{$column} and ref $serializer->{"deserializer"}{$column} eq "CODE"
ref $serializer->{"deserializer"} eq "HASH" and exists $serializer->{"deserializer"}{$column}
MC/DC0%0/3
ref $serializer->{"deserializer"} eq "HASH" and exists $serializer->{"deserializer"}{$column} and ref $serializer->{"deserializer"}{$column} eq "CODE"
ref $serializer->{"deserializer"} eq "HASH"
exists $serializer->{"deserializer"}{$column}
ref $serializer->{"deserializer"}{$column} eq "CODE"
Truth table0%0/4
A and B and C
A= ref $serializer->{"deserializer"} eq "HASH"B= exists $serializer->{"deserializer"}{$column}C= ref $serializer->{"deserializer"}{$column} eq "CODE"
| |||||||||||||||||||||||||||||||||||||||||||
| 168 | exists $serializer->{deserializer}->{$column} && | ||||||||||||||||||||||||||||||||||||||||||
| 169 | ref($serializer->{deserializer}->{$column}) eq 'CODE') { | ||||||||||||||||||||||||||||||||||||||||||
| 170 | 0 | $prop = $serializer->{deserializer}->{$column}->($dumped); | |||||||||||||||||||||||||||||||||||||||||
| 171 | } | ||||||||||||||||||||||||||||||||||||||||||
| 172 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 173 | 0 | $prop = eval qq{ $dumped }; | |||||||||||||||||||||||||||||||||||||||||
| 174 | } | ||||||||||||||||||||||||||||||||||||||||||
| 175 | } | ||||||||||||||||||||||||||||||||||||||||||
| 176 | 0 | ▶ | return $prop if defined $prop && ref($prop) eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $prop and ref $prop eq "HASH"
MC/DC0%0/2
defined $prop and ref $prop eq "HASH"
defined $prop
ref $prop eq "HASH"
Truth table0%0/3
A and B
A= defined $propB= ref $prop eq "HASH"
| |||||||||||||||||||||||||||||||||||||||||||
| 177 | 0 | return {}; | |||||||||||||||||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||||||||||||||||
| 180 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 181 | |||||||||||||||||||||||||||||||||||||||||||
| 182 | __END__ | ||||||||||||||||||||||||||||||||||||||||||