“传递给 ApiPlatformCoreBridgeDoctrineOrmMetadataPropertyDoctrineOrmPropertyMetadataFactory::__construct() 的参数 1 必须是一个实例......" [英] "Argument 1 passed to ApiPlatformCoreBridgeDoctrineOrmMetadataPropertyDoctrineOrmPropertyMetadataFactory::__construct() must be an instance..."

查看:21
本文介绍了“传递给 ApiPlatformCoreBridgeDoctrineOrmMetadataPropertyDoctrineOrmPropertyMetadataFactory::__construct() 的参数 1 必须是一个实例......"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

While attempting to install Api-Platform (or run composer update on an existing Api-Platform installation, I get an error like this:

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

Uncaught Error: Argument 1 passed to ApiPlatformCoreBridgeDoctrineOrmMetadataPropertyDoctrineOrmPropertyMetadataFactory::__construct() must be an instance of DoctrineCommonPersistenceManagerRegistry, instance of DoctrineBundleDoctrineBundleRegistry given, called in App_KernelDevDebugContainer.php on line 1530 ["exception" => TypeError { …}]

如何才能正确安装 Api-Platform?为什么更新失败?

What can I do to be able to install Api-Platform correctly? Why is it failing on an update?

推荐答案

在新版本的 Api-Platform 发布之前(可能会相对较快),您可以通过将其添加到您的 composer 来回避这个问题.json:

Until a new version of Api-Platform is released (which will probably be relatively soon), you can sidestep the issue by adding this to your composer.json:

"conflict": {
    "doctrine/common": ">= 3.0",
    "doctrine/persistence": "^1.0"
}

(由于您可能已经有一个 conflict 键,只需将一行添加到您现有的 conflict 规则中).

(Since you are likely to already have a conflict key, just add the one line to your existing conflict rules).

doctrine/common新版本发布,当前版本的Api-Platform不兼容.

A new version ofdoctrine/common was released, and the current version of Api-Platform is not compatible with it.

在不久的将来,一旦新版本的 Api-Platform 发布,您就可以删除该行.

Sometime in the near future you'll be able to remove that line, once a new version of Api-Platform is released.

这里是一个问题,大家可以关注讨论,并希望在此捆绑包级别解决问题的时间.

Here is an issue where you can keep an eye on the discussion, and hopefully track when the issue is resolved at this bundle's level.

这不再是必要的.您可以使用最新的 Api-Platform 包更新到最新的 Doctrine 包,并且每个包都可以正常工作.

This is no longer necessary. You can update to the latest Doctrine packages with the latest Api-Platform package, and every works fine together.

这篇关于“传递给 ApiPlatformCoreBridgeDoctrineOrmMetadataPropertyDoctrineOrmPropertyMetadataFactory::__construct() 的参数 1 必须是一个实例......"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