Skip to content

Commit

Permalink
Fix compiler pass broken due to FOSRestBundle upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
ghoussard committed Jan 9, 2023
1 parent 5ac7837 commit e7fcf44
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
use Symfony\Component\DependencyInjection\ChildDefinition;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpFoundation\RequestMatcher;

/**
* Compiler pass to add rules to the content type negotiator.
Expand Down Expand Up @@ -64,9 +66,7 @@ private function createRequestMatcher(ContainerBuilder $container, $path = null,
$id = 'pim_api.content_type_negotiator.request_matcher.'.md5($serialized).sha1($serialized);

if (!$container->hasDefinition($id)) {
$container
->setDefinition($id, new ChildDefinition('fos_rest.format_request_matcher'))
->setArguments($arguments);
$container->setDefinition($id, new Definition(RequestMatcher::class, $arguments));
}

return new Reference($id);
Expand Down

0 comments on commit e7fcf44

Please sign in to comment.