From 43fbfd0ed34c38a494bd7d387dc8f776e68ca191 Mon Sep 17 00:00:00 2001 From: David Sanchez Date: Fri, 5 Oct 2018 10:46:27 -0400 Subject: [PATCH 1/4] Fixing error, using "traditional" path notation. See #194 --- DependencyInjection/Compiler/ThemeCompilerPass.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/DependencyInjection/Compiler/ThemeCompilerPass.php b/DependencyInjection/Compiler/ThemeCompilerPass.php index f99dce0..e38c3c4 100644 --- a/DependencyInjection/Compiler/ThemeCompilerPass.php +++ b/DependencyInjection/Compiler/ThemeCompilerPass.php @@ -30,10 +30,6 @@ 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') - )); $twigFilesystemLoaderDefinition->addMethodCall('setActiveTheme', array(new Reference('liip_theme.active_theme'))); } } From 2bc07941d82d2a1b579d58c9e7459312a3b75927 Mon Sep 17 00:00:00 2001 From: David Sanchez Date: Fri, 5 Oct 2018 17:38:40 -0400 Subject: [PATCH 2/4] Add new TravisCI test for Symfony 4.1 --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) 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 From fb3abb07f7b163da26961b976813a7f12cce605e Mon Sep 17 00:00:00 2001 From: David Sanchez Date: Sat, 6 Oct 2018 01:36:02 -0400 Subject: [PATCH 3/4] Update arguments pass to class, only if `templating` service dos not exists. --- DependencyInjection/Compiler/ThemeCompilerPass.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/DependencyInjection/Compiler/ThemeCompilerPass.php b/DependencyInjection/Compiler/ThemeCompilerPass.php index e38c3c4..f4a2fc9 100644 --- a/DependencyInjection/Compiler/ThemeCompilerPass.php +++ b/DependencyInjection/Compiler/ThemeCompilerPass.php @@ -30,6 +30,14 @@ public function process(ContainerBuilder $container) $twigFilesystemLoaderDefinition = $container->findDefinition('twig.loader.filesystem'); $twigFilesystemLoaderDefinition->setClass($container->getParameter('liip_theme.filesystem_loader.class')); + + if (false === $container->has('templating')) { + $twigFilesystemLoaderDefinition->setArguments(array( + $container->getDefinition('liip_theme.templating_locator'), + $container->getDefinition('templating.filename_parser') + )); + } + $twigFilesystemLoaderDefinition->addMethodCall('setActiveTheme', array(new Reference('liip_theme.active_theme'))); } } From b361b4705f5a6789b3359b90e09d8aca8c194cfd Mon Sep 17 00:00:00 2001 From: David Sanchez Date: Sat, 6 Oct 2018 12:10:22 -0400 Subject: [PATCH 4/4] Replace method call `setArguments` by `replaceArgument` like suggested by @xabbuh --- DependencyInjection/Compiler/ThemeCompilerPass.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DependencyInjection/Compiler/ThemeCompilerPass.php b/DependencyInjection/Compiler/ThemeCompilerPass.php index f4a2fc9..c054140 100644 --- a/DependencyInjection/Compiler/ThemeCompilerPass.php +++ b/DependencyInjection/Compiler/ThemeCompilerPass.php @@ -32,10 +32,10 @@ public function process(ContainerBuilder $container) $twigFilesystemLoaderDefinition->setClass($container->getParameter('liip_theme.filesystem_loader.class')); if (false === $container->has('templating')) { - $twigFilesystemLoaderDefinition->setArguments(array( - $container->getDefinition('liip_theme.templating_locator'), - $container->getDefinition('templating.filename_parser') - )); + $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')));