Closed darkdef closed 2 months ago
Q | A |
---|---|
Is bugfix? | ✔️ |
New feature? | ✔️ |
Breaks BC? | ✔️/❌ |
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 99.61%. Comparing base (
6a8ceea
) to head (b6db838
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Modifications to the queryOne()
method
The queryOne()
function, which can be found in AbstractCommand.php
, CommandInterface.php
, and CommandInterfaceProxy.php
, underwent revisions that enable it to provide a more diverse set of results. This function formerly returned only arrays, but with this update, it can now return an array, an object, or even a null value. This improvement enhances the flexibility and coverage of the response types our system can deliver.
Improvements to the one()
method
Similar to the queryOne()
modifications, we have updated the one()
function in Query.php
and QueryInterface.php
to return either an array, an object, or a null value. Previously, the function was limited to just array results. This change broadens the scope of possible outputs, making our system more diverse and adaptable in responding to different query requirements.
BatchQueryResult::$value
and related methods also should have the typearray|object|null
It's maybe incorrect for query with one column as scalar type.
BatchQueryResult::$value
and related methods also should have the typearray|object|null
It's maybe incorrect for query with one column as scalar type.
This should be an array or object ($row) or array of arrays or objects ($rows) or null, but seems this is not related with the PR.
https://github.com/yiisoft/db/blob/ef81e8b7749525030dba95060b71a9f490fe2784/src/Query/BatchQueryResult.php#L103 https://github.com/yiisoft/db/blob/ef81e8b7749525030dba95060b71a9f490fe2784/src/Command/AbstractCommand.php#L425-L429
And after custom populate closure $rows
can be changed to array of object
s
https://github.com/yiisoft/db/blob/ef81e8b7749525030dba95060b71a9f490fe2784/src/Query/BatchQueryResult.php#L108-L110
Needs line to changelog
And fill UPGRADE.md
too
Do we need also fix type of
CommandInterface::queryAll()
?
Currently it looks excessive and needs refactoring DbArrayHelper
for supporting objects but it looks redundant.