Skip to content

Commit c9c851a

Browse files
committed
do not decorate the jms handler registry for jms v4
1 parent f3cdbef commit c9c851a

File tree

4 files changed

+4
-51
lines changed

4 files changed

+4
-51
lines changed

DependencyInjection/Compiler/HandlerRegistryDecorationPass.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class HandlerRegistryDecorationPass implements CompilerPassInterface
3333
{
3434
public function process(ContainerBuilder $container): void
3535
{
36+
// skip if JMSSerializerBundle is not installed or if JMSSerializerBundle >= 4.0
3637
if (!$container->has('fos_rest.serializer.jms_handler_registry') || $container->has('jms_serializer.handler_registry.service_locator')) {
3738
return;
3839
}

DependencyInjection/Compiler/JMSHandlerRegistryV4DecorationPass.php

Lines changed: 0 additions & 49 deletions
This file was deleted.

FOSRestBundle.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use FOS\RestBundle\DependencyInjection\Compiler\ConfigurationCheckPass;
1515
use FOS\RestBundle\DependencyInjection\Compiler\HandlerRegistryDecorationPass;
1616
use FOS\RestBundle\DependencyInjection\Compiler\JMSFormErrorHandlerPass;
17-
use FOS\RestBundle\DependencyInjection\Compiler\JMSHandlerRegistryV4DecorationPass;
1817
use FOS\RestBundle\DependencyInjection\Compiler\JMSHandlersPass;
1918
use FOS\RestBundle\DependencyInjection\Compiler\FormatListenerRulesPass;
2019
use FOS\RestBundle\DependencyInjection\Compiler\SerializerConfigurationPass;
@@ -40,7 +39,6 @@ public function build(ContainerBuilder $container)
4039
$container->addCompilerPass(new FormatListenerRulesPass());
4140
$container->addCompilerPass(new JMSFormErrorHandlerPass());
4241
$container->addCompilerPass(new JMSHandlersPass(), PassConfig::TYPE_BEFORE_REMOVING, -10);
43-
$container->addCompilerPass(new JMSHandlerRegistryV4DecorationPass());
4442
$container->addCompilerPass(new HandlerRegistryDecorationPass(), PassConfig::TYPE_AFTER_REMOVING);
4543
}
4644
}

Tests/Functional/DependencyInjectionTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ public function testSerializerRelatedServicesAreNotRemovedWhenJmsSerializerBundl
3030
{
3131
self::bootKernel();
3232
$container = self::$kernel->getContainer();
33+
if ($container->get('test.jms_serializer.handler_registry.service_locator')) {
34+
$this->markTestSkipped('Starting from jms/serializer-bundle 4.0 the handler registry is not decorated anymore');
35+
}
3336

3437
$this->assertInstanceOf(FormErrorHandler::class, $container->get('test.jms_serializer.form_error_handler'));
3538

0 commit comments

Comments
 (0)