Absorb fetch pipeline from AbstractMapper, remove style tests#95
Merged
Absorb fetch pipeline from AbstractMapper, remove style tests#95
Conversation
Add concrete fetch() and fetchAll() to Mapper, absorbing the full SQL pipeline that was removed from AbstractMapper. All pipeline methods (createStatement, fetchHydrated, parseHydrated, fetchSingle, fetchMulti) are now private implementation details. Remove all style tests and style entity stubs, naming convention tests and integration tests now live in Data with InMemoryMapper. MapperTest already covers typed entity fetch/persist with the default Standard style.
There was a problem hiding this comment.
Pull request overview
This PR relocates the SQL fetch pipeline into Respect\Relational\Mapper by adding concrete fetch() / fetchAll() implementations, and simplifies the test suite by removing per-style tests and moving inline stub entities into dedicated stub files.
Changes:
- Add
Mapper::fetch()andMapper::fetchAll()and make the underlying pipeline helpers private implementation details. - Remove
tests/Styles/*tests (style/integration coverage moved elsewhere per PR description). - Extract inline test stub entities from
MapperTest/DbTestintotests/Stubs/*and update dev autoload + tooling config accordingly.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Mapper.php | Introduces public fetch() / fetchAll() and internalizes statement/hydration/parsing helpers as private methods. |
| tests/MapperTest.php | Removes inline stub entity class definitions (now loaded from tests/Stubs). |
| tests/DbTest.php | Removes inline fetch stub classes (now loaded from tests/Stubs). |
| tests/Stubs/* | Adds dedicated stub entity classes used by the test suite (including OtherEntity/*). |
| tests/Styles/*.php | Removes style-specific tests from this repository. |
| composer.json | Updates autoload-dev PSR-4 mappings to include the new stub locations. |
| phpcs.xml.dist | Applies the Respect ruleset directly (previous deferrals removed) while keeping the tests variable-name exclusion. |
| phpstan.neon.dist | Removes an ignore rule for duplicate array keys (no longer needed with removed tests). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
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.
Add concrete fetch() and fetchAll() to Mapper, absorbing the full SQL pipeline that was removed from AbstractMapper. All pipeline methods (createStatement, fetchHydrated, parseHydrated, fetchSingle, fetchMulti) are now private implementation details.
Remove all style tests and style entity stubs, naming convention tests and integration tests now live in Data with InMemoryMapper. MapperTest already covers typed entity fetch/persist with the default Standard style.