-
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
EntityGenerator lifecycle callbacks #11621
Conversation
When adding the same lifecycle event callback to two or more lifecycle events, the generator will create a stub for each event resulting in fatal 'Cannot redeclare' errors. That is, only if the callback name contains uppercase letters.
this will fix the fatal errors when having the same lifecycle event callback on multiple lifecycle events. Tests will still fail, since the necessary annotations for multiple lifecycle events are not properly added.
this will fix adding annotations for all referenced lifecycle events when creating lifecycle callback stubs. It takes case insensitivity into account.
It seems there are CI jobs failing. Please take a look at this guide for more on how to handle those. |
Sorry about that. I fixed the formatting according to phpcs output and locally no errors in the changed files are reported. |
fallback to parameter type detection in method body to not break extending classes
Please kindly squash your commits together. If you don't, we'll try to remember to do it for you but it's best if you save us this trouble. How to do that?
|
Argh, wrong branch… well, you will have to wait for 2.20.0 to get your bugfix. Thanks for working on that anyway, and congrats on your first contribution. |
Yeah, noticed that too when I read the part in the docs about picking the right branch 😆 thanks for your fast replies and your general work on doctrine! |
This PR addresses a problem in the Entity Generator. when adding the same lifecycle event callback to two or more lifecycle events the generator will create a stub for each event each with the same method name. This results in fatal 'Cannot redeclare' errors. This Problem occurred only if the callback name contains uppercase letters.
this PR intends to fix this issue by updating the EntityGenerator to allow the same callback to be triggered by multiple event.