From dbfd06ffbad7df1b0a54eb544c09efe7487efdfd Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 25 Sep 2026 23:51:14 +0200 Subject: [PATCH] Make Markup final --- CHANGELOG | 1 + src/Markup.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 2052d3e41..dd746a90b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,6 +6,7 @@ * Remove the now inert `#[YieldReady]` attribute from the built-in nodes; the attribute itself is kept so 3.x extensions still load * Add an optional `string $template = ''` argument to `IncludeNode::addGetTemplate()`; subclasses overriding this method must declare a compatible parameter * Remove the obsolete `Twig\Test\NodeTestCase::getTests()` method; override `provideTests()` instead + * Make `Twig\Markup` final * Add native return types to the protected extension points in `Twig\Test\IntegrationTestCase` and `Twig\Test\NodeTestCase` and require overriding methods to declare compatible return types * Remove `TemplateVariable` and `AssignTemplateVariable`; use `MacroVariable` and `AssignMacroVariable` instead * Add the `isAlwaysAllowedInSandbox()` method to `Twig\TwigCallableInterface` and `Twig\TokenParser\TokenParserInterface` diff --git a/src/Markup.php b/src/Markup.php index e9f737dcd..1042aff1e 100644 --- a/src/Markup.php +++ b/src/Markup.php @@ -22,7 +22,7 @@ namespace Twig; * * @author Fabien Potencier */ -class Markup implements \Countable, \JsonSerializable, \Stringable +final class Markup implements \Countable, \JsonSerializable, \Stringable { private string $content; private ?string $charset;