解析错误:语法错误,意外')',期望' |'或/opt/lampp/htdocs/fsphp/vendor/coffeecode/cropper/src/src/cropper.php中的变量(t_variable)

发布于 2025-01-31 09:55:53 字数 1019 浏览 0 评论 0原文

当我试图让作曲家安装项目时,我会有一些交响乐供应商的语法错误。 这里的php版本的phpinfo()

xampp 7.4.28-1 Linux Manjaro

"require": {
    "php": "^7.1",
    "ext-pdo": "^7.1",
    "phpmailer/phpmailer": "~6.0",
    "league/plates": "v4.0.0-alpha",
    "matthiasmullie/minify": "^1.3",
    "coffeecode/uploader": "^1.0",
    "coffeecode/cropper": "^1.0",
    "coffeecode/optimizer": "^1.0",
    "coffeecode/paginator": "^1.0",
    "coffeecode/router": "^1.0"
  }

/**
 * @param string $image
 * @param bool $unlinkImage
 * @return string
 */
public function toWebP(string $image, $unlinkImage = true): string
{
    try {
        $webPConverted = pathinfo($image)["dirname"] . "/" . pathinfo($image)["filename"] . ".webp";
        WebPConvert::convert($image, $webPConverted, ["default-quality" => $this->quality]);

        if ($unlinkImage) {
            unlink($image);
        }

        return $webPConverted;
    } catch (ConversionFailedException) {
        return $image;
    }
}

I have some symphony vendor syntax errors when I'm trying to get composer to install my project.
Here the php version of phpinfo()

XAMPP 7.4.28-1
Linux Manjaro

"require": {
    "php": "^7.1",
    "ext-pdo": "^7.1",
    "phpmailer/phpmailer": "~6.0",
    "league/plates": "v4.0.0-alpha",
    "matthiasmullie/minify": "^1.3",
    "coffeecode/uploader": "^1.0",
    "coffeecode/cropper": "^1.0",
    "coffeecode/optimizer": "^1.0",
    "coffeecode/paginator": "^1.0",
    "coffeecode/router": "^1.0"
  }

/**
 * @param string $image
 * @param bool $unlinkImage
 * @return string
 */
public function toWebP(string $image, $unlinkImage = true): string
{
    try {
        $webPConverted = pathinfo($image)["dirname"] . "/" . pathinfo($image)["filename"] . ".webp";
        WebPConvert::convert($image, $webPConverted, ["default-quality" => $this->quality]);

        if ($unlinkImage) {
            unlink($image);
        }

        return $webPConverted;
    } catch (ConversionFailedException) {
        return $image;
    }
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文