Skip to content

Commit b75a42a

Browse files
committed
Merge pull request #261 from Tobion/patch-1
Fix dependency on a non-existent service "security.context"
2 parents dad3372 + 15cc7bb commit b75a42a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

DependencyInjection/Compiler/SecurityContextPass.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
class SecurityContextPass implements CompilerPassInterface
2323
{
2424
const ROLE_PROVIDER_SERVICE = 'fos_http_cache.user_context.role_provider';
25-
25+
2626
/**
2727
* {@inheritdoc}
2828
*/
@@ -31,8 +31,8 @@ public function process(ContainerBuilder $container)
3131
if (!$container->has(self::ROLE_PROVIDER_SERVICE)) {
3232
return;
3333
}
34-
35-
if (!$container->has('security.token_storage')) {
34+
35+
if (!$container->has('security.token_storage') && $container->has('security.context')) {
3636
$definition = $container->getDefinition(self::ROLE_PROVIDER_SERVICE);
3737
$definition->replaceArgument(0, new Reference('security.context'));
3838
}

0 commit comments

Comments
 (0)