-
-
Notifications
You must be signed in to change notification settings - Fork 389
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
Leverage LazyProxyTrait in LazySchemaDiffProvider #1273
Conversation
12bc44d
to
4d6fe1b
Compare
phpstan report is only about false positives:
Yes it is: by the trait.
No it's not: undefined properties are not in objects cast to arrays. |
Add those errors to the |
dbbe0fa
to
2b6b124
Compare
Merging this is blocked on the stable release of Symfony 6.2 though |
e6c96fa
to
4041c76
Compare
Looking at https://packagist.org/packages/doctrine/migrations/php-stats#3, PHP 8.1 only represents 45% of the installations for doctrine/migrations 3.x. The bump might be too early (the wait for the stable release of Symfony 6.2 gives us 2.5 months before re-evaluating that ratio anyway) |
My attempt at getting the CI green: #1274 |
a55f734
to
eb91ae8
Compare
@nicolas-grekas This is true for |
I could not add it because it would make the trait incompatible with readonly classes (there's a test case about that in the component) |
if the trait supports making the property readonly, maybe it should always have it readonly ? Non-readonly classes can have readonly properties. |
Making lazyObjectId readonly breaks cloning... I opened a discussion on php-internals about this and almost nobody dared to care for now... I hope this could be resolved soon... |
Can you please rebase? The CI on 3.6.x should be green now. |
5e64e5e
to
adba576
Compare
Rebased. I don't reproduce the deps=low failure locally, I need to understand why it happens. I thought it might be because of composer/composer#11068 but apparently not. |
ee3a2d3
to
f42a06a
Compare
I figured out the issue, all green. |
f42a06a
to
cc68982
Compare
$this->originalSchemaManipulator = $originalSchemaManipulator; | ||
} | ||
|
||
public static function fromDefaultProxyFactoryConfiguration( |
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.
this method should probably be deprecated instead of being removed
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.
the class is marked @internal
so I didn't bother doing that :)
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.
ah indeed. I missed that
Ready for merge! 🚀 |
Just did a merge-up, it should fix the SA job (the BC check will still be broken). |
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.
A lot less code :)
@nicolas-grekas I'm just seeing this update, but due to the requirement on |
older versions of var-exporter don't have that LazyProxyTrait |
Thanks for the report. This should now be fixed. I did so by reporting that var-exporter didn't existing before 6.2, see This should allow installing var-exporter at v6.2 while the rest is at 5.4. |
Thank you! That should help indeed. |
This fixed it indeed, thanks! |
This PR proposes to leverage the new
LazyProxyTrait
that's going to be shipped with Symfony 6.2 to implement lazy schemas as required by LazySchemaDiffProvider. (See https://symfony.com/blog/revisiting-lazy-loading-proxies-in-php for an introduction to this trait.)This would require bumping the minimum PHP version to 8.1 in the next minor version.
The main benefit is simplicity. As you can read in the patch, using this trait requires no proxy generation infrastructure, and no calls to
eval()
either. The other benefit is simplifying dependency management.