Cache/Null/Entry.pm

filter: Statementstmt 88.8% 32 / 36 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 12 / 16 Podpod 90.0% 9 / 10 totaltotal 84.8% 56 / 66 CC 3 SCAR 3.7
CC
3
Cov
88%
new
2.0
expiry
2.0
set_expiry
2.0
CRAP 1.4
« Cache/Null.pm ↑ Summary Cache/RemovalStrategy.pm »
1 =head1 NAME
2  
3 Cache::Null::Entry - An entry in the Null implementation of Cache
4  
5 =head1 SYNOPSIS
6  
7 See 'Cache::Entry' for a synopsis.
8  
9 =head1 DESCRIPTION
10  
11 This module implements a version of Cache::Entry for the Cache::Null variant
12 of Cache. It should not be created or used directly, please see
13 'Cache::Null' or 'Cache::Entry' instead.
14  
15 =cut
16 package Cache::Null::Entry;
17  
18 2 require 5.006;
19 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 2 ▶use Cache::IOString;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 2 ▶use base qw(Cache::Entry);
Subroutine BEGIN: called CC=1 SCAR=0.0
24 2 ▶use fields qw();
Subroutine BEGIN: called CC=1 SCAR=0.0
25  
26 2 our $VERSION = '2.11';
27  
28  
29 1 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
Pod undocumented
30 1 my Cache::Null::Entry $self = shift;
31  
32 1 ▶ $self = fields::new($self) unless ref $self;
Branch: 1 branch
BranchTrueFalseTotal
unless ref $self 1 0 1
33 1 $self->SUPER::new(@_);
34  
35 1 return $self;
36 }
37  
38 4 ▶sub exists {
Subroutine exists: called CC=1 SCAR=0.0
Pod documented
39 #my Cache::Null::Entry $self = shift;
40 4 return 0;
41 }
42  
43 1 ▶sub set {
Subroutine set: called CC=1 SCAR=0.0
Pod documented
44 #my Cache::Null::Entry $self = shift;
45 1 return;
46 }
47  
48 4 ▶sub get {
Subroutine get: called CC=1 SCAR=0.0
Pod documented
49 #my Cache::Null::Entry $self = shift;
50 4 return undef;
51 }
52  
53 2 ▶sub size {
Subroutine size: called CC=1 SCAR=0.0
Pod documented
54 #my Cache::Null::Entry $self = shift;
55 2 return undef;
56 }
57  
58 1 ▶sub remove {
Subroutine remove: called CC=1 SCAR=0.0
Pod documented
59 #my Cache::Null::Entry $self = shift;
60 1 return;
61 }
62  
63 0 ▶sub expiry {
Subroutine expiry: not called CC=1 SCAR=6.9
Pod documented
64 #my Cache::Null::Entry $self = shift;
65 0 return undef;
66 }
67  
68 0 ▶sub set_expiry {
Subroutine set_expiry: not called CC=1 SCAR=6.9
Pod documented
69 #my Cache::Null::Entry $self = shift;
70 0 return;
71 }
72  
73 4 ▶sub _handle {
Subroutine _handle: called CC=2 SCAR=6.9
74 4 my Cache::Null::Entry $self = shift;
75 4 my ($mode) = @_;
76  
77 # return undef unless writing - otherwise return a dummy handle
78 4 ▶ return undef unless $mode =~ />|\+/;
Branch: 1 branch
BranchTrueFalseTotal
unless $mode =~ />|\+/ 1 3 4
79 3 my $data = '';
80 3 return Cache::IOString->new(\$data, $mode);
81 }
82  
83 0 ▶sub validity {
Subroutine validity: not called CC=1 SCAR=6.9
Pod documented
84 #my Cache::Null::Entry $self = shift;
85 0 return undef;
86 }
87  
88 0 ▶sub set_validity {
Subroutine set_validity: not called CC=1 SCAR=6.9
Pod documented
89 #my Cache::Null::Entry $self = shift;
90 0 return;
91 }
92  
93  
94 2 1;
95 __END__
« Cache/Null.pm ↑ Summary Cache/RemovalStrategy.pm »