在 Windows 上弃用了 Symfony 5.0.1 控制台中的 类 警告

Deprecated classes warnings in Symfony 5.0.1 console on Windows

执行后phpbin\consolemake:entity(用户实体)或phpbin\console make:migration 我在控制台收到这些警告:

2019-12-13T15:49:53+00:00 [info] User Deprecated: The Doctrine\Common\Persistence\ObjectRepository class is deprecated since doctrine/persistence 1.3 and will be removed in 2.0. Use \Doctrine\Persistence\ObjectRepository instead.

2019-12-13T15:49:53+00:00 [info] User Deprecated: The Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory class is deprecated since doctrine/persistence 1.3 and will be removed in 2.0. Use \Doctrine\Persistence\Mapping\AbstractClassMetadataFactory instead.

2019-12-13T15:49:53+00:00 [info] User Deprecated: The Doctrine\Common\PropertyChangedListener class is deprecated since doctrine/persistence 1.3 and will be removed in 2.0. Use \Doctrine\Persistence\PropertyChangedListener instead.

2019-12-13T15:49:53+00:00 [info] User Deprecated: The Doctrine\Common\Persistence\Mapping\RuntimeReflectionService class is deprecated since doctrine/persistence 1.3 and will be removed in 2.0. Use \Doctrine\Persistence\Mapping\RuntimeReflectionService instead.

2019-12-13T15:49:53+00:00 [info] User Deprecated: The Doctrine\Common\Persistence\Event\LoadClassMetadataEventArgs class is deprecated since doctrine/persistence 1.3 and will be removed in 2.0. Use \Doctrine\Persistence\Event\LoadClassMetadataEventArgs instead.

2019-12-13T15:49:53+00:00 [info] User Deprecated: The Doctrine\Common\Persistence\Mapping\StaticReflectionService class is deprecated since doctrine/persistence 1.3 and will be removed in 2.0. Use \Doctrine\Persistence\Mapping\StaticReflectionService instead.

关于如何解决...的任何想法?

此弃用通知已知。

Doctrine\Common\Persistence\ 将重命名为 Doctrine\Persistence,没有 "Common" 部分。

但是因为这是一个外部的且维护良好的依赖项,所以您不必太担心它。它会得到修复。我不建议您手动更改它,因为扩展 "ServiceEntityRepository" 的构造 class 期望 $registry 参数的类型为 '\Doctrine\Common\Persistence\ManagerRegistry'.

我会说...祝开发愉快并继续前进!这些弃用通知将在未来的更新中得到修复。您将不得不在某个时候更新您的存储库 classes。关注他们。