MtPolicyd/Plugin/Role/PluginChain.pm

filter: Statementstmt 73.6% 14 / 19 Branchbran 25.0% 1 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod n/a totaltotal 66.6% 18 / 27 CC 3 SCAR 11.1
CC
3
Cov
65%
__ANON__
6.0
__ANON__
2.1
BEGIN
1.0
CRAP 3.0
« MtPolicyd/Plugin/Accounting.pm ↑ Summary MtPolicyd/Plugin/AddScoreHeader.pm »
1 package Mail::MtPolicyd::Plugin::Role::PluginChain;
2  
3 4 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 4 our $VERSION = '2.01'; # VERSION
6 # ABSTRACT: role for plugins to support a nested plugin chain
7  
8 4 ▶use Mail::MtPolicyd::PluginChain;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 has 'chain' => (
11 is => 'ro',
12 isa => 'Maybe[Mail::MtPolicyd::PluginChain]',
13 lazy => 1,
14 default => sub {
15 1 ▶ my $self = shift;
Subroutine __ANON__: called CC=2 SCAR=7.6
16 1 ▶ if( defined $self->Plugin ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $self->Plugin) 1 0 1
17 1 return Mail::MtPolicyd::PluginChain->new_from_config(
18 $self->vhost_name,
19 $self->Plugin,
20 );
21 }
22 0 return;
23 },
24 4 );
25  
26 4 has 'Plugin' => ( is => 'rw', isa => 'Maybe[HashRef]' );
27  
28 after 'cron' => sub {
29 0 ▶ my $self = shift;
Subroutine __ANON__: not called CC=2 SCAR=17.9
30 0 ▶ if( defined $self->chain ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $self->chain) 0 0 0
31 0 return $self->chain->cron(@_);
32 }
33 0 return;
34 4 };
35  
36 4 1;
37  
38 __END__
39  
40 =pod
41  
42 =encoding UTF-8
43  
44 =head1 NAME
45  
46 Mail::MtPolicyd::Plugin::Role::PluginChain - role for plugins to support a nested plugin chain
47  
48 =head1 VERSION
49  
50 version 2.01
51  
52 =head1 AUTHOR
53  
54 Markus Benning <ich@markusbenning.de>
55  
56 =head1 COPYRIGHT AND LICENSE
57  
58 This software is Copyright (c) 2014 by Markus Benning <ich@markusbenning.de>.
59  
60 This is free software, licensed under:
61  
62 The GNU General Public License, Version 2, June 1991
63  
64 =cut
« MtPolicyd/Plugin/Accounting.pm ↑ Summary MtPolicyd/Plugin/AddScoreHeader.pm »