Conversation
iMattPro
force-pushed
the
refactor-entities
branch
from
September 23, 2026 01:10
9b5d00e to
bc960b9
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #203 +/- ##
============================================
- Coverage 97.42% 96.84% -0.59%
- Complexity 268 276 +8
============================================
Files 21 22 +1
Lines 855 887 +32
============================================
+ Hits 833 859 +26
- Misses 22 28 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Keep hydration side-effect free so stored values are not transformed as new input. Use explicit factories and update only dirty fields. BREAKING CHANGE: Page and rule entities no longer expose load(), insert(), or save(). Their non-shared service IDs were also removed. Use operator create, get, add, and save methods instead. Refinements to refactoring
iMattPro
force-pushed
the
refactor-entities
branch
from
September 23, 2026 01:29
bc960b9 to
6e81432
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Critical public API and container service compatibility breaks remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (2)
What changed in this PR
This pull request refactors page persistence around a factory-backed page operator, updating controllers, services, entities, and tests.
Changes:
- Moves entity lifecycle operations into the page operator.
- Adds hydration, change tracking, and storage validation.
- Updates dependency injection, error handling, and test coverage.
| File | Reviewed changes |
|---|---|
tests/operators/page_operator_save_page_test.php |
Tests operator saves and Unicode behavior. |
tests/operators/page_operator_delete_page_test.php |
Tests operator lookup after deletion. |
tests/operators/page_operator_base.php |
Initializes and injects the entity factory. |
tests/operators/page_operator_add_page_test.php |
Tests operator entity retrieval. |
tests/event/show_page_links_test.php |
Updates operator construction. |
tests/entity/page_entity_title_test.php |
Adds Unicode length boundary coverage. |
tests/entity/page_entity_save_test.php |
Removes obsolete entity save tests. |
tests/entity/page_entity_route_test.php |
Uses import-based hydration. |
tests/entity/page_entity_load_test.php |
Removes obsolete load tests. |
tests/entity/page_entity_insert_test.php |
Removes obsolete insert tests. |
tests/entity/page_entity_import_test.php |
Tests storage preservation and atomic imports. |
tests/entity/page_entity_description_test.php |
Adds Unicode length boundary coverage. |
tests/controller/page_main_controller_test.php |
Injects the page operator. |
tests/controller/admin_controller_test.php |
Updates services and error-path coverage. |
operators/page.php |
Adds factory-based retrieval and persistence operations. |
operators/page_interface.php |
Defines the expanded operator API. |
exception/base.php |
Simplifies language loading. |
entity/page.php |
Adds hydration, change tracking, and storage-length checks. |
entity/page_interface.php |
Removes lifecycle methods; critical (2 votes): this breaks the public load(), insert(), and save() API without compatibility or migration guidance. |
entity/factory.php |
Provides fresh page entities. |
controller/main_controller.php |
Uses the page operator. |
controller/admin_controller.php |
Uses injected services and handles failures. |
config/services.yml |
Wires the factory and updated dependencies; critical (2 votes): removing phpbb.pages.entity breaks extensions retrieving the existing service ID. |
acp/pages_module.php |
Adds the controller type annotation. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+113
to
117
| phpbb.pages.entity_factory: | ||
| class: phpbb\pages\entity\factory | ||
| arguments: | ||
| - '@dbal.conn' | ||
| - '@config' |
Comment on lines
35
to
+40
| /** | ||
| * Insert the page data for the first time | ||
| * | ||
| * Will throw an exception if the page was already inserted (call save() instead) | ||
| * | ||
| * @return page_interface $this object for chaining calls; load()->set()->save() | ||
| * @access public | ||
| * @throws \phpbb\pages\exception\out_of_bounds | ||
| */ | ||
| public function insert(); | ||
| * Export current storage-form data. | ||
| * | ||
| * @return array | ||
| */ | ||
| public function get_data(); |
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.

No description provided.