| 1 | package Schema::Data::Plugin; | ||||||||||||||||||||||||||||
| 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 | |||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use Class::Utils qw(set_params); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 2 | ▶ | use Error::Pure qw(err); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 2 | ▶ | use Scalar::Util qw(blessed); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 2 | our $VERSION = 0.05; | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | sub new { | ||||||||||||||||||||||||||||
| 13 | 0 | ▶ | my ($class, @params) = @_; | ||||||||||||||||||||||||||
|
Subroutine
new: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | # Create object. | ||||||||||||||||||||||||||||
| 16 | 0 | my $self = bless {}, $class; | |||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | # Schema. | ||||||||||||||||||||||||||||
| 19 | 0 | $self->{'schema'} = undef; | |||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | # Verbose callback. | ||||||||||||||||||||||||||||
| 22 | 0 | $self->{'verbose_cb'} = undef; | |||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | # Process parameters. | ||||||||||||||||||||||||||||
| 25 | 0 | set_params($self, @params); | |||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 0 | ▶ | if (! defined $self->{'schema'}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 28 | 0 | err "Parameter 'schema' is required."; | |||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | 0 | ▶ | if (! blessed($self->{'schema'}) || ! $self->{'schema'}->isa('DBIx::Class::Schema')) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
builtin::blessed($self->{"schema"}) and $self->{"schema"}->isa("DBIx::Class::Schema")
MC/DC0%0/2
builtin::blessed($self->{"schema"}) and $self->{"schema"}->isa("DBIx::Class::Schema")
builtin::blessed($self->{"schema"})
$self->{"schema"}->isa("DBIx::Class::Schema")
Truth table0%0/3
A and B
A= builtin::blessed($self->{"schema"})B= $self->{"schema"}->isa("DBIx::Class::Schema")
| |||||||||||||||||||||||||||||
| 31 | 0 | err "Parameter 'schema' must be a instance of 'DBIx::Class::Schema'."; | |||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 0 | ▶ | if (defined $self->{'verbose_cb'} && ref $self->{'verbose_cb'} ne 'CODE') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $self->{"verbose_cb"} and ref $self->{"verbose_cb"} ne "CODE"
MC/DC0%0/2
defined $self->{"verbose_cb"} and ref $self->{"verbose_cb"} ne "CODE"
defined $self->{"verbose_cb"}
ref $self->{"verbose_cb"} ne "CODE"
Truth table0%0/3
A and B
A= defined $self->{"verbose_cb"}B= ref $self->{"verbose_cb"} ne "CODE"
| |||||||||||||||||||||||||||||
| 35 | 0 | err "Parameter 'verbose_cb' must be reference to code."; | |||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 0 | return $self; | |||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | sub load { | ||||||||||||||||||||||||||||
| 42 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
load: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 0 | err 'Package __PACKAGE__ is abstract class. load() method must be '. | |||||||||||||||||||||||||||
| 45 | 'defined in inherited class.'; | ||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | sub supported_versions { | ||||||||||||||||||||||||||||
| 49 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
supported_versions: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | 0 | err 'Package __PACKAGE__ is abstract class. supported_versions() method must be '. | |||||||||||||||||||||||||||
| 52 | 'defined in inherited class.'; | ||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | 2 | 1; | |||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | __END__ | ||||||||||||||||||||||||||||