diff --git a/DependencyInjection/Compiler/TemplatePathPass.php b/DependencyInjection/Compiler/TemplatePathPass.php index 6332573..166941e 100644 --- a/DependencyInjection/Compiler/TemplatePathPass.php +++ b/DependencyInjection/Compiler/TemplatePathPass.php @@ -20,7 +20,11 @@ final class TemplatePathPass implements CompilerPassInterface { public function process(ContainerBuilder $container) { - $loaderDefinition = $container->getDefinition('twig.loader.filesystem'); + if (true === $container->hasDefinition('twig.loader.native_filesystem')) { + $loaderDefinition = $container->getDefinition('twig.loader.native_filesystem'); + } else { + $loaderDefinition = $container->getDefinition('twig.loader.filesystem'); + } $reflection = new ReflectionClass(DataSourceBundle::class); $loaderDefinition->addMethodCall(