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.

JsonParser   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 22
ccs 5
cts 5
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A parse() 0 10 2
1
<?php
2
3
namespace Glenn\Config\Parser;
4
5
use Glenn\Config\Contracts\ParserContract;
6
7
/**
8
 * Parses a JSON string in to a format readable by the Config Manager.
9
 *
10
 * @author Glenn McEwan <[email protected]>
11
 */
12
class JsonParser implements ParserContract
13
{
14
    /**
15
     * {@inheritdoc}
16
     *
17
     * @param string $data JSON as a string
18
     *
19
     * @return array Array of data
20
     *
21
     * @author Glenn McEwan <[email protected]>
22
     */
23 6
    public function parse($data)
24
    {
25 6
        $array = json_decode($data, true);
26
27 6
        if ($array === null) {
28 4
            throw new ParseException('Unable to parse JSON.');
29
        }
30
31 2
        return $array;
32
    }
33
}
34