作曲家更新后@template 注释出现问题

Problem with @template annotation after composer update

我在我的 Sylius 项目中将 Doctrine 更新到最新版本。更新后我收到以下错误。

[Semantical Error] The annotation "@template" in class Doctrine\Common\Collections\ArrayCollection was never imported. Did you maybe forget to add a "use" statement for this annotation?

有人可以帮我吗?

更新日志:

Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 3 installs, 5 updates, 0 removals
  - Updating doctrine/collections (v1.3.0 => v1.6.0): Loading from cache
  - Installing doctrine/reflection (v1.0.0): Loading from cache
  - Installing doctrine/event-manager (v1.0.0): Loading from cache
  - Installing doctrine/persistence (v1.1.0): Loading from cache
  - Updating doctrine/common (v2.8.1 => v2.10.0): Loading from cache
  - Updating doctrine/dbal (v2.6.3 => v2.9.2): Loading from cache
  - Updating doctrine/orm (v2.5.14 => v2.6.3): Loading from cache
  - Updating symfony/doctrine-bridge (v4.1.11 => v4.2.4): Loading from cache
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Package symplify/token-runner is abandoned, you should avoid using it. Use https://github.com/symplify/codingstandard instead.
Writing lock file
Generating autoload files
muglug/package-versions-56:  Generating version class...
muglug/package-versions-56: ...done generating version class
ocramius/package-versions:  Generating version class...
ocramius/package-versions: ...done generating version class

What about running composer thanks now?
This will spread some   by sending a ★  to 271 GitHub repositories of your fellow package maintainers.

Executing script cache:clear [OK]
Executing script assets:install public [OK]

我在自动更新时遇到同样的错误 doctrine/collections (v1.5.0 => v1.6.0)。 尝试使用v1.5.0版本。

同样的问题,这似乎是您在 require 或 require-dev 中的一个依赖关系已损坏。尝试仅升级您需要的依赖项。如果您升级了一个并且由于此错误而失败,请将错误报告给维护者。

是的 - 如果您将软件包 doctrine/collection 降级到 1.5 版,一切正常。

这是一些信息:

https://github.com/doctrine/collections/issues/180

此问题已在 1.6.1 版本中修复。就运行一个composer update应该就解决了。有关详细信息,请参阅发布详情 here