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

quot;Argument 1 passed to ApiPlatformCoreBridgeDoctrineOrmMetadataPropertyDoctrineOrmPropertyMetadataFactory::__construct() must be an instance...quot;(“传递给 ApiPlatformCoreBridgeDoctrineOrmMetadataPropertyDoctrineOrmPropertyMetadataFactory::__construct()
本文介绍了“传递给 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 必须是一个实例......"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Convert JSON integers and floats to strings(将JSON整数和浮点数转换为字符串)
in php how do I use preg replace to turn a url into a tinyurl(在php中,如何使用preg替换将URL转换为TinyURL)
all day appointment for ics calendar file wont work(ICS日历文件的全天约会不起作用)
trim function is giving unexpected values php(Trim函数提供了意外的值php)
Basic PDO connection to MySQL(到MySQL的基本PDO连接)
PHP number_format returns 1.00(Php number_Format返回1.00)