| 1 | package DBIO::DeploymentHandler::HandlesVersionStorage; | ||||||||||||||||||||
| 2 | # ABSTRACT: Interface for version storage methods | ||||||||||||||||||||
| 3 | |||||||||||||||||||||
| 4 | 3 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 3 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 3 | our $VERSION = '0.900007'; | |||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | 3 | ▶ | use DBIO::Exception; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | 3 | ▶ | use namespace::clean; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | 3 | my @REQUIRED = qw( | |||||||||||||||||||
| 15 | add_database_version | ||||||||||||||||||||
| 16 | database_version | ||||||||||||||||||||
| 17 | delete_database_version | ||||||||||||||||||||
| 18 | version_storage_is_installed | ||||||||||||||||||||
| 19 | ); | ||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | 8 | ▶ | sub assert_implemented { | ||||||||||||||||||
|
Subroutine
assert_implemented: called CC=4 SCAR=17.2
Pod
documented
| |||||||||||||||||||||
| 22 | 8 | my ($class, $target) = @_; | |||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | 8 | ▶ | DBIO::Exception->throw( | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 25 | "$class->assert_implemented called without a target object" | ||||||||||||||||||||
| 26 | ) unless defined $target; | ||||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | 8 | my @missing = grep { !$target->can($_) } @REQUIRED; | |||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | 8 | ▶ | return 1 unless @missing; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | 0 | ▶ | DBIO::Exception->throw( | ||||||||||||||||||
|
Condition0%0/3
ref $target || $target
MC/DC0%0/2
ref $target || $target
ref $target
$target
Truth table0%0/3
A || B
A= ref $targetB= $target
| |||||||||||||||||||||
| 33 | (ref($target) || $target) | ||||||||||||||||||||
| 34 | . " does not implement the $class interface: missing method(s) " | ||||||||||||||||||||
| 35 | . join(', ', @missing) | ||||||||||||||||||||
| 36 | ); | ||||||||||||||||||||
| 37 | } | ||||||||||||||||||||
| 38 | |||||||||||||||||||||
| 39 | 3 | 1; | |||||||||||||||||||
| 40 | |||||||||||||||||||||
| 41 | # vim: ts=2 sw=2 expandtab | ||||||||||||||||||||
| 42 | |||||||||||||||||||||
| 43 | __END__ | ||||||||||||||||||||