-2

我正在尝试将我的项目从symfony 3.4一个4.4版本升级,我正在删除弃用,唯一剩下的就是

User Deprecated: The "Doctrine\Common\Inflector\Inflector::classify" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.

我试图删除它并更改doctrine版本composer.json并尝试将变形器 2.0 安装到但我得到并执行错误composer install

任何人都知道如何解决这个弃用?

如果我尝试执行composer require doctrine/inflector:2.0.4,我会收到此错误

您的要求无法解决为一组可安装的软件包。

  Problem 1
    - Root composer.json requires symfony/phpunit-bridge ^3.0, found symfony/phpunit-bridge[v3.0.0, ..., v3.4.47] but the package is fixed to v5.3.10 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
  Problem 2
    - doctrine/orm is locked to version 2.7.5 and an update of this package was not requested.
    - doctrine/orm 2.7.5 requires doctrine/inflector ^1.0 -> found doctrine/inflector[v1.0, ..., 1.4.4] but it conflicts with your root composer.json require (^2.0).
  Problem 3
    - doctrine/orm 2.7.5 requires doctrine/inflector ^1.0 -> found doctrine/inflector[v1.0, ..., 1.4.4] but it conflicts with your root composer.json require (^2.0).
    - doctrine/doctrine-fixtures-bundle 3.4.1 requires doctrine/orm ^2.6.0 -> satisfiable by doctrine/orm[2.7.5].
    - doctrine/doctrine-fixtures-bundle is locked to version 3.4.1 and an update of this package was not requested.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

安装doctrine 2.8

"doctrine/orm": "^2.8",

composer update --with-all-dependencies

我明白了

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install doctrine/orm 2.8.1 (conflict analysis result)
    - doctrine/common 2.13.0 requires doctrine/persistence ^1.3.3 -> satisfiable by doctrine/persistence[1.3.3, ..., 1.3.8].
    - Conclusion: don't install doctrine/common[2.13.2] | install one of doctrine/orm[2.8.2, ..., 2.10.4], doctrine/common[3.0.3, ..., 3.2.0] (conflict analysis result)
    - Conclusion: don't install doctrine/common[2.13.1] | install one of doctrine/orm[2.8.5, ..., 2.10.4], doctrine/persistence[1.3.5, 1.3.6, 1.3.7, 1.3.8], doctrine/common[3.0.3, ..., 3.2.0] (conflict analysis result)
    - Conclusion: don't install doctrine/persistence[1.3.3] | install one of doctrine/orm[2.8.5, ..., 2.10.4] (conflict analysis result)
    - Conclusion: don't install doctrine/persistence[1.3.8] | install one of doctrine/orm[2.8.2, ..., 2.9.6] (conflict analysis result)
    - Conclusion: don't install doctrine/persistence[1.3.7] | install one of doctrine/orm[2.8.5, ..., 2.9.6] (conflict analysis result)
    - Conclusion: don't install doctrine/persistence[1.3.6] | install one of doctrine/orm[2.8.5, ..., 2.9.6] (conflict analysis result)
    - Conclusion: don't install doctrine/persistence[1.3.5] | install one of doctrine/orm[2.8.5, ..., 2.10.4] (conflict analysis result)
    - Conclusion: don't install doctrine/common[2.13.3] | install one of doctrine/orm[2.8.2, ..., 2.10.4], doctrine/common[3.0.3, ..., 3.2.0] (conflict analysis result)
    - doctrine/orm[2.8.2, ..., 2.10.4] require doctrine/common ^3.0.3 -> satisfiable by doctrine/common[3.0.3, ..., 3.2.1].
    - Conclusion: don't install doctrine/common[3.2.0] | install gedmo/doctrine-extensions[v2.4.42] (conflict analysis result)
    - Conclusion: don't install doctrine/common[3.1.2] | install gedmo/doctrine-extensions[v2.4.42] (conflict analysis result)
    - Conclusion: don't install doctrine/common[3.1.1] | install gedmo/doctrine-extensions[v2.4.42] (conflict analysis result)
    - Conclusion: don't install doctrine/common[3.1.0] | install gedmo/doctrine-extensions[v2.4.42] (conflict analysis result)
    - Conclusion: don't install doctrine/common[3.0.3] | install gedmo/doctrine-extensions[v2.4.42] (conflict analysis result)
    - Conclusion: don't install gedmo/doctrine-extensions v2.4.42 (conflict analysis result)
    - Conclusion: don't install doctrine/persistence 1.3.4 (conflict analysis result)
    - Conclusion: don't install doctrine/common 3.2.1 (conflict analysis result)
    - Root composer.json requires symfony/symfony 3.4.* -> satisfiable by symfony/symfony[v3.4.0, ..., v3.4.49].
    - Conclusion: don't install gedmo/doctrine-extensions v2.4.41 (conflict analysis result)
    - Conclusion: don't install doctrine/common 3.0.2 (conflict analysis result)
    - Root composer.json requires sensio/framework-extra-bundle ^5.0.0 -> satisfiable by sensio/framework-extra-bundle[v5.0.0, ..., v5.6.1].
    - Root composer.json requires doctrine/orm ^2.8 -> satisfiable by doctrine/orm[2.8.0, ..., 2.10.4].
    - gedmo/doctrine-extensions[v2.4.0, ..., v2.4.40] require doctrine/common ~2.4 -> satisfiable by doctrine/common[v2.4.0, ..., 2.13.3].
    - You can only install one version of a package, so only one of these can be installed: doctrine/common[2.2.0, ..., 2.13.3, 3.0.0, ..., 3.2.1].
    - doctrine/orm 2.8.0 requires doctrine/common ^3.0 -> satisfiable by doctrine/common[3.0.0, ..., 3.2.1].
    - Conclusion: don't install doctrine/common 3.0.1 (conflict analysis result)
    - Root composer.json requires gedmo/doctrine-extensions ^2.4 -> satisfiable by gedmo/doctrine-extensions[v2.4.0, ..., v2.4.42].
