Passed
Push — v2.0 ( 27e8f8...6f66e6 )
by Raza
01:56
created

JsonDecodeSelector::jsonDecodeFunction()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 2
nc 2
nop 0
1
<?php
2
3
namespace Srmklive\PayPal\Traits;
4
5
trait JsonDecodeSelector
6
{
7
    /**
8
     * Decide the function to use for decoding json.
9
     *
10
     * @return string
11
     */
12
    protected function jsonDecodeFunction(): string
13
    {
14
        return class_exists(\GuzzleHttp\Utils::class) ? '\GuzzleHttp\Utils::jsonDecode' : '\GuzzleHttp\Utils::json_decode';
15
    }
16
}
17