问题
After executing php bin\console make:entity(User entity) or php bin\console make:migration i get these warnings in console:
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.
Any idea on how to resolve...?
回答1:
This deprecation notice is known.
Doctrine\Common\Persistence\ will be renamed to Doctrine\Persistence without the "Common" part.
But because this is in an external and well maintained dependency you don't have to worry about it too much. it will get fixed. I wouldn't advise you to change it manually because the construct class of the extended "ServiceEntityRepository" is expecting the $registry parameter to be of type '\Doctrine\Common\Persistence\ManagerRegistry'.
I would say... happy developing and keep on going! These deprecation notices will get fixed with a future update. you will have to update your repository classes at some point. just keep an eye on them.
来源:https://stackoverflow.com/questions/59326187/deprecated-classes-warnings-in-symfony-5-0-1-console-on-windows