This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/Serializer
Fabien Potencier 9db435ed0c feature #27819 [Serializer] deprecated normalizers and encoders who dont implement the base interfaces (rodnaph)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Serializer] deprecated normalizers and encoders who dont implement the base interfaces

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | None
| License       | MIT
| Doc PR        | None

Currently the `Serializer` can be constructed with any object regardless of whether or not it implements `NormalizerInterface` or `DenormalizerInterface`. This object will then be ignored when getting a normalizer/denormalizer, so in effect silently ignored for serializer operations.

This change throws an exception on construct if a given normalizer object does not implement one of these interfaces - are there use cases where this would not be true?

Commits
-------

cbc2be8ba8 [Serializer] deprecated normalizers and encoders who dont implement the base interfaces
2018-09-25 11:53:27 +02:00
..
Annotation Merge branch '4.0' into 4.1 2018-07-26 10:55:25 +02:00
DependencyInjection Merge branch '3.4' into 4.0 2018-07-26 11:08:35 +02:00
Encoder Add support for ignoring comments while XML encoding 2018-08-28 00:11:30 +02:00
Exception Mark ExceptionInterfaces throwable 2018-08-29 17:58:00 +02:00
Mapping Fix tests for legacy phpunit versions 2018-07-26 13:58:24 +02:00
NameConverter [Serializer] Allow to access extra infos in name converters 2018-09-04 15:36:54 +02:00
Normalizer Favor LogicException for missing classes & functions 2018-09-24 09:37:12 +02:00
Tests feature #27819 [Serializer] deprecated normalizers and encoders who dont implement the base interfaces (rodnaph) 2018-09-25 11:53:27 +02:00
.gitignore Added missing files .gitignore 2013-07-21 14:12:18 +02:00
CHANGELOG.md [Serializer] deprecated normalizers and encoders who dont implement the base interfaces 2018-09-21 14:14:25 +02:00
composer.json updated version to 4.2 2018-05-07 16:51:25 +02:00
LICENSE fixed years in copyright 2018-01-03 08:23:28 +01:00
phpunit.xml.dist fail when detecting risky tests 2017-04-12 09:39:27 +02:00
README.md Updated all the README files 2016-03-04 08:12:06 +01:00
Serializer.php [Serializer] deprecated normalizers and encoders who dont implement the base interfaces 2018-09-21 14:14:25 +02:00
SerializerAwareInterface.php [DI] minor docblock fixes 2017-10-24 13:40:19 +02:00
SerializerAwareTrait.php Add normalizer / denormalizer awarness 2016-02-19 11:48:56 +01:00
SerializerInterface.php Remove useless docblocks 2017-10-29 10:49:53 +01:00

Serializer Component

With the Serializer component it's possible to handle serializing data structures, including object graphs, into array structures or other formats like XML and JSON. It can also handle deserializing XML and JSON back to object graphs.

Resources