首页 > 解决方案 > 运行 php artisan cache:clear Declaration of Symfony\Component\Translation\TranslatorInterface::setLocale($locale) 后出现错误

问题描述

运行后php artisan cache:clear

我收到错误:

Symfony\Component\Translation\TranslatorInterface::setLocale($locale) 的声明必须与 Symfony\Contracts\Translation\LocaleAwareInterface::setLocale(string $locale) 兼容

标签: phplaravellaravel-5

解决方案


我有同样的错误

我通过添加解决了

"symfony/translation": "4.3.8"

到我的 composer.json 文件

然后运行 composer update

之后一切都很好


推荐阅读