传递给 ApiPlatformCoreBridgeDoctrineOrmMetadataPropertyDoctrineOrmPropertyMetadataFactory::__construct() 的参数 1 必须是一个实例……"

本教程将介绍“传递给 ApiPlatformCoreBridgeDoctrineOrmMetadataPropertyDoctrineOrmPropertyMetadataFactory::__construct() 的参数 1 必须是一个实例......"的处理方法,这篇教程是从别的地方看到的,然后加了一些国外程序员的疑问与解答,希望能对你有所帮助,好了,下面开始学习吧。

传递给 ApiPlatformCoreBridgeDoctrineOrmMetadataPropertyDoctrineOrmPropertyMetadataFactory::__construct() 的参数 1 必须是一个实例......" 教程 第1张

问题描述

在尝试安装 Api-Platform(或在现有 Api-Platform 安装上运行 composer update 时,我收到如下错误:

未捕获的错误:参数 1 传递给 ApiPlatformCoreBridgeDoctrineOrmMetadataPropertyDoctrineOrmPropertyMetadataFactory::__construct() 必须是 DoctrineCommonPersistenceManagerRegistry 的实例,DoctrineBundleDoctrineBundle 的实例给定的注册表,在第 1530 行的 App_KernelDevDebugContainer.php 中调用 [异常"=>类型错误 { …}]

怎么才能正确安装 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 包,并且每个包都可以正常工作.

好了关于“传递给 ApiPlatformCoreBridgeDoctrineOrmMetadataPropertyDoctrineOrmPropertyMetadataFactory::__construct() 的参数 1 必须是一个实例......"的教程就到这里就结束了,希望趣模板源码网找到的这篇技术文章能帮助到大家,更多技术教程可以在站内搜索。