Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[WIP][Serializer]Use PropertyInfo to extract properties#28775
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
[WIP][Serializer]Use PropertyInfo to extract properties#28775
Uh oh!
There was an error while loading.Please reload this page.
Conversation
dunglas left a comment
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.
Awesome, it will allow to dramatically simplify the component, then to improve its performance.
src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
| $properties =array(); | ||
| foreach ($reflectionPropertiesas$reflectionProperty) { | ||
| if ($reflectionProperty->isPublic()) { | ||
| if ($reflectionProperty->isPublic() && (!($context[self::EXCLUDE_STATIC_PROPERTIES] ??false) || !$reflectionProperty->isStatic())) { |
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.
It almost looks like a bug to me that we used to includestatic properties. I would like to change the default behavior and add a flag to include static props instead, but it's maybe to late (BC break). WDYT @symfony/deciders?
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.
Yeah, I am afraid changing that would be a BC break.
Uh oh!
There was an error while loading.Please reload this page.
…clude public static properties
Uh oh!
There was an error while loading.Please reload this page.
fbourigault commentedAug 9, 2019
I’m closing this PR because I don’t plan to work on it soon. |
Uh oh!
There was an error while loading.Please reload this page.
This is a small refactoring to reduce the complexity of the ObjectNormalizer. It now use a
PropertyListExtractorInterfaceto get the class properties list.To achieve this, I also added a
exclude_static_propertiesoption to theReflectionExtractor::getPropertiesmethod.Starting from this PR,
symfony/serializerhas a hard dependency onsymfony/property-info.This was exposed by@dunglas in#19374 (comment).
To do
exclude_static_properties.