4

1 回答 1

-1

即使您更新了所有组件,这并不意味着这些组件本身都已更新以避免不推荐使用的调用。但由于这只是一个弃用通知,并不意味着任何事情都行不通。


如果要检查调用此函数的位置,请启用 XDebug,在给定函数上设置断点,然后运行代码。如果调用发生在任何库中(而不是在您自己的代码中),请检查该库是否有进一步的更新。


看到您的编辑后:您doctrine/orm在 v2.7.5 中使用。此版本与doctrine/inflectorv2 不兼容。您需要更新doctrine/orm到任何最新版本。甚至 v2.8.0 也被标记为与 Inflector 的新主要版本兼容,这可能会解决弃用通知


在看到下一个编辑后:doctrine/orm 由于gedmo/doctrine-extensionsv2.4 与doctrine/commonv3 不兼容,因此无法更新,因此这是下一个要更新的包。只需尝试阅读 Composer 提供的错误消息。这些部分非常清楚:

- gedmo/doctrine-extensions[v2.4.0, ..., v2.4.40] require doctrine/common ~2.4 -> satisfiable by doctrine/common[v2.4.0, ..., 2.13.3].
- You can only install one version of a package, so only one of these can be installed: doctrine/common[2.2.0, ..., 2.13.3, 3.0.0, ..., 3.2.1].
- doctrine/orm 2.8.0 requires doctrine/common ^3.0 -> satisfiable by doctrine/common[3.0.0, ..., 3.2.1].
- Conclusion: don't install doctrine/common 3.0.1 (conflict analysis result)
- Root composer.json requires gedmo/doctrine-extensions ^2.4 -> satisfiable by gedmo/doctrine-extensions[v2.4.0, ..., v2.4.42].
于 2021-12-30T10:18:13.443 回答