| 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<perlartistic>. | ||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 3 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 11 | 3 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 3 | ▶ | use JSON (); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | 3 | my $json; | |||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | 5 | ▶ | sub _json { | ||||||||||||||||||
|
Subroutine
_json: called CC=2 SCAR=7.2
| |||||||||||||||||||||
| 18 | 5 | ▶ | return $json ||= JSON->new()->utf8(0); | ||||||||||||||||||
|
Condition66%2/3
$json ||= "JSON"->new->utf8(0)
MC/DC0%0/2
$json ||= "JSON"->new->utf8(0)
$json
"JSON"->new->utf8(0)
Truth table66%2/3
A ||= B
A= $jsonB= "JSON"->new->utf8(0)
| |||||||||||||||||||||
| 19 | } | ||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | 5 | ▶ | sub decode { | ||||||||||||||||||
|
Subroutine
decode: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 22 | 5 | return _json()->decode( $_[0] ); | |||||||||||||||||||
| 23 | } | ||||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | 3 | 1; | |||||||||||||||||||