Skip to content

Commit

Permalink
[FrameworkBundle][Serializer] Remove YamlEncoder definition if Yaml c…
Browse files Browse the repository at this point in the history
…omponent isn't installed
  • Loading branch information
ogizanagi committed Nov 27, 2017
1 parent 8555c0b commit a44f8a5
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -56,6 +56,7 @@
use Symfony\Component\Validator\ObjectInitializerInterface;
use Symfony\Component\WebLink\HttpHeaderSerializer;
use Symfony\Component\Workflow;
use Symfony\Component\Yaml\Yaml;

/**
* FrameworkExtension.
Expand Down Expand Up @@ -1172,6 +1173,10 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
$container->removeDefinition('serializer.normalizer.object');
}

if (!class_exists(Yaml::class)) {
$container->removeDefinition('serializer.encoder.yaml');
}

$serializerLoaders = array();
if (isset($config['enable_annotations']) && $config['enable_annotations']) {
if (!$this->annotationsConfigEnabled) {
Expand Down

0 comments on commit a44f8a5

Please sign in to comment.