protected function validateSyntax($file)
    {
        /**
         * This is a currently known PHP bug, but has not yet been fixed
         * @link http://bugs.php.net/bug.php?id=52769
         */
        $fname = realpath($file);
        if ($fname === false) {
            $fname = $file;
        }

        if (!file_exists($fname)) {
            throw new \RuntimeException('File "' . $file . '" not found.');
        }
        if (!is_readable($fname)) {
            throw new \RuntimeException('File "' . $file . '" is not readable.');
        }

        $json = file_get_contents($fname);

        $parser = new JsonParser();
        $result = $parser->lint($json);
        if (null === $result) {
            if (defined('JSON_ERROR_UTF8')
                && JSON_ERROR_UTF8 === json_last_error()
            ) {
                throw new ParsingException(
                    '"' . $file . '" is not UTF-8, could not parse as JSON'
                );
            }
            return $json;
        }
        throw $result;
    }