Skip to content

Commit

Permalink
Fix compat with older Symfony versions
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Jan 5, 2021
1 parent 393c908 commit f4e1429
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion extra/twig-extra-bundle/Resources/config/markdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down

0 comments on commit f4e1429

Please sign in to comment.