File Coverage

blib/lib/cPanel/APIClient/Utils/JSON.pm
Criterion Covered Total %
statement 11 11 100.0
branch n/a
condition 2 3 66.6
subroutine 5 5 100.0
pod 0 1 0.0
total 18 20 90.0


line stmt bran cond sub pod time code
1             package cPanel::APIClient::Utils::JSON;
2              
3             # Copyright 2020 cPanel, L. L. C.
4             # All rights reserved.
5             # http://cpanel.net
6             #
7             # This is free software; you can redistribute it and/or modify it under the
8             # same terms as Perl itself. See L.
9              
10 3     3   25 use strict;
  3         6  
  3         80  
11 3     3   12 use warnings;
  3         5  
  3         77  
12              
13 3     3   537 use JSON ();
  3         6940  
  3         310  
14              
15             my $json;
16              
17             sub _json {
18 4   66 4   203 return $json ||= JSON->new()->utf8(0);
19             }
20              
21             sub decode {
22 4     4 0 18 return _json()->decode( $_[0] );
23             }
24              
25             1;