Skip to content

Commit a3d9d65

Browse files
authored
Make all CheckboxItem and RadioItem properties required (#267)
1 parent e51c869 commit a3d9d65

4 files changed

Lines changed: 7 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## 4.0.0 under development
44

55
- Chg #221: Throw `LogicException` in `Tag::id()` when id is empty string (@razvbir)
6+
- Chg #267: Make all `CheckboxItem` and `RadioItem` properties required (@vjik)
67
- Chg #234: Remove tag attributes sorting (@FrankiFixx)
78

89
## 3.13.0 March 13, 2026

UPGRADE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ application when you upgrade the package from one version to another.
1111

1212
- `Tag::id()` now throws `LogicException` when an empty string is passed. Check your code for places where you call
1313
`Tag::id()` and make sure you are not passing an empty string.
14+
- All `CheckboxItem` and `RadioItem` properties are now required. If you create instances of these classes directly,
15+
make sure to pass `$labelAttributes` and `$labelWrap` arguments explicitly.
1416
- HTML tag attributes are no longer sorted by `Html::renderTagAttributes()`. Previously, attributes were reordered
1517
according to a predefined priority list (`type`, `id`, `class`, `name`, `value`, etc.). Now attributes are rendered
1618
in the order they are set. If your code or tests depend on a specific attribute order in the rendered HTML, you need

src/Widget/CheckboxList/CheckboxItem.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function __construct(
1616
public array $checkboxAttributes,
1717
public string $label,
1818
public bool $encodeLabel,
19-
public array $labelAttributes = [],
20-
public bool $labelWrap = true,
19+
public array $labelAttributes,
20+
public bool $labelWrap,
2121
) {}
2222
}

src/Widget/RadioList/RadioItem.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function __construct(
1616
public array $radioAttributes,
1717
public string $label,
1818
public bool $encodeLabel,
19-
public array $labelAttributes = [],
20-
public bool $labelWrap = true,
19+
public array $labelAttributes,
20+
public bool $labelWrap,
2121
) {}
2222
}

0 commit comments

Comments
 (0)