| 1 | package Catalyst::Model::Adaptor::Base; | ||||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | |||||||||||||
| 5 | 1 | ▶ | use Carp; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 1 | ▶ | use MRO::Compat; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | 1 | ▶ | use base 'Catalyst::Model'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | |||||||||||||
| 10 | 0 | ▶ | sub _load_adapted_class { | ||||||||||
|
Subroutine
_load_adapted_class: not called CC=2 SCAR=17.9
| |||||||||||||
| 11 | 0 | my ($self) = @_; | |||||||||||
| 12 | |||||||||||||
| 13 | 0 | ▶ | croak 'need class' unless $self->{class}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 14 | 0 | my $adapted_class = $self->{class}; | |||||||||||
| 15 | 0 | Catalyst::Utils::ensure_class_loaded($adapted_class); | |||||||||||
| 16 | |||||||||||||
| 17 | 0 | return $adapted_class; | |||||||||||
| 18 | } | ||||||||||||
| 19 | |||||||||||||
| 20 | 0 | ▶ | sub _create_instance { | ||||||||||
|
Subroutine
_create_instance: not called CC=2 SCAR=17.9
| |||||||||||||
| 21 | 0 | my ($self, $app, $rest) = @_; | |||||||||||
| 22 | |||||||||||||
| 23 | 0 | ▶ | my $constructor = $self->{constructor} || 'new'; | ||||||||||
|
Condition0%0/2
$self->{'constructor'} || 'new'
MC/DC0%0/1
$self->{'constructor'} || 'new'
$self->{'constructor'}
Truth table0%0/2
A
A= $self->{'constructor'}
| |||||||||||||
| 24 | 0 | my $arg = $self->prepare_arguments($app, $rest); | |||||||||||
| 25 | 0 | my $adapted_class = $self->{class}; | |||||||||||
| 26 | |||||||||||||
| 27 | 0 | return $adapted_class->$constructor($self->mangle_arguments($arg)); | |||||||||||
| 28 | } | ||||||||||||
| 29 | |||||||||||||
| 30 | 0 | ▶ | sub prepare_arguments { | ||||||||||
|
Subroutine
prepare_arguments: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||
| 31 | 0 | my ($self, $app, $arg) = @_; | |||||||||||
| 32 | return exists $self->{args} ? { | ||||||||||||
| 33 | 0 | ▶ | %{$self->{args}}, | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 34 | %$arg, | ||||||||||||
| 35 | } : $arg; | ||||||||||||
| 36 | } | ||||||||||||
| 37 | |||||||||||||
| 38 | 0 | ▶ | sub mangle_arguments { | ||||||||||
|
Subroutine
mangle_arguments: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 39 | 0 | my ($self, $args) = @_; | |||||||||||
| 40 | 0 | return $args; | |||||||||||
| 41 | } | ||||||||||||
| 42 | |||||||||||||
| 43 | 1 | 1; | |||||||||||
| 44 | |||||||||||||
| 45 | __END__ | ||||||||||||