Skip to content

Commit ef01605

Browse files
iluuu1994ElectricMaxxx
authored andcommitted
Fix access of private router service since Symfony 3.4 (#404)
Services are private by default since Symfony 3.4. Since the router service is still directly accesses in various places it needs to be explicitly marked as `public` to prevent deprecations in Symfony 3.4 and errors in Symfony 4.0.
1 parent cec68d5 commit ef01605

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/DependencyInjection/Compiler/SetRouterPass.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public function process(ContainerBuilder $container)
2424
// only replace the default router by overwriting the 'router' alias if config tells us to
2525
if ($container->hasParameter('cmf_routing.replace_symfony_router') && true === $container->getParameter('cmf_routing.replace_symfony_router')) {
2626
$container->setAlias('router', 'cmf_routing.router');
27+
$container->getAlias('router')->setPublic(true);
2728
}
2829
}
2930
}

0 commit comments

Comments
 (0)