-
-
Couldn't load subscription status.
- Fork 190
BUGFIX: Handle enums and attributes (Objects) in attribute arguments for proxy classes #3512
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
base: 8.4
Are you sure you want to change the base?
BUGFIX: Handle enums and attributes (Objects) in attribute arguments for proxy classes #3512
Conversation
572c495 to
6feb72b
Compare
…ibutes during proxy building
42949ba to
a37bea6
Compare
The code generated by var_export for objects (and enums) is not valid to be used in attributes as those require a constant expression. This change addresses that by: - rendering Enums correctly - rendering other objects by filling constructor arguments with public property or getter values - handling array arguments by calling the above recursively
045e04f to
4251d77
Compare
This is done by using the method Compiler::renderAttribute instead of a local implementation
4251d77 to
34c8208
Compare
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.
👍 by 👀
|
Please Note: This change reverts a change from the proxyMethod builder that used the Compiler::renderAttribute in 8.3 but got its own methods for that in 8.4. I am not sure why as the logic is a bit tricky and it should be beneficial to only have one source of issues. |
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.
Fine by reading, but to be honest, I can't tell without further testing, if it works as intended. The test looks good at least ;-)
Handle Enums nested Attributes (actually any Objects) in attribute arguments for proxy classes.
Currently the Attributes for generated proxy classes have some limitations:
This change addresses that by:
!!! This on itself does not add attribute support for persistence. See #3508 for that !!!
resolves: #3511
relates: #3075
Upgrade instructions
No changes are needed only cases that previously yielded errors should work now.
Review instructions
The inference of constructor arguments from values obtained via ObjectAccess is close but not perfect. However it works in the cases we want to support like Doctrine Table Attributes and probably most other cases aswell.
Checklist
FEATURE|TASK|BUGFIX!!!and have upgrade-instructions