| 1 | 33 | ▶ | use 5.008; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 2 | 33 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 33 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | package Class::Scaffold::Accessor; | ||||||||||||||||||||||||||||
| 6 | 33 | ▶ | BEGIN { | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 33 | $Class::Scaffold::Accessor::VERSION = '1.102280'; | |||||||||||||||||||||||||||
| 8 | } | ||||||||||||||||||||||||||||
| 9 | # ABSTRACT: Construct framework-specific accessors | ||||||||||||||||||||||||||||
| 10 | 33 | ▶ | use Error::Hierarchy::Util 'assert_read_only'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 33 | ▶ | use Class::Scaffold::Factory::Type; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | 33 | ▶ | use parent qw( | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | Class::Accessor::Complex | ||||||||||||||||||||||||||||
| 14 | Class::Accessor::Constructor | ||||||||||||||||||||||||||||
| 15 | Class::Accessor::FactoryTyped | ||||||||||||||||||||||||||||
| 16 | 33 | ); | |||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 0 | ▶ | sub mk_framework_object_accessors { | ||||||||||||||||||||||||||
|
Subroutine
mk_framework_object_accessors: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 19 | 0 | my ($self, @args) = @_; | |||||||||||||||||||||||||||
| 20 | 0 | $self->mk_factory_typed_accessors('Class::Scaffold::Factory::Type', @args); | |||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 0 | ▶ | sub mk_framework_object_array_accessors { | ||||||||||||||||||||||||||
|
Subroutine
mk_framework_object_array_accessors: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 24 | 0 | my ($self, @args) = @_; | |||||||||||||||||||||||||||
| 25 | 0 | $self->mk_factory_typed_array_accessors('Class::Scaffold::Factory::Type', | |||||||||||||||||||||||||||
| 26 | @args); | ||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 0 | ▶ | sub mk_readonly_accessors { | ||||||||||||||||||||||||||
|
Subroutine
mk_readonly_accessors: not called CC=3 SCAR=22.7
Pod
documented
| |||||||||||||||||||||||||||||
| 30 | 0 | my ($self, @fields) = @_; | |||||||||||||||||||||||||||
| 31 | 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
| |||||||||||||||||||||||||||||
| 32 | 0 | for my $field (@fields) { | |||||||||||||||||||||||||||
| 33 | 33 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 34 | 0 | ▶ | *{"${class}::${field}"} = sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 35 | 0 | ▶ | local $DB::sub = local *__ANON__ = "${class}::${field}" | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined &DB::DB and not $Devel::DProf::VERSION
MC/DC0%0/2
defined &DB::DB and not $Devel::DProf::VERSION
defined &DB::DB
not $Devel::DProf::VERSION
Truth table0%0/3
A and not(B)
A= defined &DB::DBB= not $Devel::DProf::VERSION
| |||||||||||||||||||||||||||||
| 36 | if defined &DB::DB && !$Devel::DProf::VERSION; | ||||||||||||||||||||||||||||
| 37 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 38 | 0 | assert_read_only(@_); | |||||||||||||||||||||||||||
| 39 | 0 | $self->{$field}; | |||||||||||||||||||||||||||
| 40 | 0 | }; | |||||||||||||||||||||||||||
| 41 | 0 | ▶ | *{"${class}::set_${field}"} = *{"${class}::${field}_set"} = sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 42 | 0 | ▶ | local $DB::sub = local *__ANON__ = "${class}::${field}_set" | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined &DB::DB and not $Devel::DProf::VERSION
MC/DC0%0/2
defined &DB::DB and not $Devel::DProf::VERSION
defined &DB::DB
not $Devel::DProf::VERSION
Truth table0%0/3
A and not(B)
A= defined &DB::DBB= not $Devel::DProf::VERSION
| |||||||||||||||||||||||||||||
| 43 | if defined &DB::DB && !$Devel::DProf::VERSION; | ||||||||||||||||||||||||||||
| 44 | 0 | $_[0]->{$field} = $_[1]; | |||||||||||||||||||||||||||
| 45 | 0 | }; | |||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||
| 47 | 0 | $self; # for chaining | |||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||
| 49 | 33 | 1; | |||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | __END__ | ||||||||||||||||||||||||||||