Skip to content

Commit

Permalink
bug #33648 [TwigBundle] fix accessing service arguments (xabbuh)
Browse files Browse the repository at this point in the history
This PR was merged into the 5.0-dev branch.

Discussion
----------

[TwigBundle] fix accessing service arguments

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Commits
-------

6233cce fix accessing service arguments
  • Loading branch information
nicolas-grekas committed Sep 20, 2019
2 parents b6fc90c + 6233cce commit aec06c3
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -41,7 +41,7 @@ public function process(ContainerBuilder $container)

$viewDir = \dirname((new \ReflectionClass('Symfony\Bridge\Twig\Extension\FormExtension'))->getFileName(), 2).'/Resources/views';
$templateIterator = $container->getDefinition('twig.template_iterator');
$templatePaths = $templateIterator->getArgument(2);
$templatePaths = $templateIterator->getArgument(1);
$cacheWarmer = null;
if ($container->hasDefinition('twig.cache_warmer')) {
$cacheWarmer = $container->getDefinition('twig.cache_warmer');
Expand Down Expand Up @@ -70,7 +70,7 @@ public function process(ContainerBuilder $container)
}
}

$templateIterator->replaceArgument(2, $templatePaths);
$templateIterator->replaceArgument(1, $templatePaths);
if ($cacheWarmer) {
$container->getDefinition('twig.cache_warmer')->replaceArgument(2, $cacheWarmerPaths);
}
Expand Down

0 comments on commit aec06c3

Please sign in to comment.