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.

JsonFileParser   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 2
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
/**
6
 * Loads up a given file from a path, and passes the data to the parent JsonParser,
7
 * which will read the contents as a JSON string.
8
 *
9
 * @author Glenn McEwan <[email protected]>
10
 */
11
class JsonFileParser extends JsonParser
12
{
13
    /**
14
     * Override the parent, because we can parse from a given file's path,
15
     * rather than the file's string contents.
16
     *
17
     * @param  string                               $data Path to the JSON file to parse
18
     * @throws Bob\Filesystem\FileNotFoundException
19
     * @return array                                Parent's return value
20
     * @author Glenn McEwan <[email protected]>
21
     */
22 4
    public function parse($data)
23
    {
24 4
        if (!is_file($data)) {
25 1
            throw new ParseException('Unable to load file.');
26
        }
27
28 3
        $data = file_get_contents($data);
29
30 3
        return parent::parse($data);
31
    }
32
}
33