Adopt Scope rename, remove dead code, simplify Db#118
Merged
alganet merged 1 commit intoRespect:masterfrom Apr 4, 2026
Merged
Conversation
Member
alganet
commented
Apr 4, 2026
- Update all imports and type hints from Collection to Scope
- Rename all collection variables/params/comments to scope
- Remove unused Postcomment test stub
- Fix redundant column extraction in rawDelete
- Inline performFetch into fetch/fetchAll, remove indirection
- Remove unused Db::getSql()
- Remove registerScope calls from tests (feature removed in Data)
- Update all imports and type hints from Collection to Scope - Rename all collection variables/params/comments to scope - Remove unused Postcomment test stub - Fix redundant column extraction in rawDelete - Inline performFetch into fetch/fetchAll, remove indirection - Remove unused Db::getSql() - Remove registerScope calls from tests (feature removed in Data)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #118 +/- ##
============================================
+ Coverage 99.17% 99.71% +0.54%
+ Complexity 149 145 -4
============================================
Files 3 3
Lines 362 353 -9
============================================
- Hits 359 352 -7
+ Misses 3 1 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Refactors the relational mapper/query layer to adopt Respect\Data\Scope (replacing Collection), while removing dead code and simplifying Db fetch execution paths.
Changes:
- Replace
Collection/CollectionIteratorusage withScope/ScopeIteratorthroughoutMapper. - Simplify
Db::fetch()/Db::fetchAll()by inlining the statement execution flow and removeDb::getSql(). - Clean up tests and stubs by removing unused fixtures and updating tests for the new Scope-based API.
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/Stubs/Postcomment.php | Removes an unused test stub class. |
| tests/MapperTest.php | Updates nested persist tests to no longer rely on removed collection registration behavior; removes an identity map count test tied to removed API. |
| tests/DbTest.php | Removes the getSql() test now that Db::getSql() is gone. |
| src/Mapper.php | Migrates mapper APIs and query generation from Collection to Scope; simplifies rawDelete parameter flow. |
| src/Db.php | Removes getSql() / performFetch() indirection and executes statements directly in fetch() / fetchAll(). |
Comments suppressed due to low confidence (1)
src/Mapper.php:242
- The
$scopeparameter is not used insideextractColumns(), which makes the method signature misleading (and suggests the extraction depends on the scope when it currently does not). Since this is a private method, consider removing the unused parameter (and updating callers), or use it explicitly if column extraction is intended to be scope-aware.
private function extractColumns(object $entity, Scope $scope): array
{
$dbCols = [];
foreach ($this->entityFactory->extractColumns($entity) as $key => $value) {
$dbCols[$this->style->realProperty($key)] = $value;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.