| 1 | package Plack::Session::Store::Cache; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 3 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 3 | our $VERSION = '0.36'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 3 | our $AUTHORITY = 'cpan:STEVAN'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 3 | ▶ | use Scalar::Util qw[ blessed ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 3 | ▶ | use parent 'Plack::Session::Store'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 3 | ▶ | use Plack::Util::Accessor qw[ cache ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 2 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=5 SCAR=20.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 2 | my ($class, %params) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | die('cache require get, set and remove method.') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | unless blessed $params{cache} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | && $params{cache}->can('get') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | && $params{cache}->can('set') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 2 | ▶ | && $params{cache}->can('remove'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%3/9
builtin::blessed($params{"cache"}) and $params{"cache"}->can("get") and $params{"cache"}->can("set") and $params{"cache"}->can("remove")
builtin::blessed($params{"cache"}) and $params{"cache"}->can("get") and $params{"cache"}->can("set")
builtin::blessed($params{"cache"}) and $params{"cache"}->can("get")
MC/DC0%0/4
builtin::blessed($params{"cache"}) and $params{"cache"}->can("get") and $params{"cache"}->can("set") and $params{"cache"}->can("remove")
builtin::blessed($params{"cache"})
$params{"cache"}->can("get")
$params{"cache"}->can("set")
$params{"cache"}->can("remove")
Truth table20%1/5
A and B and C and D
A= builtin::blessed($params{"cache"})B= $params{"cache"}->can("get")C= $params{"cache"}->can("set")D= $params{"cache"}->can("remove")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 2 | bless { %params } => $class; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 12 | ▶ | sub fetch { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
fetch: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 12 | my ($self, $session_id ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 12 | $self->cache->get($session_id); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 16 | ▶ | sub store { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
store: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 16 | my ($self, $session_id, $session) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 16 | $self->cache->set($session_id => $session); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 2 | ▶ | sub remove { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
remove: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 2 | my ($self, $session_id) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 2 | $self->cache->remove($session_id); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 3 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||