diff --git a/DependencyInjection/JMSSerializerExtension.php b/DependencyInjection/JMSSerializerExtension.php index 3c6f8263..8698ef88 100644 --- a/DependencyInjection/JMSSerializerExtension.php +++ b/DependencyInjection/JMSSerializerExtension.php @@ -150,9 +150,7 @@ public function loadInternal(array $config, ContainerBuilder $container) $container->setParameter('jms_serializer.xml_serialization_visitor.format_output', $config['visitors']['xml']['format_output']); $container->setParameter('jms_serializer.json_serialization_visitor.options', $config['visitors']['json']['options']); - - - if ( ! $container->getParameter('kernel.debug')) { + if (!$container->getParameter('kernel.debug')) { $container->removeDefinition('jms_serializer.stopwatch_subscriber'); } diff --git a/JMSSerializerBundle.php b/JMSSerializerBundle.php index 784e4f79..6fdab6db 100644 --- a/JMSSerializerBundle.php +++ b/JMSSerializerBundle.php @@ -18,28 +18,28 @@ namespace JMS\SerializerBundle; -use JMS\SerializerBundle\DependencyInjection\Compiler\DoctrinePass; -use JMS\SerializerBundle\DependencyInjection\Compiler\TwigExtensionPass; -use Symfony\Component\DependencyInjection\Compiler\PassConfig; +use JMS\DiExtraBundle\DependencyInjection\Compiler\LazyServiceMapPass; use JMS\SerializerBundle\DependencyInjection\Compiler\CustomHandlersPass; +use JMS\SerializerBundle\DependencyInjection\Compiler\DoctrinePass; use JMS\SerializerBundle\DependencyInjection\Compiler\RegisterEventListenersAndSubscribersPass; use JMS\SerializerBundle\DependencyInjection\Compiler\ServiceMapPass; +use JMS\SerializerBundle\DependencyInjection\Compiler\TwigExtensionPass; +use Symfony\Component\DependencyInjection\Compiler\PassConfig; use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\HttpKernel\Bundle\Bundle; -use JMS\DiExtraBundle\DependencyInjection\Compiler\LazyServiceMapPass; use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\HttpKernel\Bundle\Bundle; class JMSSerializerBundle extends Bundle { public function build(ContainerBuilder $builder) { $builder->addCompilerPass($this->getServiceMapPass('jms_serializer.serialization_visitor', 'format', - function(ContainerBuilder $container, Definition $def) { + function (ContainerBuilder $container, Definition $def) { $container->getDefinition('jms_serializer.serializer')->replaceArgument(3, $def); } )); $builder->addCompilerPass($this->getServiceMapPass('jms_serializer.deserialization_visitor', 'format', - function(ContainerBuilder $container, Definition $def) { + function (ContainerBuilder $container, Definition $def) { $container->getDefinition('jms_serializer.serializer')->replaceArgument(4, $def); } )); diff --git a/Tests/DependencyInjection/ConfigurationTest.php b/Tests/DependencyInjection/ConfigurationTest.php index 3fa93c81..7cd1067b 100644 --- a/Tests/DependencyInjection/ConfigurationTest.php +++ b/Tests/DependencyInjection/ConfigurationTest.php @@ -114,7 +114,7 @@ public function testConfigComposed() $directories = $container->getDefinition('jms_serializer.metadata.file_locator')->getArgument(0); $this->assertArrayNotHasKey('JMSSerializerBundleNs1', $directories); - $this->assertEquals($ref->getPath().'/Resources/config', $directories['JMSSerializerBundleNs2']); + $this->assertEquals($ref->getPath() . '/Resources/config', $directories['JMSSerializerBundleNs2']); } public function testContextDefaults()