Skip to content

Change default value $strict in Inflector::toSnakeCase() to false - #165

Open
vjik wants to merge 6 commits into
masterfrom
injector-improve
Open

Change default value $strict in Inflector::toSnakeCase() to false#165
vjik wants to merge 6 commits into
masterfrom
injector-improve

Conversation

@vjik

@vjik vjik commented Jul 18, 2026

Copy link
Copy Markdown
Member
Q A
Is bugfix?
New feature?
Breaks BC? ✔️

@vjik vjik added this to the 3.0 milestone Jul 18, 2026
@vjik vjik added the severity:BC breaking Breaks backwards compatibility label Jul 18, 2026
@codecov

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (f7c9db9) to head (e05a7fe).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 $strict to false.
  • Adjust InflectorTest expectations/data to cover the new default and explicitly set strict: true where the old behavior is required.
  • Bump the changelog “under development” section to 3.0.0 and 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.

Comment thread UPGRADE.md Outdated

@samdark samdark left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UPGRADE.md has wrong example. Check copilot comments.

@vjik
vjik requested a review from samdark July 25, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

severity:BC breaking Breaks backwards compatibility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants