<?php

declare(strict_types=1);

use App\Service\Config\AppName;
use Symfony\Config\TwigConfig;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $containerConfigurator, TwigConfig $twig): void {
    $twig->fileNamePattern('*.twig');
    $twig->formThemes(['bootstrap_5_layout.html.twig']);
    $twig->global('appName', \Symfony\Component\DependencyInjection\Loader\Configurator\service(AppName::class));
    if ($containerConfigurator->env() === 'test') {
        $twig->strictVariables(true);
    }
};
