MenaraSolutions\Geographer\Repositories\File::loadJson PHP Method

loadJson() public method

public loadJson ( string $path ) : array
$path string
return array
    public function loadJson($path)
    {
        if (!file_exists($path)) {
            throw new FileNotFoundException('File not found: ' . $path);
        }
        $decoded = json_decode(file_get_contents($path), true);
        if ($decoded === null) {
            throw new MisconfigurationException('Unable to decode JSON for ' . $path);
        }
        return $decoded;
    }