【发布时间】:2020-01-24 15:50:17
【问题描述】:
我在尝试清除缓存并在 prod 服务器中安装 composer 时遇到此错误:
!!类中方法“addShow”中参数“show”的类型提示 “App\Entity\ !! 类型”无效。
这是 addShow 方法:
public function addShow(Show $show): self
{
if (!$this->shows->contains($show)) {
$this->shows[] = $show;
$show->setType($this);
}
return $this;
}
【问题讨论】:
-
看起来很明智,只要您在同一命名空间中确实有一个
Show实体(或有适当的 use 子句)。我希望 Show 实体不是新的且尚未部署? ^^
标签: symfony type-hinting