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

JsonDecodeSelector   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 2
c 1
b 0
f 0
dl 0
loc 10
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A jsonDecodeFunction() 0 3 2
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