GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

JsonDecoder   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 19
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A decode() 0 8 4
1
<?php
2
3
namespace Abraham\TwitterOAuth\Util;
4
5
/**
6
 * @author louis <[email protected]>
7
 */
8
class JsonDecoder
9
{
10
    /**
11
     * Decodes a JSON string to stdObject or associative array
12
     *
13
     * @param string $string
14
     * @param bool   $asArray
15
     *
16
     * @return array|object
17
     */
18
    public static function decode($string, $asArray)
19
    {
20
        if (version_compare(PHP_VERSION, '5.4.0', '>=') && !(defined('JSON_C_VERSION') && PHP_INT_SIZE > 4)) {
21
            return json_decode($string, $asArray, 512, JSON_BIGINT_AS_STRING);
22
        }
23
24
        return json_decode($string, $asArray);
25
    }
26
}
27