CacheFactory/Storage.pm

filter: Statementstmt 100% 24 / 24 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 96.8% 31 / 32 CC 2 SCAR 2.9
CC
2
Cov
96%
new
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« CacheFactory/Expiry.pm ↑ Summary
1 ###############################################################################
2 # Purpose : Cache Storage Policy Factory.
3 # Author : Sam Graham
4 # Created : 23 Jun 2008
5 # CVS : $Id: Storage.pm,v 1.9 2010-02-16 12:25:41 illusori Exp $
6 ###############################################################################
7  
8 package Cache::CacheFactory::Storage;
9  
10 11 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 11 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 11 ▶use Class::Factory;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 11 ▶use base qw/Class::Factory/;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 11 $Cache::CacheFactory::Storage::VERSION = '1.10';
18  
19 sub new
20 12 ▶{
Subroutine new: called CC=2 SCAR=7.0
Pod documented
21 12 my ( $this, $type, @params ) = @_;
22 12 my ( $class );
23  
24 12 $class = $this->get_factory_class( $type );
25 12 ▶ return( undef ) unless $class;
Branch: 1 branch
BranchTrueFalseTotal
unless $class 0 12 12
26 12 return( $class->new( @params ) );
27 }
28  
29 11 __PACKAGE__->register_factory_type(
30 memory => 'Cache::MemoryCache' );
31 11 __PACKAGE__->register_factory_type(
32 sharedmemory => 'Cache::SharedMemoryCache' );
33 11 __PACKAGE__->register_factory_type(
34 file => 'Cache::FileCache' );
35 11 __PACKAGE__->register_factory_type(
36 null => 'Cache::NullCache' );
37 11 __PACKAGE__->register_factory_type(
38 fastmemory => 'Cache::FastMemoryCache' );
39  
40 11 1;
41  
42 __END__
« CacheFactory/Expiry.pm ↑ Summary