diff --git a/src/TwigComponent/CHANGELOG.md b/src/TwigComponent/CHANGELOG.md index c2065acd61a..8bdbacda1d8 100644 --- a/src/TwigComponent/CHANGELOG.md +++ b/src/TwigComponent/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 2.33 + +- Deprecate using `null` to add an attribute. Starting in `3.0`, passing `true` explicitly sets the attribute, while passing `false` or `null` omits it. + ## 2.32 - Add option `profiler.collect_components` to control component data collection diff --git a/src/TwigComponent/src/ComponentAttributes.php b/src/TwigComponent/src/ComponentAttributes.php index bd4029145e2..aa2d97fae74 100644 --- a/src/TwigComponent/src/ComponentAttributes.php +++ b/src/TwigComponent/src/ComponentAttributes.php @@ -61,7 +61,7 @@ public function __toString(): string } if (null === $value) { - trigger_deprecation('symfony/ux-twig-component', '2.8.0', 'Passing "null" as an attribute value is deprecated and will throw an exception in 3.0.'); + trigger_deprecation('symfony/ux-twig-component', '2.33.0', 'Passing null as value to set an attribute is deprecated, pass true instead. In 3.0, the null value will remove the attribute.'); $value = true; }