src/Twig/GitLastCommit.php line 49
<?phpnamespace App\Twig;use App\Handler\Git;use Doctrine\ORM\EntityManagerInterface;use Symfony\Component\EventDispatcher\EventSubscriberInterface;use Symfony\Component\HttpKernel\KernelEvents;use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;use Twig\Environment;/*** Class GitLastCommit* @package App\Twig*/class GitLastCommit implements EventSubscriberInterface{/*** @var Environment*/private Environment $twig;/*** @var Git*/private Git $git;/*** LastNotifications constructor.* @param Environment $twig* @param Git $git*/public function __construct(Environment $twig, Git $git){$this->twig = $twig;$this->git = $git;}/*** @return array|string[]*/public static function getSubscribedEvents(){return [KernelEvents::CONTROLLER => 'lastCommit'];}public function lastCommit(){$this->twig->addGlobal('lastCommitDate', $this->git->getLastCommitDate());}}