From db3aeb7379d41304d76f756ba5d10764466e74c3 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 25 Sep 2026 23:53:00 +0200 Subject: [PATCH 1/3] Use the current variable node class in the node tree example --- doc/internals.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/internals.rst b/doc/internals.rst index 07ff85534..7e70ce250 100644 --- a/doc/internals.rst +++ b/doc/internals.rst @@ -95,7 +95,7 @@ Here is the output for the ``Hello {{ name }}`` template: \Twig\Node\ModuleNode( \Twig\Node\TextNode(Hello ) \Twig\Node\PrintNode( - \Twig\Node\Expression\NameExpression(name) + \Twig\Node\Expression\Variable\ContextVariable(name) ) ) From e883536e64fdfc27f8b70018769f0cff6cb046d5 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 25 Sep 2026 23:53:00 +0200 Subject: [PATCH 2/3] Replace the deprecated twig_test_even function in the custom test example --- doc/advanced.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/advanced.rst b/doc/advanced.rst index bda2fbc8d..2024ade62 100644 --- a/doc/advanced.rst +++ b/doc/advanced.rst @@ -846,7 +846,7 @@ The ``getTests()`` method lets you add new test functions:: public function getTests() { return [ - new \Twig\TwigTest('even', 'twig_test_even'), + new \Twig\TwigTest('even', fn (int $value): bool => 0 === $value % 2), ]; } From 1478f9efcd48e0aae9895e72fdf8072c61d92fc0 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 25 Sep 2026 23:53:01 +0200 Subject: [PATCH 3/3] Fix the class name and a missing parenthesis in the runtime loader example --- doc/advanced.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/advanced.rst b/doc/advanced.rst index 2024ade62..49a2198ab 100644 --- a/doc/advanced.rst +++ b/doc/advanced.rst @@ -917,8 +917,8 @@ a runtime extension using one of the runtime loaders:: } $twig = new \Twig\Environment($loader); - $twig->addExtension(new \Twig\Extension\AttributeExtension(ProjectExtension::class); - $twig->addRuntimeLoader(new \Twig\RuntimeLoader\FactoryLoader([ + $twig->addExtension(new \Twig\Extension\AttributeExtension(ProjectExtension::class)); + $twig->addRuntimeLoader(new \Twig\RuntimeLoader\FactoryRuntimeLoader([ ProjectExtension::class => function () use ($lipsumProvider) { return new ProjectExtension($lipsumProvider); },