8000 fixed some deprecated notices · symfony/symfony@84f3753 · GitHub
[go: up one dir, main page]

Skip to content

Commit 84f3753

Browse files
committed
fixed some deprecated notices
1 parent d752f74 commit 84f3753

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
1515
use Symfony\Component\DependencyInjection\ContainerBuilder;
16+
use Symfony\Component\DependencyInjection\ContainerInterface;
1617
use Symfony\Component\DependencyInjection\Reference;
1718

1819
/**
@@ -63,6 +64,10 @@ public function process(ContainerBuilder $container)
6364
$container->getDefinition('twig.extension.code')->replaceArgument(0, $container->getParameter('templating.helper.code.file_link_format'));
6465
}
6566

67+
if (!$container->has('security.token_storage')) {
68+
$container->getDefinition('twig.app_variable')->addMethodCall('setSecurity', array(new Reference('security.context', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)));
69+
}
70+
6671
if ($container->has('templating')) {
6772
$container->getDefinition('twig.cache_warmer')->addTag('kernel.cache_warmer');
6873

src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
<service id="twig.app_variable" class="Symfony\Bridge\Twig\AppVariable" public="false">
4242
<call method="setEnvironment"><argument>%kernel.environment%</argument></call>
4343
<call method="setDebug"><argument>%kernel.debug%</argument></call>
44-
<call method="setSecurity"><argument type="service" id="security.context" on-invalid="ignore" /></call>
4544
<call method="setTokenStorage"><argument type="service" id="security.token_storage" on-invalid="ignore" /></call>
4645
<call method="setRequestStack"><argument type="service" id="request_stack" on-invalid="ignore" /></call>
4746
</service>

0 commit comments

Comments
 (0)
0