Repository navigation
Fix #399: Add $themed parameter to ButtonGroup::buttonsData() method - #399
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #399 +/- ##
========================================
Coverage 0.00% 0.00%
- Complexity 815 819 +4
========================================
Files 48 48
Lines 2716 2741 +25
========================================
- Misses 2716 2741 +25 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
vjik
reviewed
Jul 26, 2026
Instead of passing a factory callback to the vendor ButtonGroup, build ButtonField widgets inline and pass Button tags to buttons(). No vendor changes needed.
- Invert is_array guard to eliminate uncovered continue mutant (MSI 100%) - Add test verifying default non-themed output even when theme is configured - Add test verifying non-array items are skipped in themed mode
vjik
requested changes
Jul 27, 2026
Co-authored-by: Sergei Predvoditelev <sergey.predvoditelev@gmail.com>
- strtolower() for case-insensitive type matching (review r3656025758) - Add test for case-insensitive type (RESET, Submit) - Add test for integer type value to kill CastString mutant
There was a problem hiding this comment.
Pull request overview
Adds an opt-in themed mode to ButtonGroup::buttonsData() so array-defined buttons can be created via ButtonField instances (and therefore participate in the Form theme system when ThemeContainer is configured).
Changes:
- Add
bool $themed = falseparameter toButtonGroup::buttonsData()and implement themed button creation viaButton/ResetButton/SubmitButton. - Add PHPUnit coverage for themed behavior, edge cases, and immutability.
- Document the change in
CHANGELOG.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/Field/ButtonGroup.php |
Adds the $themed parameter and builds buttons via ButtonField widgets when enabled. |
tests/Field/ButtonGroupTest.php |
Adds tests for themed buttonsData() behavior (types, encoding, theme usage, invalid items). |
CHANGELOG.md |
Adds an entry describing the new $themed parameter feature. |
Comments suppressed due to low confidence (1)
src/Field/ButtonGroup.php:62
- After removing the unused
ThemeContainerimport, this{@see ThemeContainer}PHPDoc reference will resolve to the current namespace (Yiisoft\Form\Field\ThemeContainer) and become incorrect. Use a fully-qualified reference so IDEs/linking work reliably.
* Theme styling only applies when the host application has configured a theme via
* {@see ThemeContainer}. Without a configured theme, the output is identical to the
* default (non-themed) behavior.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vjik
reviewed
Jul 27, 2026
vjik
approved these changes
Jul 27, 2026
samdark
requested changes
Jul 28, 2026
…ata() Keeps behavior consistent between themed and non-themed buttonsData(), per review feedback on yiisoft#399.
samdark
approved these changes
Jul 28, 2026
$themed parameter to ButtonGroup::buttonsData() method
Member
|
👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
bool $themedparameter toButtonGroup::buttonsData().When
themed: true, buttons are created viaButtonFieldinstances (Button,ResetButton,SubmitButton) instead of rawTag\Buttonobjects. This enables theme support for buttons created from array data. Theme styling only applies when the host application has configured a theme viaThemeContainer.Depends on yiisoft/html#285.