| 1 | package Class::Param::Tie; | ||||||||||||
| 2 | |||||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 2 | ▶ | use base 'Class::Param::Decorator'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | |||||||||||||
| 7 | 1 | ▶ | sub initialize { | ||||||||||
|
Subroutine
initialize: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 8 | 1 | my ( $instance, $decorated ) = @_; | |||||||||||
| 9 | |||||||||||||
| 10 | 1 | my $class = ref($instance); | |||||||||||
| 11 | 1 | my $self = {}; | |||||||||||
| 12 | |||||||||||||
| 13 | 1 | tie( %{ $self }, 'Class::Param::Tie::Param', $decorated ); | |||||||||||
| 14 | |||||||||||||
| 15 | 1 | return bless( $self, $class ); | |||||||||||
| 16 | } | ||||||||||||
| 17 | |||||||||||||
| 18 | 9 | ▶ | sub decorated { return tied( %{ shift() } )->decorated (@_) } | ||||||||||
|
Subroutine
decorated: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 19 | 4 | ▶ | sub add { return shift->decorated->add (@_) } | ||||||||||
|
Subroutine
add: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 20 | 1 | ▶ | sub count { return shift->decorated->count (@_) } | ||||||||||
|
Subroutine
count: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 21 | 3 | ▶ | sub param { return shift->decorated->param (@_) } | ||||||||||
|
Subroutine
param: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 22 | 0 | ▶ | sub scan { return shift->decorated->scan (@_) } | ||||||||||
|
Subroutine
scan: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 23 | 0 | ▶ | sub as_hash { return shift->decorated->as_hash (@_) } | ||||||||||
|
Subroutine
as_hash: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 24 | |||||||||||||
| 25 | package Class::Param::Tie::Param; | ||||||||||||
| 26 | |||||||||||||
| 27 | 2 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 28 | 2 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 29 | 2 | ▶ | use base 'Class::Param::Decorator'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 30 | |||||||||||||
| 31 | 21 | ▶ | sub iterator { | ||||||||||
|
Subroutine
iterator: called CC=2 SCAR=6.9
| |||||||||||||
| 32 | 21 | ▶ | return $_[0]->[1] ||= []; | ||||||||||
|
Condition100%2/2
$_[0][1] ||= []
MC/DC100%1/1
$_[0][1] ||= []
$_[0][1]
Truth table100%2/2
A
A= $_[0][1]
| |||||||||||||
| 33 | } | ||||||||||||
| 34 | |||||||||||||
| 35 | 1 | ▶ | sub TIEHASH { | ||||||||||
|
Subroutine
TIEHASH: called CC=1 SCAR=0.0
| |||||||||||||
| 36 | 1 | return shift->new(@_); | |||||||||||
| 37 | } | ||||||||||||
| 38 | |||||||||||||
| 39 | 21 | ▶ | sub FETCH { | ||||||||||
|
Subroutine
FETCH: called CC=1 SCAR=0.0
| |||||||||||||
| 40 | 21 | my ( $self, $name ) = @_; | |||||||||||
| 41 | 21 | return $self->decorated->get($name); | |||||||||||
| 42 | } | ||||||||||||
| 43 | |||||||||||||
| 44 | 2 | ▶ | sub STORE { | ||||||||||
|
Subroutine
STORE: called CC=1 SCAR=0.0
| |||||||||||||
| 45 | 2 | my ( $self, $name, $value ) = @_; | |||||||||||
| 46 | 2 | return $self->decorated->set( $name, $value ); | |||||||||||
| 47 | } | ||||||||||||
| 48 | |||||||||||||
| 49 | 1 | ▶ | sub DELETE { | ||||||||||
|
Subroutine
DELETE: called CC=1 SCAR=0.0
| |||||||||||||
| 50 | 1 | my ( $self, $name ) = @_; | |||||||||||
| 51 | 1 | return $self->decorated->remove($name); | |||||||||||
| 52 | } | ||||||||||||
| 53 | |||||||||||||
| 54 | 2 | ▶ | sub EXISTS { | ||||||||||
|
Subroutine
EXISTS: called CC=1 SCAR=0.0
| |||||||||||||
| 55 | 2 | my ( $self, $name ) = @_; | |||||||||||
| 56 | 2 | return $self->decorated->has($name); | |||||||||||
| 57 | } | ||||||||||||
| 58 | |||||||||||||
| 59 | 1 | ▶ | sub SCALAR { | ||||||||||
|
Subroutine
SCALAR: called CC=1 SCAR=0.0
| |||||||||||||
| 60 | 1 | my ( $self ) = @_; | |||||||||||
| 61 | 1 | return $self->decorated->count; | |||||||||||
| 62 | } | ||||||||||||
| 63 | |||||||||||||
| 64 | 3 | ▶ | sub FIRSTKEY { | ||||||||||
|
Subroutine
FIRSTKEY: called CC=1 SCAR=0.0
| |||||||||||||
| 65 | 3 | my ( $self ) = @_; | |||||||||||
| 66 | 3 | @{ $self->iterator } = $self->decorated->names; | |||||||||||
| 67 | 3 | return shift @{ $self->iterator }; | |||||||||||
| 68 | } | ||||||||||||
| 69 | |||||||||||||
| 70 | 15 | ▶ | sub NEXTKEY { | ||||||||||
|
Subroutine
NEXTKEY: called CC=1 SCAR=0.0
| |||||||||||||
| 71 | 15 | my ( $self, $last ) = @_; | |||||||||||
| 72 | 15 | return shift @{ $self->iterator }; | |||||||||||
| 73 | } | ||||||||||||
| 74 | |||||||||||||
| 75 | 2 | 1; | |||||||||||
| 76 | |||||||||||||
| 77 | __END__ | ||||||||||||