-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
641eb3f
1632267
da41bcb
c29d971
ede5bdb
2aa0779
3498ab5
ea96a4d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,8 @@ | |
*/ | ||
class ReflectionExtractor implements PropertyListExtractorInterface, PropertyTypeExtractorInterface, PropertyAccessExtractorInterface, PropertyInitializableExtractorInterface | ||
{ | ||
public const EXCLUDE_STATIC_PROPERTIES = 'exclude_static_properties'; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
|
@@ -75,7 +77,7 @@ public function getProperties($class, array $context = array()) | |
|
||
$properties = array(); | ||
foreach ($reflectionProperties as $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 commentThe reason will be displayed to describe this comment to others. Learn more. It almost looks like a bug to me that we used to include There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I am afraid changing that would be a BC break. |
||
$properties[$reflectionProperty->name] = $reflectionProperty->name; | ||
} | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.