Add return value to QueryBuilder::executeResetSequence()#20765
Add return value to QueryBuilder::executeResetSequence()#20765WarLikeLaux wants to merge 5 commits intoyiisoft:masterfrom
QueryBuilder::executeResetSequence()#20765Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #20765 +/- ##
=========================================
Coverage 80.15% 80.15%
Complexity 11536 11536
=========================================
Files 374 374
Lines 30213 30213
=========================================
Hits 24218 24218
Misses 5995 5995 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds the missing return value propagation for executeResetSequence() so callers of Command::executeResetSequence() receive the affected-row count (as returned by Command::execute()), aligning behavior across base and Oracle query builders.
Changes:
- Return the result of
execute()fromQueryBuilder::executeResetSequence()andoci\QueryBuilder::executeResetSequence(). - Document
@return intforexecuteResetSequence()inQueryBuilderandCommand. - Add a test asserting
Command::executeResetSequence()returns anint.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/framework/db/CommandTest.php | Adds a test to ensure executeResetSequence() returns an integer for implicit/explicit values. |
| framework/db/oci/QueryBuilder.php | Returns the execute() result from the Oracle reset-sequence implementation. |
| framework/db/QueryBuilder.php | Returns the execute() result and documents @return int. |
| framework/db/Command.php | Documents @return int for Command::executeResetSequence(). |
| framework/CHANGELOG.md | Adds changelog entry for the enhancement. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What does this PR do?
QueryBuilder::executeResetSequence()and its Oracle override don't return the result ofexecute(), soCommand::executeResetSequence()always returnsnull. This PR adds the missingreturnso callers get the affected row count (int).Continues #20056 (approved by bizley, samdark, Arhell but never merged). This PR extends the fix to
oci\QueryBuilder, adds@returnPHPDoc to all 3 methods, and adds a test.Changes
returninQueryBuilder::executeResetSequence()andoci\QueryBuilder::executeResetSequence()@return intPHPDoc to all 3 methods (QueryBuilder,oci\QueryBuilder,Command)Tests
CommandTest (1 test, 2 assertions): return type check for
executeResetSequence()with auto and explicit value.