Add default true to bool toggle methods in Alert, Dropdown, and… - #125
Open
WarLikeLaux wants to merge 3 commits into
Open
Add default true to bool toggle methods in Alert, Dropdown, and…#125WarLikeLaux wants to merge 3 commits into
true to bool toggle methods in Alert, Dropdown, and…#125WarLikeLaux wants to merge 3 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #125 +/- ##
===========================================
Coverage 100.00% 100.00%
Complexity 316 316
===========================================
Files 8 8
Lines 1005 1005
===========================================
Hits 1005 1005 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR improves API consistency across the widget fluent setters by making several boolean “toggle” methods default to true, aligning them with existing behavior (e.g., Alert::headerContainer()), and adding regression tests to ensure the no-argument call matches explicitly passing true.
Changes:
- Add
= truedefault values to boolean toggle methods inAlert,Dropdown, andMenu. - Add unit tests verifying
method()renders identically tomethod(true)for the updated toggles. - Document the enhancement in the changelog.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/Alert.php |
Adds default true to bodyContainer(bool $value = true). |
src/Dropdown.php |
Adds default true to container() and itemContainer(). |
src/Menu.php |
Adds default true to activateItems(), container(), and itemsContainer(). |
tests/Alert/AlertTest.php |
Adds a test asserting bodyContainer() equals bodyContainer(true) output. |
tests/Dropdown/DropdownTest.php |
Adds tests asserting container()/itemContainer() equal their (...true) equivalents. |
tests/Menu/MenuTest.php |
Adds tests asserting activateItems()/container()/itemsContainer() equal their (...true) equivalents. |
CHANGELOG.md |
Adds entry for enhancement #125. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vjik
approved these changes
May 31, 2026
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.
What does this PR do?
Add default
trueto bool toggle methods for consistency.Alert::headerContainer()already had= true, butbodyContainer(),Dropdown::container(),itemContainer(),Menu::activateItems(),container(), anditemsContainer()did not.Tests verify that calling these methods without an argument produces the same result as calling with
true, preventing accidental removal of the default.No BC break: adding a default value to an existing parameter is backward compatible.
Coverage