From fc4dee393ce7a15199871edea716d845038797ea Mon Sep 17 00:00:00 2001 From: Matthieu Lempereur Date: Wed, 8 Jul 2026 19:01:20 +0200 Subject: [PATCH] fix version in deprecation message for tag usage outside of root template --- doc/deprecated.rst | 2 +- src/NodeVisitor/CorrectnessNodeVisitor.php | 2 +- .../Fixtures/tags/inheritance/extends_in_condition.legacy.test | 2 +- tests/Fixtures/tags/inheritance/use_in_condition.legacy.test | 2 +- tests/Fixtures/tags/inheritance/use_in_macro.legacy.test | 2 +- tests/Fixtures/tags/macro/macro_in_block.legacy.test | 2 +- tests/Fixtures/tags/macro/macro_in_condition.legacy.test | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/deprecated.rst b/doc/deprecated.rst index d8e548b57..909b01721 100644 --- a/doc/deprecated.rst +++ b/doc/deprecated.rst @@ -303,7 +303,7 @@ Templates * Using a ``macro``, ``extends``, or ``use`` tag outside the root of a template (for instance nested under an ``if`` or inside a ``block`` or ``macro``) is - deprecated as of Twig 3.27 and will throw in Twig 4.0. These tags have a + deprecated as of Twig 3.28 and will throw in Twig 4.0. These tags have a global effect on the template and must be declared at the root of its body. Filters diff --git a/src/NodeVisitor/CorrectnessNodeVisitor.php b/src/NodeVisitor/CorrectnessNodeVisitor.php index 6fd4e1773..3e7719bd9 100644 --- a/src/NodeVisitor/CorrectnessNodeVisitor.php +++ b/src/NodeVisitor/CorrectnessNodeVisitor.php @@ -159,7 +159,7 @@ final class CorrectnessNodeVisitor implements NodeVisitorInterface } if (!isset($this->rootNodes[$node])) { - trigger_deprecation('twig/twig', '3.27', 'Using the "%s" tag outside the root of a template is deprecated in %s at line %d.', $node->getNodeTag(), $node->getSourceContext()->getName(), $node->getTemplateLine()); + trigger_deprecation('twig/twig', '3.28', 'Using the "%s" tag outside the root of a template is deprecated in %s at line %d.', $node->getNodeTag(), $node->getSourceContext()->getName(), $node->getTemplateLine()); } } diff --git a/tests/Fixtures/tags/inheritance/extends_in_condition.legacy.test b/tests/Fixtures/tags/inheritance/extends_in_condition.legacy.test index f3212e944..8ca4de9ca 100644 --- a/tests/Fixtures/tags/inheritance/extends_in_condition.legacy.test +++ b/tests/Fixtures/tags/inheritance/extends_in_condition.legacy.test @@ -1,7 +1,7 @@ --TEST-- "extends" tag in a condition --DEPRECATION-- -Since twig/twig 3.27: Using the "extends" tag outside the root of a template is deprecated in index.twig at line 3. +Since twig/twig 3.28: Using the "extends" tag outside the root of a template is deprecated in index.twig at line 3. --TEMPLATE-- {% if false %} {% extends "base.twig" %} diff --git a/tests/Fixtures/tags/inheritance/use_in_condition.legacy.test b/tests/Fixtures/tags/inheritance/use_in_condition.legacy.test index 2551f3f9c..528316a6f 100644 --- a/tests/Fixtures/tags/inheritance/use_in_condition.legacy.test +++ b/tests/Fixtures/tags/inheritance/use_in_condition.legacy.test @@ -1,7 +1,7 @@ --TEST-- "use" tag in a condition --DEPRECATION-- -Since twig/twig 3.27: Using the "use" tag outside the root of a template is deprecated in index.twig at line 3. +Since twig/twig 3.28: Using the "use" tag outside the root of a template is deprecated in index.twig at line 3. --TEMPLATE-- {% if false %} {% use "base.twig" %} diff --git a/tests/Fixtures/tags/inheritance/use_in_macro.legacy.test b/tests/Fixtures/tags/inheritance/use_in_macro.legacy.test index a1deeb467..43106fad3 100644 --- a/tests/Fixtures/tags/inheritance/use_in_macro.legacy.test +++ b/tests/Fixtures/tags/inheritance/use_in_macro.legacy.test @@ -1,7 +1,7 @@ --TEST-- "use" tag in a macro --DEPRECATION-- -Since twig/twig 3.27: Using the "use" tag outside the root of a template is deprecated in index.twig at line 3. +Since twig/twig 3.28: Using the "use" tag outside the root of a template is deprecated in index.twig at line 3. --TEMPLATE-- {% macro input(name, value, type, size) %} {% use "base.twig" %} diff --git a/tests/Fixtures/tags/macro/macro_in_block.legacy.test b/tests/Fixtures/tags/macro/macro_in_block.legacy.test index 569e1662b..b0facba84 100644 --- a/tests/Fixtures/tags/macro/macro_in_block.legacy.test +++ b/tests/Fixtures/tags/macro/macro_in_block.legacy.test @@ -1,7 +1,7 @@ --TEST-- "macro" tag in a block --DEPRECATION-- -Since twig/twig 3.27: Using the "macro" tag outside the root of a template is deprecated in index.twig at line 3. +Since twig/twig 3.28: Using the "macro" tag outside the root of a template is deprecated in index.twig at line 3. --TEMPLATE-- {% block foo %} {% macro input(name, value, type, size) %} diff --git a/tests/Fixtures/tags/macro/macro_in_condition.legacy.test b/tests/Fixtures/tags/macro/macro_in_condition.legacy.test index 65f5ac0f6..62a7098a0 100644 --- a/tests/Fixtures/tags/macro/macro_in_condition.legacy.test +++ b/tests/Fixtures/tags/macro/macro_in_condition.legacy.test @@ -1,7 +1,7 @@ --TEST-- "macro" tag in a condition --DEPRECATION-- -Since twig/twig 3.27: Using the "macro" tag outside the root of a template is deprecated in index.twig at line 3. +Since twig/twig 3.28: Using the "macro" tag outside the root of a template is deprecated in index.twig at line 3. --TEMPLATE-- {% if false %} {% macro input(name, value, type, size) %}