php - “传递给 ApiPlatform\Core\Bridge\Doctrine\Orm\Metadata\Property\DoctrineOrmPropertyMetadataFactory::__construct() 的参数 1 必须是一个实例......”
问题描述
在尝试安装 Api-Platform(或composer update
在现有的 Api-Platform 安装上运行时,我收到如下错误:
未捕获的错误:参数 1 传递给 ApiPlatform\Core\Bridge\Doctrine\Orm\Metadata\Property\DoctrineOrmPropertyMetadataFactory::__construct() 必须是 Doctrine\Common\Persistence\ManagerRegistry 的实例,给定的 Doctrine\Bundle\DoctrineBundle\Registry 实例,在 App_KernelDevDebugContainer.php 的第 1530 行调用 ["exception" => TypeError { …}]
我该怎么做才能正确安装 Api-Platform?为什么更新失败?
解决方案
在发布新版本的 Api-Platform 之前(可能会相对较快),您可以通过将其添加到您的composer.json
:
"conflict": {
"doctrine/common": ">= 3.0",
"doctrine/persistence": "^1.0"
}
(由于您可能已经有一个conflict
密钥,只需将一行添加到您现有的conflict
规则中)。
新版本doctrine/common
发布,当前版本的Api-Platform不兼容。
在不久的将来某个时候,一旦发布了新版本的 Api-Platform,您就可以删除该行。
这是一个问题,您可以在其中密切关注讨论,并希望在此捆绑包级别上跟踪问题何时得到解决。
这不再是必要的。您可以使用最新的 Api-Platform 包更新到最新的 Doctrine 包,并且每个包都可以正常工作。
推荐阅读
- python - 测试副本集上带有 ReadPreference Secondary 的事务上的 MongoDB 错误
- python - 将表从数据库导出到 mdf 文件
- r - 在R中使用enrichGO对TAIR进行富集分析时不映射任何内容
- vue.js - 使用 Nuxt 添加多个加载组件
- javascript - 在 Vue 应用程序中粘贴大型内容时,Quill Editor 会略微向上滚动
- database-design - 数据仓库设计——创建无主键的维度表
- c# - C#裁剪图像梯形/多边形
- flutter - 连接两个 document.data()['field'] 字段
- flutter - 在没有 super.dispose() 的情况下覆盖 dispose() 是否有效?
- google-apps-script - 如何使用新工作表作为输入源来总结将它们排序为日期的值