-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[VarExporter] Fixed lazy-loading ghost objects generation with property hooks #60421
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
Conversation
Hey! I see that this is your first PR. That is great! Welcome! Symfony has a contribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
This comment was marked as outdated.
This comment was marked as outdated.
@@ -86,7 +86,7 @@ public static function generateLazyGhost(\ReflectionClass $class): string | ||
.($p->isProtected() ? 'protected' : 'public') | ||
.($p->isProtectedSet() ? ' protected(set)' : '') | ||
." {$type} \${$name}" | ||
.($p->hasDefaultValue() ? ' = '.$p->getDefaultValue() : '') | ||
.($p->hasDefaultValue() ? ' = '.VarExporter::export($p->getDefaultValue()) : '') |
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.
actually this should use the exportDefault helper
and the PR should target branch 6.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.
let's keep as is, I don't think my suggestion is valid for properties
07d3906
to
0c71a93
Compare
Thank you @cheack. |
Fixed the bug introduced in #60288.
If the type is boolean:
an empty string is exported:
which leads to
ParseError: syntax error, unexpected token "{"
error.