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

Die*_*son 3 php doctrine symfony doctrine-orm

执行php bin\console make:entity (User entity) 或php bin\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.
Run Code Online (Sandbox Code Playgroud)

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

小智 11

此弃用通知是已知的。

Doctrine\Common\Persistence\ 将被重命名为 Doctrine\Persistence,没有“Common”部分。

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

我会说......快乐发展并继续前进!这些弃用通知将在未来的更新中得到修复。您将不得不在某个时候更新您的存储库类。只要留意他们。