diff --git a/.travis.yml b/.travis.yml index aa13365..bbd264d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,6 +26,8 @@ matrix: env: SYMFONY_VERSION=3.4.* - php: 7.2 env: SYMFONY_VERSION=4.0.*;ASSETIC=skip + - php: 7.2 + env: SYMFONY_VERSION=4.1.*;ASSETIC=skip - php: 7.2 env: SYMFONY_VERSION=@dev;ASSETIC=skip - php: 7.0 diff --git a/DependencyInjection/Compiler/ThemeCompilerPass.php b/DependencyInjection/Compiler/ThemeCompilerPass.php index f99dce0..c054140 100644 --- a/DependencyInjection/Compiler/ThemeCompilerPass.php +++ b/DependencyInjection/Compiler/ThemeCompilerPass.php @@ -30,10 +30,14 @@ public function process(ContainerBuilder $container) $twigFilesystemLoaderDefinition = $container->findDefinition('twig.loader.filesystem'); $twigFilesystemLoaderDefinition->setClass($container->getParameter('liip_theme.filesystem_loader.class')); - $twigFilesystemLoaderDefinition->setArguments(array( - $container->getDefinition('liip_theme.templating_locator'), - $container->getDefinition('templating.filename_parser') - )); + + if (false === $container->has('templating')) { + $twigFilesystemLoaderDefinition->replaceArgument(0, + $container->getDefinition('liip_theme.templating_locator')); + $twigFilesystemLoaderDefinition->replaceArgument(1, + $container->getDefinition('templating.filename_parser')); + } + $twigFilesystemLoaderDefinition->addMethodCall('setActiveTheme', array(new Reference('liip_theme.active_theme'))); } }