Change default value $strict in Inflector::toSnakeCase() to false - #165
Change default value $strict in Inflector::toSnakeCase() to false#165vjik wants to merge 6 commits into
$strict in Inflector::toSnakeCase() to false#165Conversation
vjik
commented
Jul 18, 2026
| Q | A |
|---|---|
| Is bugfix? | ❌ |
| New feature? | ❌ |
| Breaks BC? | ✔️ |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #165 +/- ##
===========================================
Coverage 100.00% 100.00%
Complexity 171 171
===========================================
Files 7 7
Lines 476 476
===========================================
Hits 476 476 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR changes the default value of the $strict parameter in Yiisoft\Strings\Inflector::toSnakeCase() from true to false (a BC break), and updates the surrounding release documentation and tests to reflect the new default behavior.
Changes:
- Update
Inflector::toSnakeCase()signature and docblock to default$stricttofalse. - Adjust
InflectorTestexpectations/data to cover the new default and explicitly setstrict: truewhere the old behavior is required. - Bump the changelog “under development” section to
3.0.0and add an upgrade note describing the BC break.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/Inflector.php |
Changes the default $strict value in toSnakeCase() and updates PHPDoc accordingly. |
tests/InflectorTest.php |
Updates test data to align with the new default behavior and preserves old behavior via strict: true. |
UPGRADE.md |
Adds an upgrade note describing how to retain prior behavior when upgrading to 3.x. |
CHANGELOG.md |
Moves “under development” to 3.0.0 and records the BC change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
samdark
left a comment
There was a problem hiding this comment.
UPGRADE.md has wrong example. Check copilot comments.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>