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

Appearance settings

Commit b809340

Browse filesBrowse files
committed
[Serializer] Register the YAML encoder in FrameworkBundle
1 parent 424002b commit b809340
Copy full SHA for b809340

File tree

1 file changed

+7
-0
lines changed
Filter options

1 file changed

+7
-0
lines changed

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
2727
use Symfony\Component\Config\FileLocator;
2828
use Symfony\Component\PropertyAccess\PropertyAccessor;
29+
use Symfony\Component\Serializer\Encoder\YamlEncoder;
2930
use Symfony\Component\Serializer\Mapping\Factory\CacheClassMetadataFactory;
3031
use Symfony\Component\Serializer\Normalizer\DataUriNormalizer;
3132
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
@@ -977,6 +978,12 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
977978
$definition->addTag('serializer.normalizer', array('priority' => -900));
978979
}
979980

981+
if (class_exists(YamlEncoder::class)) {
982+
$definition = $container->register('serializer.encoder.yaml', YamlEncoder::class);
983+
$definition->setPublic(false);
984+
$definition->addTag('serializer.encoder');
985+
}
986+
980987
$loader->load('serializer.xml');
981988
$chainLoader = $container->getDefinition('serializer.mapping.chain_loader');
982989

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.