bug #22781 [DI][Serializer] Fix missing de(normalizer|coder) autoconfig (ogizanagi)

This PR was merged into the 3.3 branch.

Discussion
----------

[DI][Serializer] Fix missing de(normalizer|coder) autoconfig

| Q             | A
| ------------- | ---
| Branch?       | 3.3
| Bug fix?      | yes(ish)
| New feature?  | no (at least complete the 3.3 feature)
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | N/A

Just migrating an app to `3.3.0-RC1`, I get surprised it wasn't already registered :)

Commits
-------

3c3a276 [DI][Serializer] Fix missing de(normalizer|coder) autoconfig
This commit is contained in:
Nicolas Grekas 2017-05-21 10:45:16 +02:00
commit c268ebafc3

View File

@ -47,11 +47,13 @@ use Symfony\Component\PropertyInfo\PropertyDescriptionExtractorInterface;
use Symfony\Component\PropertyInfo\PropertyListExtractorInterface;
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
use Symfony\Component\Serializer\Encoder\CsvEncoder;
use Symfony\Component\Serializer\Encoder\DecoderInterface;
use Symfony\Component\Serializer\Encoder\EncoderInterface;
use Symfony\Component\Serializer\Encoder\YamlEncoder;
use Symfony\Component\Serializer\Mapping\Factory\CacheClassMetadataFactory;
use Symfony\Component\Serializer\Normalizer\DataUriNormalizer;
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\JsonSerializableNormalizer;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Symfony\Component\Validator\ConstraintValidatorInterface;
@ -276,8 +278,12 @@ class FrameworkExtension extends Extension
->addTag('property_info.access_extractor');
$container->registerForAutoconfiguration(EncoderInterface::class)
->addTag('serializer.encoder');
$container->registerForAutoconfiguration(DecoderInterface::class)
->addTag('serializer.encoder');
$container->registerForAutoconfiguration(NormalizerInterface::class)
->addTag('serializer.normalizer');
$container->registerForAutoconfiguration(DenormalizerInterface::class)
->addTag('serializer.normalizer');
$container->registerForAutoconfiguration(ConstraintValidatorInterface::class)
->addTag('validator.constraint_validator');
$container->registerForAutoconfiguration(ObjectInitializerInterface::class)