diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 76225e6..5396309 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -28,4 +28,5 @@ parameters: dynamicConstantNames: - Symfony\Component\HttpKernel\Kernel::VERSION - - Twig\Environment::VERSION_ID + - Twig\Environment::MAJOR_VERSION + - Twig\Environment::MINOR_VERSION diff --git a/src/Twig/Version.php b/src/Twig/Version.php index d1307c5..e56d995 100644 --- a/src/Twig/Version.php +++ b/src/Twig/Version.php @@ -13,6 +13,8 @@ namespace Nelmio\SecurityBundle\Twig; +use Twig\Environment; + /** * @internal */ @@ -20,6 +22,10 @@ final class Version { public static function needsNodeTag(): bool { - return \Twig\Environment::VERSION_ID < 301200; + if (Environment::MAJOR_VERSION < 3) { + return true; + } + + return Environment::MAJOR_VERSION === 3 && Environment::MINOR_VERSION < 12; } }