Skip to content

[Serializer] Move the normalization logic in an abstract class #17191

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

Closed
wants to merge 3 commits into from

Conversation

dunglas
Copy link
Member

@dunglas dunglas commented Dec 30, 2015

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR n/a

As suggested by @xabbuh, move all the normalization logic for objects in an abstract class.
It will ease the maintenance as well as adding new features such as #17113 and #16143.

I've introduced a new abstract class to avoid BC breaks in AbstractNormalizer. As a (good) side effect, all normalizers now benefits from the caching system introduced in #16547.

*/
abstract class AbstractObjectNormalizer extends AbstractNormalizer
{
protected $attributesCache = array();
Copy link
Member

Choose a reason for hiding this comment

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

should be private IMO

@fabpot
Copy link
Member

fabpot commented Jan 4, 2016

Thank you @dunglas.

@fabpot fabpot closed this Jan 4, 2016
fabpot added a commit that referenced this pull request Jan 4, 2016
…ct class (dunglas)

This PR was squashed before being merged into the 3.1-dev branch (closes #17191).

Discussion
----------

[Serializer] Move the normalization logic in an abstract class

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

As suggested by @xabbuh, move all the normalization logic for objects in an abstract class.
It will ease the maintenance as well as adding new features such as #17113 and #16143.

I've introduced a new abstract class to avoid BC breaks in `AbstractNormalizer`. As a (good) side effect, all normalizers now benefits from the caching system introduced in #16547.

Commits
-------

3bec813 [Serializer] Move the normalization logic in an abstract class
@dunglas dunglas deleted the abstract_norm branch January 4, 2016 20:09
@fabpot fabpot mentioned this pull request May 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants