| 1 | package Mail::DMARC::Report::Store; | ||||||||||
| 2 | 6 | our $VERSION = '2.20261110'; | |||||||||
| 3 | 6 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 6 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 6 | ▶ | use feature 'signatures'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 6 | ▶ | use feature 'try'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 6 | ▶ | no warnings 'experimental::try'; ## no critic (ProhibitNoWarnings) | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 6 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 6 | ▶ | use Module::Load; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 6 | ▶ | use parent 'Mail::DMARC::Base'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | |||||||||||
| 14 | 10 | ▶ | sub delete_report( $self, @args ) { | ||||||||
|
Subroutine
delete_report: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 15 | 10 | return $self->backend->delete_report(@args); | |||||||||
| 16 | } | ||||||||||
| 17 | |||||||||||
| 18 | 4 | ▶ | sub error( $self, @args ) { | ||||||||
|
Subroutine
error: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 19 | 4 | return $self->backend->insert_error(@args); | |||||||||
| 20 | } | ||||||||||
| 21 | |||||||||||
| 22 | 0 | ▶ | sub retrieve( $self, @args ) { | ||||||||
|
Subroutine
retrieve: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 23 | 0 | return $self->backend->retrieve(@args); | |||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | 21 | ▶ | sub next_todo( $self, @args ) { | ||||||||
|
Subroutine
next_todo: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 27 | 21 | return $self->backend->next_todo(@args); | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 1 | ▶ | sub retrieve_todo( $self, @args ) { | ||||||||
|
Subroutine
retrieve_todo: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 31 | 1 | return $self->backend->retrieve_todo(@args); | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | 56 | ▶ | sub backend($self) { | ||||||||
|
Subroutine
backend: called CC=3 SCAR=11.1
Pod
undocumented
| |||||||||||
| 35 | 56 | my $backend = $self->config->{report_store}{backend}; | |||||||||
| 36 | |||||||||||
| 37 | 56 | ▶ | croak "no backend defined?!" if !$backend; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 38 | |||||||||||
| 39 | 56 | ▶ | return $self->{$backend} if ref $self->{$backend}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 40 | 27 | my $module = "Mail::DMARC::Report::Store::$backend"; | |||||||||
| 41 | 27 | try { | |||||||||
| 42 | 27 | load $module; | |||||||||
| 43 | } | ||||||||||
| 44 | catch ($error) { | ||||||||||
| 45 | 0 | croak "Unable to load backend $backend: $error\n"; | |||||||||
| 46 | } | ||||||||||
| 47 | |||||||||||
| 48 | 27 | return $self->{$backend} = $module->new; | |||||||||
| 49 | } | ||||||||||
| 50 | |||||||||||
| 51 | 6 | 1; | |||||||||
| 52 | |||||||||||
| 53 | __END__ | ||||||||||