public static function createFromInline($fileContents)
    {
        // '//# sourceMappingURL=data:application/json;charset:utf-8;base64,
        // '//# sourceMappingURL=data:application/json;base64,'
        $pos = strrpos($fileContents, "\n//# sourceMappingURL=");
        $isCss = false;
        if ($pos === false) {
            $pos = strrpos($fileContents, "\n/*# sourceMappingURL=");
            if ($pos === false) {
                throw new Exception("No sourceMappingURL found");
            }
            $isCss = true;
        }
        $url = substr($fileContents, $pos + 22);
        $url = rtrim($url);
        if ($isCss) {
            if (substr($url, -2) != '*/') {
                throw new Exception("sourceMappingURL isn't wrapped with closing */");
            }
            $url = substr($url, 0, -2); //remove "*/"
            $url = rtrim($url);
        }

        if (substr($url, 0, 29) == 'data:application/json;base64,') {
            $map = substr($url, 29);
        } else if (substr($url, 0, 29 + 14) == 'data:application/json;charset:utf-8;base64,') {
            $map = substr($url, 29 + 14);
        } else if (substr($url, 0, 29 + 14) == 'data:application/json;charset=utf-8;base64,') {
            $map = substr($url, 29 + 14);
        } else {
            throw new Exception("Unsupported sourceMappingURL");
        }
        $map = base64_decode($map);
        $map = json_decode($map);
        $fileContents = substr($fileContents, 0, $pos);
        $ret = new self($map, $fileContents);
        $ret->setMimeType($isCss ? 'text/css' : 'text/javascript');
        return $ret;
    }