api-platform / core

The server component of API Platform: hypermedia and GraphQL APIs in minutes
https://api-platform.com
MIT License
2.45k stars 874 forks source link

Doctrine\Persistence deprecations warning #3314

Closed destevetewis closed 2 years ago

destevetewis commented 4 years ago

Right now symfony returns multiple errors of deprecation related to doctrine persistence.

More information at https://github.com/doctrine/persistence/pull/82

PHP    User Deprecated: The Doctrine\Common\Persistence\Proxy class is deprecated since doctrine/persistence 1.3 and will be removed in 2.0. Use \Doctrine\Persistence\Proxy instead.
PHP    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.
PHP    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.
PHP    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.
PHP    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.
PHP    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.
alanpoulain commented 4 years ago

I think it would be hard to remove these deprecations if we don't to break everything because it would need to require "doctrine/persistence": "^1.3.3". We can maybe do it in master for the next version of API Platform. WDYT @teohhanhui?

teohhanhui commented 4 years ago

I suppose we don't want to prevent anyone from updating to the next patch version (e.g. for any security issues), so yeah, we have to do it in the next minor version.

cybernet commented 4 years ago

wait for https://github.com/doctrine/orm/pull/7953

teohhanhui commented 4 years ago

I don't think doctrine/orm#7953 will remove all the deprecations we're seeing here. We need to make some changes in API Platform too.

beberlei commented 4 years ago

We released a 1.3.4 of persistence and rolled back the deprecation messages coming from doctrine/orm, and will only emit them when 1.4 is released. The idea is that all external code depends on doctrine/persistence version ^1.3 and then the ORM and/or mongodb-odm will raise to 1.4 in the near future when they are compatible. This way we will defer the deprecation messages until we ourselves are compatible.