Browscap\Data\DataCollection::loadFile PHP Метод

loadFile() приватный Метод

private loadFile ( string $src ) : array
$src string
Результат array
    private function loadFile($src)
    {
        if (!file_exists($src)) {
            throw new \RuntimeException('File "' . $src . '" does not exist.');
        }
        if (!is_readable($src)) {
            throw new \RuntimeException('File "' . $src . '" is not readable.');
        }
        $fileContent = file_get_contents($src);
        if (preg_match('/[^ -~\\s]/', $fileContent)) {
            throw new \RuntimeException('File "' . $src . '" contains Non-ASCII-Characters.');
        }
        $json = json_decode($fileContent, true);
        if (is_null($json)) {
            throw new \RuntimeException('File "' . $src . '" had invalid JSON.');
        }
        return $json;
    }