Skip to content

Conversation

Tigrov
Copy link
Member

@Tigrov Tigrov commented Apr 21, 2025

Q A
Is bugfix?
New feature? ✔️
Breaks BC? ✔️
Fixed issues #388, #358

Copy link

codecov bot commented Apr 21, 2025

Codecov Report

Attention: Patch coverage is 83.01158% with 44 lines in your changes missing coverage. Please review.

Project coverage is 88.40%. Comparing base (ec399f9) to head (3674162).

Files with missing lines Patch % Lines
src/Trait/ArrayAccessTrait.php 0.00% 17 Missing ⚠️
src/AbstractActiveRecord.php 88.11% 12 Missing ⚠️
src/Trait/MagicPropertiesTrait.php 80.00% 6 Missing ⚠️
src/ActiveQuery.php 86.84% 5 Missing ⚠️
src/Trait/CustomTableNameTrait.php 0.00% 2 Missing ⚠️
src/ActiveRelationTrait.php 95.00% 1 Missing ⚠️
src/Trait/ArrayIteratorTrait.php 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #412      +/-   ##
============================================
- Coverage     88.65%   88.40%   -0.25%     
- Complexity      567      571       +4     
============================================
  Files            16       18       +2     
  Lines          1357     1371      +14     
============================================
+ Hits           1203     1212       +9     
- Misses          154      159       +5     

☔ View full report in Codecov by Sentry.
📢 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.

use Yiisoft\Db\Exception\InvalidArgumentException;
use Yiisoft\Db\Exception\InvalidConfigException;

interface ActiveRecordModelInterface
Copy link
Member

Choose a reason for hiding this comment

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

Need description of the interface. What is it for?

From what I see now:

  1. It holds DB connection.
  2. It holds metadata such as table name.
  3. It holds data in terms of property-value pairs.

Copy link
Member

Choose a reason for hiding this comment

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

Overall, I don't see a clear separation/purpose between ActiveRecordModelInterface and ActiveRecordInterface. They are still very much inter-dependent, but moved into two interfaces.

* @return bool Whether the two active records refer to the same row in the same database table.
*/
public function equals(self $record): bool;
public function equals(ActiveRecordModelInterface $record): bool;
Copy link
Member

Choose a reason for hiding this comment

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

It doesn't look correct. Either the method should be moved to ActiveRecordModelInterface or ActiveRecordInterface should be used here.

Copy link
Member Author

Choose a reason for hiding this comment

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

ActiveRecordInterface should be here and one more method modelEquals(ActiveRecordModelInterface $model) should be added.

use Yiisoft\Db\Exception\NotSupportedException;

/**
* This interface is used by {@see ActiveRecordModelInterface}.
Copy link
Member

Choose a reason for hiding this comment

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

Need a proper description about what is the purpose of this interface and what's the relation with ActiveRecordModelInterface.

@Tigrov Tigrov added the status:under development Someone is working on a pull request. label Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:under development Someone is working on a pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants