| 1 | package Moose::Meta::Method::Accessor; | ||||||||||||||||||||||||||||
| 2 | 398 | our $VERSION = '2.4001'; | |||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | 398 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 398 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 398 | ▶ | use Try::Tiny; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 398 | ▶ | use parent 'Moose::Meta::Method', | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 398 | 'Class::MOP::Method::Accessor'; | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 398 | ▶ | use Moose::Util 'throw_exception'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | # multiple inheritance is terrible | ||||||||||||||||||||||||||||
| 15 | 4258 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 16 | 4258 | goto &Class::MOP::Method::Accessor::new; | |||||||||||||||||||||||||||
| 17 | } | ||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 3226 | ▶ | sub _new { | ||||||||||||||||||||||||||
|
Subroutine
_new: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 20 | 3226 | goto &Class::MOP::Method::Accessor::_new; | |||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 0 | ▶ | sub _error_thrower { | ||||||||||||||||||||||||||
|
Subroutine
_error_thrower: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 24 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 25 | 0 | ▶ | return $self->associated_attribute | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
ref $self and defined $self->associated_attribute
MC/DC0%0/2
ref $self and defined $self->associated_attribute
ref $self
defined $self->associated_attribute
Truth table0%0/3
A and B
A= ref $selfB= defined $self->associated_attribute
| |||||||||||||||||||||||||||||
| 26 | if ref($self) && defined($self->associated_attribute); | ||||||||||||||||||||||||||||
| 27 | 0 | return $self->SUPER::_error_thrower; | |||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 4255 | ▶ | sub _compile_code { | ||||||||||||||||||||||||||
|
Subroutine
_compile_code: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 31 | 4255 | my $self = shift; | |||||||||||||||||||||||||||
| 32 | 4255 | my @args = @_; | |||||||||||||||||||||||||||
| 33 | 4255 | ▶ | try { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 34 | 4255 | $self->SUPER::_compile_code(@args); | |||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||
| 36 | 1 | ▶ | catch { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 37 | 1 | throw_exception( CouldNotCreateWriter => attribute => $self->associated_attribute, | |||||||||||||||||||||||||||
| 38 | error => $_, | ||||||||||||||||||||||||||||
| 39 | instance => $self | ||||||||||||||||||||||||||||
| 40 | ); | ||||||||||||||||||||||||||||
| 41 | 4255 | }; | |||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 4255 | ▶ | sub _eval_environment { | ||||||||||||||||||||||||||
|
Subroutine
_eval_environment: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 45 | 4255 | my $self = shift; | |||||||||||||||||||||||||||
| 46 | 4255 | return $self->associated_attribute->_eval_environment; | |||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | 5359 | ▶ | sub _instance_is_inlinable { | ||||||||||||||||||||||||||
|
Subroutine
_instance_is_inlinable: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 50 | 5359 | my $self = shift; | |||||||||||||||||||||||||||
| 51 | 5359 | return $self->associated_attribute->associated_class->instance_metaclass->is_inlinable; | |||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | 2302 | ▶ | sub _generate_reader_method { | ||||||||||||||||||||||||||
|
Subroutine
_generate_reader_method: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||
| 55 | 2302 | my $self = shift; | |||||||||||||||||||||||||||
| 56 | 2302 | ▶ | $self->_instance_is_inlinable ? $self->_generate_reader_method_inline(@_) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 57 | : $self->SUPER::_generate_reader_method(@_); | ||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | 14 | ▶ | sub _generate_writer_method { | ||||||||||||||||||||||||||
|
Subroutine
_generate_writer_method: called CC=2 SCAR=7.2
| |||||||||||||||||||||||||||||
| 61 | 14 | my $self = shift; | |||||||||||||||||||||||||||
| 62 | 14 | ▶ | $self->_instance_is_inlinable ? $self->_generate_writer_method_inline(@_) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 63 | : $self->SUPER::_generate_writer_method(@_); | ||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | 283 | ▶ | sub _generate_accessor_method { | ||||||||||||||||||||||||||
|
Subroutine
_generate_accessor_method: called CC=2 SCAR=7.2
| |||||||||||||||||||||||||||||
| 67 | 283 | my $self = shift; | |||||||||||||||||||||||||||
| 68 | 283 | ▶ | $self->_instance_is_inlinable ? $self->_generate_accessor_method_inline(@_) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 69 | : $self->SUPER::_generate_accessor_method(@_); | ||||||||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | 162 | ▶ | sub _generate_predicate_method { | ||||||||||||||||||||||||||
|
Subroutine
_generate_predicate_method: called CC=2 SCAR=7.2
| |||||||||||||||||||||||||||||
| 73 | 162 | my $self = shift; | |||||||||||||||||||||||||||
| 74 | 162 | ▶ | $self->_instance_is_inlinable ? $self->_generate_predicate_method_inline(@_) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 75 | : $self->SUPER::_generate_predicate_method(@_); | ||||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||
| 78 | 77 | ▶ | sub _generate_clearer_method { | ||||||||||||||||||||||||||
|
Subroutine
_generate_clearer_method: called CC=2 SCAR=7.2
| |||||||||||||||||||||||||||||
| 79 | 77 | my $self = shift; | |||||||||||||||||||||||||||
| 80 | 77 | ▶ | $self->_instance_is_inlinable ? $self->_generate_clearer_method_inline(@_) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 81 | : $self->SUPER::_generate_clearer_method(@_); | ||||||||||||||||||||||||||||
| 82 | } | ||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||
| 84 | 714 | ▶ | sub _writer_value_needs_copy { | ||||||||||||||||||||||||||
|
Subroutine
_writer_value_needs_copy: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 85 | 714 | shift->associated_attribute->_writer_value_needs_copy(@_); | |||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | 114 | ▶ | sub _inline_tc_code { | ||||||||||||||||||||||||||
|
Subroutine
_inline_tc_code: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 89 | 114 | shift->associated_attribute->_inline_tc_code(@_); | |||||||||||||||||||||||||||
| 90 | } | ||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||
| 92 | 97 | ▶ | sub _inline_check_coercion { | ||||||||||||||||||||||||||
|
Subroutine
_inline_check_coercion: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 93 | 97 | shift->associated_attribute->_inline_check_coercion(@_); | |||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||
| 96 | 97 | ▶ | sub _inline_check_constraint { | ||||||||||||||||||||||||||
|
Subroutine
_inline_check_constraint: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 97 | 97 | shift->associated_attribute->_inline_check_constraint(@_); | |||||||||||||||||||||||||||
| 98 | } | ||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||
| 100 | 1116 | ▶ | sub _inline_check_lazy { | ||||||||||||||||||||||||||
|
Subroutine
_inline_check_lazy: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 101 | 1116 | shift->associated_attribute->_inline_check_lazy(@_); | |||||||||||||||||||||||||||
| 102 | } | ||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||
| 104 | 232 | ▶ | sub _inline_store_value { | ||||||||||||||||||||||||||
|
Subroutine
_inline_store_value: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 105 | 232 | shift->associated_attribute->_inline_instance_set(@_) . ';'; | |||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||
| 108 | 256 | ▶ | sub _inline_get_old_value_for_trigger { | ||||||||||||||||||||||||||
|
Subroutine
_inline_get_old_value_for_trigger: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 109 | 256 | shift->associated_attribute->_inline_get_old_value_for_trigger(@_); | |||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||
| 112 | 613 | ▶ | sub _inline_trigger { | ||||||||||||||||||||||||||
|
Subroutine
_inline_trigger: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 113 | 613 | shift->associated_attribute->_inline_trigger(@_); | |||||||||||||||||||||||||||
| 114 | } | ||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||
| 116 | 965 | ▶ | sub _get_value { | ||||||||||||||||||||||||||
|
Subroutine
_get_value: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 117 | 965 | shift->associated_attribute->_inline_instance_get(@_); | |||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||
| 120 | 35 | ▶ | sub _has_value { | ||||||||||||||||||||||||||
|
Subroutine
_has_value: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 121 | 35 | shift->associated_attribute->_inline_instance_has(@_); | |||||||||||||||||||||||||||
| 122 | } | ||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||
| 124 | 398 | 1; | |||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||
| 126 | # ABSTRACT: A Moose Method metaclass for accessors | ||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||
| 128 | __END__ | ||||||||||||||||||||||||||||