From 94ea0ec24c60cc80e808fcd9232e5d868c82333f Mon Sep 17 00:00:00 2001 From: Eirik Stanghelle Morland Date: Wed, 17 Jul 2024 20:59:10 +0200 Subject: [PATCH] Allow twig 3 (#28) --- composer.json | 2 +- src/ViolinistMessages.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index f108fbf..5468359 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "psr-4": {"eiriksm\\ViolinistMessages\\": "src"} }, "require": { - "twig/twig": "^2" + "twig/twig": "^3" }, "scripts": { "phpstan": "phpstan analyse src tests", diff --git a/src/ViolinistMessages.php b/src/ViolinistMessages.php index 4fe2776..33cf480 100644 --- a/src/ViolinistMessages.php +++ b/src/ViolinistMessages.php @@ -6,7 +6,7 @@ class ViolinistMessages { /** - * @var \Twig_Environment + * @var \Twig\Environment */ private $twig; @@ -15,8 +15,8 @@ class ViolinistMessages */ public function __construct() { - $loader = new \Twig_Loader_Filesystem(__DIR__ . '/../templates'); - $this->twig = new \Twig_Environment($loader); + $loader = new \Twig\Loader\FilesystemLoader(__DIR__ . '/../templates'); + $this->twig = new \Twig\Environment($loader, []); } /**