From 8b99bc7fed9c30fb3de87de4d340e6b3f9429ee6 Mon Sep 17 00:00:00 2001 From: Vincent CHALAMON Date: Mon, 12 Jun 2017 15:21:35 +0200 Subject: [PATCH] Fix #26 (#27) --- DependencyInjection/CoopTilleulsForgotPasswordExtension.php | 3 ++- features/app/AppKernel.php | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DependencyInjection/CoopTilleulsForgotPasswordExtension.php b/DependencyInjection/CoopTilleulsForgotPasswordExtension.php index a632e0a..80f4691 100644 --- a/DependencyInjection/CoopTilleulsForgotPasswordExtension.php +++ b/DependencyInjection/CoopTilleulsForgotPasswordExtension.php @@ -54,6 +54,7 @@ public function load(array $configs, ContainerBuilder $container) // Build normalizer $class = true === $config['use_jms_serializer'] ? JMSNormalizer::class : SymfonyNormalizer::class; - $container->setDefinition('coop_tilleuls_forgot_password.normalizer', new Definition($class, [new Reference('serializer')]))->setPublic(false); + $serializerId = true === $config['use_jms_serializer'] ? 'jms_serializer.serializer' : 'serializer'; + $container->setDefinition('coop_tilleuls_forgot_password.normalizer', new Definition($class, [new Reference($serializerId)]))->setPublic(false); } } diff --git a/features/app/AppKernel.php b/features/app/AppKernel.php index 40e7612..835fbff 100644 --- a/features/app/AppKernel.php +++ b/features/app/AppKernel.php @@ -76,16 +76,15 @@ protected function configureContainer(ContainerBuilder $c, LoaderInterface $load ], ]); - $c->loadFromExtension('framework', [ + $c->loadFromExtension('framework', array_merge([ 'secret' => 'CoopTilleulsForgotPasswordBundle', 'test' => null, 'assets' => null, - 'serializer' => null, 'profiler' => ['collect' => false], 'templating' => [ 'engines' => ['twig'], ], - ]); + ], 'jmsserializer' !== $this->getEnvironment() ? ['serializer' => null] : [])); $c->loadFromExtension('security', [ 'encoders' => [UserInterface::class => 'plaintext'],