From f4e1429227bc2e15f26692d13dc675029b3b68e6 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 5 Jan 2021 16:19:23 +0100 Subject: [PATCH] Fix compat with older Symfony versions --- extra/twig-extra-bundle/Resources/config/markdown.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extra/twig-extra-bundle/Resources/config/markdown.php b/extra/twig-extra-bundle/Resources/config/markdown.php index d8ab94a4224..dd5774d0335 100644 --- a/extra/twig-extra-bundle/Resources/config/markdown.php +++ b/extra/twig-extra-bundle/Resources/config/markdown.php @@ -16,13 +16,14 @@ use Twig\Extra\Markdown\MarkdownRuntime; return static function (ContainerConfigurator $container) { + $service = function_exists('Symfony\Component\DependencyInjection\Loader\Configurator\service') ? 'Symfony\Component\DependencyInjection\Loader\Configurator\service' : 'Symfony\Component\DependencyInjection\Loader\Configurator\ref'; $container->services() ->set('twig.extension.markdown', MarkdownExtension::class) ->tag('twig.extension') ->set('twig.runtime.markdown', MarkdownRuntime::class) ->args([ - service('twig.markdown.default'), + $service('twig.markdown.default'), ]) ->tag('twig.runtime')