quot;Argument 1 passed to ApiPlatformCoreBridgeDoctrineOrmMetadataPropertyDoctrineOrmPropertyMetadataFactory::__construct() must be an instance...quot;(“传递给 ApiPlatformCoreBridgeDoctrineOrmMetadataPropertyDoctrineOrmPropertyMetadataFactory::__construct()
问题描述
在尝试安装 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 必须是一个实例......"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:“传递给 ApiPlatformCoreBridgeDoctrineOrmMetadataPropertyDoctrineOrmPropertyMetadataFactory::__construct() 的参数 1 必须是一个实例......"
基础教程推荐
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 如何替换eregi() 2022-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
