CHI/Serializer/JSON.pm

filter: Statementstmt 93.7% 15 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 2 totaltotal 83.3% 20 / 24 SCAR 0.0
CC
1
Cov
94%
deserialize
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« CHI/Serializer/Storable.pm ↑ Summary CHI/Driver/Base/CacheContainer.pm »
1 # Default key serializer class, so that we don't have to depend on Data::Serializer.
2 # Recommend Data::Serializer for other serializers, rather than reinventing the wheel.
3 #
4 package CHI::Serializer::JSON;
5 20 $CHI::Serializer::JSON::VERSION = '0.59';
6 20 ▶use CHI::Util qw(json_encode json_decode);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 20 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 20 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 20 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 sub serialize {
12 768 ▶ return json_encode( $_[1] );
Subroutine serialize: called CC=1 SCAR=0.0
Pod undocumented
13 }
14  
15 sub deserialize {
16 0 ▶ return json_decode( $_[1] );
Subroutine deserialize: not called CC=1 SCAR=6.9
Pod undocumented
17 }
18  
19 20 1;
« CHI/Serializer/Storable.pm ↑ Summary CHI/Driver/Base/CacheContainer.pm »