| 1 | package Twilio::Json; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 33 | ▶ | use 5.016; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 33 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | 33 | our $VERSION = '2.001'; | |||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | 33 | my $codec = _new_codec(); | |||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 2410 | ▶ | sub encode { | ||||||||||||||||||
|
Subroutine
encode: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 11 | 2410 | my ($value) = @_; | |||||||||||||||||||
| 12 | 2410 | return $codec->encode($value); | |||||||||||||||||||
| 13 | } | ||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | 2081 | ▶ | sub decode { | ||||||||||||||||||
|
Subroutine
decode: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 16 | 2081 | my ($text) = @_; | |||||||||||||||||||
| 17 | 2081 | return $codec->decode($text); | |||||||||||||||||||
| 18 | } | ||||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | 33 | ▶ | sub _new_codec { | ||||||||||||||||||
|
Subroutine
_new_codec: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 21 | my $backend = | ||||||||||||||||||||
| 22 | 33 | ▶ | eval { require Cpanel::JSON::XS; 'Cpanel::JSON::XS' } // do { require JSON::PP; 'JSON::PP' }; | ||||||||||||||||||
|
Condition66%2/3
eval {
do {
require Cpanel::JSON::XS;
"Cpanel::JSON::XS"
}
} // do {
require JSON::PP;
"JSON::PP"
}
MC/DC0%0/2
eval {
do {
require Cpanel::JSON::XS;
"Cpanel::JSON::XS"
}
} // do {
require JSON::PP;
"JSON::PP"
}
eval {
do {
require Cpanel::JSON::XS;
"Cpanel::JSON::XS"
}
}
do {
require JSON::PP;
"JSON::PP"
}
Truth table66%2/3
A // B
A= eval {
do {
require Cpanel::JSON::XS;
"Cpanel::JSON::XS"
}
}B= do {
require JSON::PP;
"JSON::PP"
}
| |||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | # Canonical key order keeps request bodies reproducible in tests and logs. | ||||||||||||||||||||
| 25 | 33 | return $backend->new->utf8->canonical->allow_nonref; | |||||||||||||||||||
| 26 | } | ||||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | 33 | 1; | |||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | __END__ | ||||||||||||||||||||