src/Twig/GitLastCommit.php line 28
<?phpdeclare(strict_types=1);namespace App\Twig;use App\Handler\Git;use Symfony\Component\EventDispatcher\EventSubscriberInterface;use Symfony\Component\HttpKernel\KernelEvents;use Twig\Environment;final class GitLastCommit implements EventSubscriberInterface{public function __construct(private readonly Environment $twig,private readonly Git $git){}public static function getSubscribedEvents(): array{return [KernelEvents::CONTROLLER => 'lastCommit'];}public function lastCommit(): void{$this->twig->addGlobal('lastCommitDate', $this->git->getLastCommitDate());}}