mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-16 20:36:33 +00:00
Fix compat with older Symfony versions
This commit is contained in:
@@ -16,13 +16,14 @@ use Twig\Extra\Markdown\MarkdownExtension;
|
|||||||
use Twig\Extra\Markdown\MarkdownRuntime;
|
use Twig\Extra\Markdown\MarkdownRuntime;
|
||||||
|
|
||||||
return static function (ContainerConfigurator $container) {
|
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()
|
$container->services()
|
||||||
->set('twig.extension.markdown', MarkdownExtension::class)
|
->set('twig.extension.markdown', MarkdownExtension::class)
|
||||||
->tag('twig.extension')
|
->tag('twig.extension')
|
||||||
|
|
||||||
->set('twig.runtime.markdown', MarkdownRuntime::class)
|
->set('twig.runtime.markdown', MarkdownRuntime::class)
|
||||||
->args([
|
->args([
|
||||||
service('twig.markdown.default'),
|
$service('twig.markdown.default'),
|
||||||
])
|
])
|
||||||
->tag('twig.runtime')
|
->tag('twig.runtime')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user