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.
Completed
Push — master ( 86ad7b...a9edc5 )
by Glenn
02:36 queued 38s
created

JsonFileParser::parse()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

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