1111
1212namespace FOS \RestBundle \DependencyInjection \Compiler ;
1313
14- use Symfony \Component \DependencyInjection \ChildDefinition ;
1514use Symfony \Component \DependencyInjection \Compiler \CompilerPassInterface ;
1615use Symfony \Component \DependencyInjection \ContainerBuilder ;
16+ use Symfony \Component \DependencyInjection \Definition ;
1717use Symfony \Component \DependencyInjection \Reference ;
1818use Symfony \Component \HttpFoundation \ChainRequestMatcher ;
1919use Symfony \Component \HttpFoundation \RequestMatcher ;
@@ -91,8 +91,7 @@ private function createRequestMatcher(ContainerBuilder $container, ?string $path
9191 // only add arguments that are necessary
9292 if (!class_exists (ChainRequestMatcher::class)) {
9393 $ container
94- ->setDefinition ($ id , new ChildDefinition (RequestMatcher::class))
95- ->setArguments ($ arguments );
94+ ->setDefinition ($ id , new Definition (RequestMatcher::class, $ arguments ));
9695 } else {
9796 $ matchers = [];
9897 if (!empty ($ path )) {
@@ -108,8 +107,8 @@ private function createRequestMatcher(ContainerBuilder $container, ?string $path
108107 $ matchers [] = new AttributesRequestMatcher ($ attributes );
109108 }
110109 $ container
111- ->setDefinition ($ id , new ChildDefinition (ChainRequestMatcher::class))
112- ->setArguments ($ matchers );
110+ ->setDefinition ($ id , new Definition (ChainRequestMatcher::class))
111+ ->setArguments ([ $ matchers] );
113112 }
114113 }
115114
0 commit comments