<?php

namespace AutoAdmin\Bundle\Content\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;

class TwigGlobalsCompilerPass implements CompilerPassInterface
{
    /**
     * @inheritDoc
     */
    public function process(ContainerBuilder $container): void
    {
        $def = $container->getDefinition('twig');
        $config = $container->getParameter('aa_content.config');
        $def->addMethodCall('addGlobal', array('aa_content_templates', $config['templates']));
    }
}