-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate not-enabling lazy-ghosts and decouple from doctrine/common's proxies #10837
Conversation
b5e9857
to
50073f2
Compare
12cd909
to
3816466
Compare
@@ -181,6 +292,8 @@ protected function createProxyDefinition($className) | |||
/** | |||
* Creates a closure capable of initializing a proxy | |||
* | |||
* @deprecated ProxyFactory::createInitializer() is deprecated and will be removed in version 3.0 of doctrine/orm. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to deprecate a private method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added those to help when cleaning for 3.0. Let me know.
3816466
to
cd25528
Compare
PR updated, thanks for the review @derrabus |
84c6f4c
to
21dd52a
Compare
PR rebased, all green! |
* first time in a request. When the proxied file is changed, the proxy will | ||
* be updated. | ||
*/ | ||
public const AUTOGENERATE_FILE_NOT_EXISTS_OR_CHANGED = 4; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be done later: We could think about moving those constants into a separate class, which would allow us to convert that class into an enum in 3.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it's worth the trouble for the community, especially because those might not be needed at all with the anticipated native lazy objects.
Deprecation::trigger( | ||
'doctrine/orm', | ||
'https://github.com/doctrine/orm/pull/10837/', | ||
'Not enabling lazy ghost objects is deprecated and will not be supported in Doctrine ORM 3.0. Ensure Doctrine\ORM\Configuration::setLazyGhostObjectEnabled(true) is called to enable them.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should deprecate calling Configuration::setLazyGhostObjectEnabled(false)
as well because true
is going to be the only valid setting in 3.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's kinda already the case, because if you set this to false, you'll get the deprecation added to ProxyFactory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see.
Rebase needed. |
21dd52a
to
e1d7ddd
Compare
Rebased and 🍏 |
e1d7ddd
to
a195469
Compare
This PR was merged into the 5.4 branch. Discussion ---------- [DoctrineBridge] Silence ORM deprecation | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - > Not enabling lazy ghost objects is deprecated and will not be supported in Doctrine ORM 3.0. Ensure Doctrine\ORM\Configuration::setLazyGhostObjectEnabled(true) is called to enable them. (ProxyFactory.php:166 called by EntityManager.php:178, doctrine/orm#10837, package doctrine/orm) Commits ------- f42e2c1 [DoctrineBridge] Silence ORM deprecation
This PR deprecates not-enabling lazy-ghosts so that ORM v3 can drop support for doctrine/common's proxies.
It also rewrites ProxyFactory so that when lazy-ghosts are enabled, none of the code in the
Doctrine\Common\Proxy
namespace is run. This enables deprecating everything related to proxies in doctrine/common.