Redis/Subscription/Message.pm

filter: Statementstmt 47.8% 11 / 23 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 7 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 30.0% 3 / 10 Podpod 83.3% 5 / 6 totaltotal 35.1% 19 / 54 CC 6 SCAR 21.5
CC
6
Cov
32%
DESTROY
20.0
new
12.0
redis
2.0
CRAP 8.6
« Redis/Server/Connection.pm ↑ Summary Redis/Subscription.pm »
1 package Net::Async::Redis::Subscription::Message;
2  
3 15 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 15 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 15 our $VERSION = '6.006'; # VERSION
7  
8 =head1 NAME
9  
10 Net::Async::Redis::Subscription::Message - represents a single message
11  
12 =head1 DESCRIPTION
13  
14 Instances are automatically generated by L<Net::Async::Redis>.
15  
16 =cut
17  
18 15 ▶use Scalar::Util qw(weaken);
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 0 ▶sub new {
Subroutine new: not called CC=3 SCAR=24.8
Pod undocumented
21 0 my ($class, %args) = @_;
22 0 ▶ weaken($args{redis} // die 'Must be provided a Net::Async::Redis instance');
Condition0%0/2
$args{"redis"} // die("Must be provided a Net::Async::Redis instance")
l!l
00
MC/DC0%0/1
$args{"redis"} // die("Must be provided a Net::Async::Redis instance")
$args{"redis"}
Truth table0%0/2
A
A= $args{"redis"}
Aresult
11
00
23 0 ▶ weaken($args{subscription} // die 'Must be provided a Net::Async::Redis::Subscription instance');
Condition0%0/2
$args{"subscription"} // die("Must be provided a Net::Async::Redis::Subscription instance")
l!l
00
MC/DC0%0/1
$args{"subscription"} // die("Must be provided a Net::Async::Redis::Subscription instance")
$args{"subscription"}
Truth table0%0/2
A
A= $args{"subscription"}
Aresult
11
00
24 0 bless \%args, $class;
25 }
26  
27 =head2 redis
28  
29 Accessor for the L<Net::Async::Redis> connection.
30  
31 =cut
32  
33 0 ▶sub redis { shift->{redis} }
Subroutine redis: not called CC=1 SCAR=6.9
Pod documented
34  
35 =head2 subscription
36  
37 Accessor for the owning L<Net::Async::Redis::Subscription>.
38  
39 =cut
40  
41 0 ▶sub subscription { shift->{subscription} }
Subroutine subscription: not called CC=1 SCAR=6.9
Pod documented
42  
43 =head2 channel
44  
45 Accessor for the channel name.
46  
47 =cut
48  
49 0 ▶sub channel { shift->{channel} }
Subroutine channel: not called CC=1 SCAR=6.9
Pod documented
50  
51 =head2 type
52  
53 Type of this message - either C<pmessage> or C<message>.
54  
55 =cut
56  
57 0 ▶sub type { shift->{type} }
Subroutine type: not called CC=1 SCAR=6.9
Pod documented
58  
59 =head2 payload
60  
61 Message content (binary string).
62  
63 =cut
64  
65 0 ▶sub payload { shift->{payload} }
Subroutine payload: not called CC=1 SCAR=6.9
Pod documented
66  
67 0 ▶sub DESTROY {
Subroutine DESTROY: not called CC=4 SCAR=30.0
68 0 my ($self) = @_;
69 0 ▶ return if ${^GLOBAL_PHASE} eq 'DESTRUCT' or not my $ev = $self->{events};
Branch: 1 branch
BranchTrueFalseTotal
if ${^GLOBAL_PHASE} eq "DESTRUCT" or not my $ev = $$self{"events"} 0 0 0
Condition0%0/3
${^GLOBAL_PHASE} eq "DESTRUCT" or not my $ev = $$self{"events"}
l!l&&r!l&&!r
000
MC/DC0%0/2
${^GLOBAL_PHASE} eq "DESTRUCT" or not my $ev = $$self{"events"}
${^GLOBAL_PHASE} eq "DESTRUCT" not my $ev = $$self{"events"}
Truth table0%0/3
A or not(B)
A= ${^GLOBAL_PHASE} eq "DESTRUCT"B= not my $ev = $$self{"events"}
ABresult
1X1
011
000
70 0 ▶ $ev->completion->done unless $ev->completion->is_ready;
Branch: 1 branch
BranchTrueFalseTotal
unless $ev->completion->is_ready 0 0 0
71 }
72  
73 15 1;
74  
75 __END__
« Redis/Server/Connection.pm ↑ Summary Redis/Subscription.pm »