blib/lib/Email/Sender/Transport/Wrapper.pm

filter: Statementstmt 92.3% 24 / 26 Branchbran 66.6% 4 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 6 / 7 Podpod 0.0% 0 / 4 totaltotal 79.0% 34 / 43 CC 5 SCAR 10.9
CC
5
Cov
88%
BUILDARGS
5.2
allow_partial_success
2.0
BEGIN
1.0
CRAP 3.0
« blib/lib/Email/Sender/Transport/Maildir.pm ↑ Summary blib/lib/Email/Sender/Failure.pm »
1 package Email::Sender::Transport::Wrapper 2.603;
2 # ABSTRACT: a mailer to wrap a mailer for mailing mail
3  
4 3 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 with 'Email::Sender::Transport';
6  
7 3 ▶use Email::Sender::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 #pod =head1 DESCRIPTION
10 #pod
11 #pod Email::Sender::Transport::Wrapper wraps a transport, provided as the
12 #pod C<transport> argument to the constructor. It is provided as a simple way to
13 #pod use method modifiers to create wrapping classes.
14 #pod
15 #pod =cut
16  
17 3 has transport => (
18 is => 'ro',
19 does => 'Email::Sender::Transport',
20 required => 1,
21 );
22  
23 2 ▶sub send_email {
Subroutine send_email: called CC=1 SCAR=0.0
Pod undocumented
24 2 my $self = shift;
25  
26 2 $self->transport->send_email(@_);
27 }
28  
29 2 ▶sub is_simple {
Subroutine is_simple: called CC=1 SCAR=0.0
Pod undocumented
30 2 return $_[0]->transport->is_simple;
31 }
32  
33 0 ▶sub allow_partial_success {
Subroutine allow_partial_success: not called CC=1 SCAR=6.9
Pod undocumented
34 0 return $_[0]->transport->allow_partial_success;
35 }
36  
37 2 ▶sub BUILDARGS {
Subroutine BUILDARGS: called CC=5 SCAR=16.4
Pod undocumented
38 2 my $self = shift;
39 2 my $href = $self->SUPER::BUILDARGS(@_);
40  
41 2 ▶ if (my $class = delete $href->{transport_class}) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $class = delete $href->{"transport_class"}) 1 1 2
42 Carp::confess("given both a transport and transport_class")
43 1 ▶ if $href->{transport};
Branch: 1 branch
BranchTrueFalseTotal
if $href->{"transport"} 0 1 1
44  
45 1 my %arg;
46 1 ▶ for my $key (map {; /^transport_arg_(.+)$/ ? "$1" : () } keys %$href) {
Branch: 1 branch
BranchTrueFalseTotal
/^transport_arg_(.+)$/ ? : 0 1 1
47 0 $arg{$key} = delete $href->{"transport_arg_$key"};
48 }
49  
50 1 $href->{transport} = Email::Sender::Util->easy_transport($class, \%arg);
51 }
52  
53 2 return $href;
54 }
55  
56 3 ▶no Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
57 3 1;
58  
59 __END__
« blib/lib/Email/Sender/Transport/Maildir.pm ↑ Summary blib/lib/Email/Sender/Failure.pm »