gpt4 book ai didi

php - "Argument 1 passed to ApiPlatform\Core\Bridge\Doctrine\Orm\Metadata\Property\DoctrineOrmPropertyMetadataFactory::__construct() must be an instance..."

转载 作者:行者123 更新时间:2023-12-04 08:59:45 25 4
gpt4 key购买 nike

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

Uncaught Error: Argument 1 passed to ApiPlatform\Core\Bridge\Doctrine\Orm\Metadata\Property\DoctrineOrmPropertyMetadataFactory::__construct() must be an instance of Doctrine\Common\Persistence\ManagerRegistry, instance of Doctrine\Bundle\DoctrineBundle\Registry given, called in App_KernelDevDebugContainer.php on line 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,您就可以删除该行。
Here是一个问题,您可以在其中密切关注讨论,并希望在此捆绑包级别上跟踪问题何时得到解决。

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

关于php - "Argument 1 passed to ApiPlatform\Core\Bridge\Doctrine\Orm\Metadata\Property\DoctrineOrmPropertyMetadataFactory::__construct() must be an instance...",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63619610/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com