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

[Serializer] Remove normalizer cache in Serializer class#17140

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

Merged
Tobion merged 1 commit intosymfony:2.3fromjvasseur:remove-normalizer-cache
Jan 12, 2016

Conversation

@jvasseur
Copy link
Contributor

QA
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets
LicenseMIT
Doc PR

The serializer cache the normalizer/denormalizer to use based only on the class and format. But the supportsNormalization and supportDenormalization methods can decide based on the data passed leading to hard to find bugs when the serializer used a cached normalizer it shouldn't use.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

this is a BC break. so it cannot be merged as-is in 2.3

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Oh, didn't see they were protected and not private. Should i just keep them or keep the logic that is filling them to ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'd say we should keep them but never fill them, and keep reading from them in case someone fills them with its own logic

@jvasseur
Copy link
ContributorAuthor

Updated to keep BC as suggested by@nicolas-grekas.

@xabbuh
Copy link
Member

Can we add a test that would fail when the caching was added again to prevent regressions?

@nicolas-grekas
Copy link
Member

A meaningful test would be one implementing a (de)normalizer that uses the data as described above.

@jvasseurjvasseurforce-pushed theremove-normalizer-cache branch 2 times, most recently from8f21051 to4ea7745CompareJanuary 3, 2016 17:03
@jvasseurjvasseurforce-pushed theremove-normalizer-cache branch from4ea7745 to8566dc1CompareJanuary 3, 2016 17:08
@jvasseur
Copy link
ContributorAuthor

Tests added.

@xabbuh
Copy link
Member

👍

Status: Reviewed

@dunglas
Copy link
Member

👍

@dunglas
Copy link
Member

Btw,$context should be added as last argument ofsupportNormalization/supportDenormalization as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

those properties should be annotated with@deprecated

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I was planning to do a PR to master to deprecate them after this one is merged.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I see. 👍

@nicolas-grekas
Copy link
Member

👍

@Tobion
Copy link
Contributor

Thank you@jvasseur.

@TobionTobion merged commit8566dc1 intosymfony:2.3Jan 12, 2016
Tobion added a commit that referenced this pull requestJan 12, 2016
…jvasseur)This PR was merged into the 2.3 branch.Discussion----------[Serializer] Remove normalizer cache in Serializer class| Q             | A| ------------- | ---| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        |The serializer cache the normalizer/denormalizer to use based only on the class and format. But the supportsNormalization and supportDenormalization methods can decide based on the data passed leading to hard to find bugs when the serializer used a cached normalizer it shouldn't use.Commits-------8566dc1 Remove normalizer cache in Serializer class
@jvasseurjvasseur deleted the remove-normalizer-cache branchJanuary 12, 2016 13:08
This was referencedJan 14, 2016
@fabpotfabpot mentioned this pull requestFeb 3, 2016
nicolas-grekas added a commit that referenced this pull requestApr 19, 2016
This PR was squashed before being merged into the 3.1-dev branch (closes#18588).Discussion----------[Serializer] Add deprecation notices| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | yes| Tests pass?   | yes| Fixed tickets |#17140| License       | MIT| Doc PR        | noneAs discussed in#18583, add deprecation notices to `master` instead.Commits-------d3063ed [Serializer] Add deprecation notices
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@jvasseur@xabbuh@nicolas-grekas@dunglas@Tobion@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp