-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[VarExporter] Cannot unset hooked property #59153
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
Comments
@nicolas-grekas for hooked properties, should the generated code override the properties by using hooks as well to trigger initialization ? |
Hello, waiting resolution, you can extend by PersistentObjectFactory instead of PersistentProxyObjectFactory |
Same problem here. Looking forward for a fix 👍 |
Ran into this a few times now. Always had to refrain from using property hooks. Any fixes soon? |
…olas-grekas) This PR was merged into the 6.4 branch. Discussion ---------- [VarExporter] Fix lazy objects with hooked properties | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #59153 | License | MIT With hook proxies when needed so that lazy objects are fully compatible with non-final hooks. Commits ------- 540253a [VarExporter] Fix lazy objects with hooked properties
Symfony version(s) affected
7.2
Description
When creating a lazy proxy using the
vendor/symfony/var-exporter/LazyProxyTrait.php
from an object that contains a hooked property (PHP 8.4) an error is being thrown:Error: cannot unset hooked property <class::property>
The error is triggered on:
vendor/symfony/var-exporter/Internal/LazyObjectRegistry.php::73
How to reproduce
Create a zenstruck/foundry factory for an entity which contains a hooked property. Calling any method (for example
::find()
or::createOne()
) will throw the error.Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: