blib/lib/DTL/Fast/Cache/Runtime.pm

filter: Statementstmt 87.5% 21 / 24 Branchbran 62.5% 5 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 6 / 7 Podpod 0.0% 0 / 4 totaltotal 74.4% 32 / 43 SCAR 16.4
CC
5
Cov
81%
write_data
3.1
read_data
3.0
clear
2.0
CRAP 5.2
« blib/lib/DTL/Fast/Tag/Extends.pm ↑ Summary blib/lib/DTL/Fast/Filter/Reverse.pm »
1 package DTL::Fast::Cache::Runtime;
2 98 ▶use strict; use warnings FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
3 98 ▶use parent 'DTL::Fast::Cache';
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 # Runtime cache for compiled templates
6  
7 #@Override
8 sub new
9 {
10 7 ▶ my( $proto, %kwargs ) = @_;
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
11
12 7 $kwargs{'cache'} = {};
13  
14 7 return $proto->SUPER::new(%kwargs);
15 }
16  
17 sub read_data
18 {
19 92 ▶ my( $self, $key ) = @_;
Subroutine read_data: called CC=3 SCAR=11.1
Pod undocumented
20 92 ▶ return if not defined $key;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $key 0 92 92
21 92 ▶ return exists $self->{'cache'}->{$key} ? $self->{'cache'}->{$key}: undef;
Branch: 1 branch
BranchTrueFalseTotal
exists $self->{'cache'}{$key} ? : 24 68 92
22 }
23  
24  
25 sub write_data
26 {
27 53 ▶ my( $self, $key, $data ) = @_;
Subroutine write_data: called CC=3 SCAR=11.3
Pod undocumented
28 53 ▶ return if not defined $key;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $key 0 53 53
29 53 ▶ return if not defined $data;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $data 0 53 53
30 53 $self->{'cache'}->{$key} = $data;
31 53 return $self;
32 }
33  
34 #@Override
35 sub clear
36 {
37 0 ▶ my( $self ) = @_;
Subroutine clear: not called CC=1 SCAR=6.9
Pod undocumented
38 0 $self->{'cache'} = {};
39 0 return $self;
40 }
41  
42 98 1;
« blib/lib/DTL/Fast/Tag/Extends.pm ↑ Summary blib/lib/DTL/Fast/Filter/Reverse.pm »