2024-02-05 15:16:43 +00:00
|
|
|
<?php declare(strict_types=1);
|
|
|
|
|
2024-02-12 21:03:17 +00:00
|
|
|
// config/packages/twig.php
|
|
|
|
use Symfony\Config\TwigConfig;
|
2024-02-05 15:16:43 +00:00
|
|
|
|
2024-02-12 21:03:17 +00:00
|
|
|
use function Symfony\Component\DependencyInjection\Loader\Configurator\service;
|
2024-02-05 15:16:43 +00:00
|
|
|
|
2024-02-12 21:03:17 +00:00
|
|
|
use App\Service\WhoAreYou;
|
|
|
|
|
|
|
|
return static function (TwigConfig $twig): void {
|
|
|
|
$twig
|
|
|
|
->fileNamePattern('*.twig')
|
|
|
|
->global('username', service(WhoAreYou::class));
|
|
|
|
|
|
|
|
if ($_SERVER['APP_ENV'] === 'test') {
|
|
|
|
$twig->strictVariables(true);
|
2024-02-05 15:16:43 +00:00
|
|
|
}
|
|
|
|
};
|