diff --git a/CHANGELOG.md b/CHANGELOG.md index c78ea560..6c3eecdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 4.0.0 under development - Chg #221: Throw `LogicException` in `Tag::id()` when id is empty string (@razvbir) +- Chg #267: Make all `CheckboxItem` and `RadioItem` properties required (@vjik) - Chg #234: Remove tag attributes sorting (@FrankiFixx) ## 3.13.0 March 13, 2026 diff --git a/UPGRADE.md b/UPGRADE.md index c9d749e0..3c571379 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -11,6 +11,8 @@ application when you upgrade the package from one version to another. - `Tag::id()` now throws `LogicException` when an empty string is passed. Check your code for places where you call `Tag::id()` and make sure you are not passing an empty string. +- All `CheckboxItem` and `RadioItem` properties are now required. If you create instances of these classes directly, + make sure to pass `$labelAttributes` and `$labelWrap` arguments explicitly. - HTML tag attributes are no longer sorted by `Html::renderTagAttributes()`. Previously, attributes were reordered according to a predefined priority list (`type`, `id`, `class`, `name`, `value`, etc.). Now attributes are rendered in the order they are set. If your code or tests depend on a specific attribute order in the rendered HTML, you need diff --git a/src/Widget/CheckboxList/CheckboxItem.php b/src/Widget/CheckboxList/CheckboxItem.php index 7df2e9e5..bef558be 100644 --- a/src/Widget/CheckboxList/CheckboxItem.php +++ b/src/Widget/CheckboxList/CheckboxItem.php @@ -16,7 +16,7 @@ public function __construct( public array $checkboxAttributes, public string $label, public bool $encodeLabel, - public array $labelAttributes = [], - public bool $labelWrap = true, + public array $labelAttributes, + public bool $labelWrap, ) {} } diff --git a/src/Widget/RadioList/RadioItem.php b/src/Widget/RadioList/RadioItem.php index fcd419d1..2467d874 100644 --- a/src/Widget/RadioList/RadioItem.php +++ b/src/Widget/RadioList/RadioItem.php @@ -16,7 +16,7 @@ public function __construct( public array $radioAttributes, public string $label, public bool $encodeLabel, - public array $labelAttributes = [], - public bool $labelWrap = true, + public array $labelAttributes, + public bool $labelWrap, ) {} }