Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Closed
fbourigault wants to merge8 commits intosymfony:masterfromfbourigault:object-normalizer-property-list-extractor
Closed

[WIP][Serializer]Use PropertyInfo to extract properties#28775

fbourigault wants to merge8 commits intosymfony:masterfromfbourigault:object-normalizer-property-list-extractor

Conversation

@fbourigault
Copy link
Contributor

@fbourigaultfbourigault commentedOct 8, 2018
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets?
LicenseMIT
Doc PRsymfony/symfony-docs#10530

This is a small refactoring to reduce the complexity of the ObjectNormalizer. It now use aPropertyListExtractorInterface to get the class properties list.

To achieve this, I also added aexclude_static_properties option to theReflectionExtractor::getProperties method.

Starting from this PR,symfony/serializer has a hard dependency onsymfony/property-info.

This was exposed by@dunglas in#19374 (comment).

To do

  • add a CHANGELOG.md entry.
  • documentation forexclude_static_properties.
  • check for performance regression.

dunglas reacted with heart emoji
Copy link
Member

@dunglasdunglas left a 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.

$properties =array();
foreach ($reflectionPropertiesas$reflectionProperty) {
if ($reflectionProperty->isPublic()) {
if ($reflectionProperty->isPublic() && (!($context[self::EXCLUDE_STATIC_PROPERTIES] ??false) || !$reflectionProperty->isStatic())) {
Copy link
Member

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?

Copy link
Member

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.

dunglas reacted with confused emoji
@fbourigaultfbourigault changed the title[Serializer]Use PropertyInfo to extract properties[WIP][Serializer]Use PropertyInfo to extract propertiesDec 10, 2018
@fbourigault
Copy link
ContributorAuthor

I’m closing this PR because I don’t plan to work on it soon.

@nicolas-grekasnicolas-grekas removed this from thenext milestoneOct 27, 2019
@nicolas-grekasnicolas-grekas added this to the4.4 milestoneOct 27, 2019
@fbourigaultfbourigault deleted the object-normalizer-property-list-extractor branchJune 24, 2021 13:38
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@xabbuhxabbuhxabbuh requested changes

@dunglasdunglasdunglas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

5 participants

@fbourigault@dunglas@xabbuh@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp