Repository navigation
[MAINTENANCE] Encapsulate access to physical structure data - part 1 - #2264
Open
beatrycze-volk wants to merge 4 commits into
Open
beatrycze-volk wants to merge 4 commits into
beatrycze-volk wants to merge 4 commits into
Conversation
beatrycze-volk
marked this pull request as draft
November 11, 2026 15:21
beatrycze-volk
force-pushed
the
physicalstructure
branch
from
November 12, 2026 09:02
703aec7 to
324e7e5
Compare
Direct access to the `physicalStructure` and `physicalStructureInfo` properties is now deprecated. Public getter methods, `getPhysicalStructure()` and `getPhysicalStructureInfo()`, have been introduced to provide a controlled API for retrieving this data, improving encapsulation. Accessing these properties directly via `__get()` will now trigger a deprecation warning, guiding developers to use the new public methods. All internal usages have been updated accordingly.
beatrycze-volk
force-pushed
the
physicalstructure
branch
from
November 12, 2026 10:07
324e7e5 to
35f5c71
Compare
…nodes Introduce `getPhysicalStructureNode()` in `AbstractDocument` to centralize and standardize access to individual physical structure nodes by their ID. This new method replaces direct indexed access to the `physicalStructureInfo` array, improving encapsulation and providing a consistent way to handle missing nodes by returning an empty array. All internal usages have been updated accordingly.
beatrycze-volk
force-pushed
the
physicalstructure
branch
2 times, most recently
from
November 12, 2026 12:06
d4b732c to
79ffa3b
Compare
Introduce `getPhysicalStructureNodeByPage()` to provide a direct way to retrieve physical structure metadata based on a page number. This new method encapsulates the previous two-step process of first resolving the physical structure ID from the `physicalStructure` array and then fetching the node using its ID. This change improves code readability and reduces redundancy across the codebase by consolidating a common lookup pattern. It also includes a minor refinement to `getPhysicalStructureNode()` to gracefully handle empty IDs.
beatrycze-volk
force-pushed
the
physicalstructure
branch
from
November 12, 2026 12:17
79ffa3b to
bb54707
Compare
Introduce `abstract protected function loadPhysicalStructure()` to centralize the format-specific logic for populating the document's physical structure. The `getPhysicalStructure()` method in `AbstractDocument` is now concrete, providing a consistent public interface that internally manages lazy loading by invoking `loadPhysicalStructure()` if the data is not yet available. This refactoring separates the concerns of *how* data is loaded (implemented by subclasses) from *when* it's loaded (managed by the abstract base class), reducing duplication and improving clarity in document type implementations. `getPhysicalStructureInfo()` also now utilizes this standardized loading mechanism.
beatrycze-volk
marked this pull request as ready for review
November 12, 2026 13:13
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2264 +/- ##
============================
============================
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Nov 12, 2026
This branch has not been deployed
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.
Direct access to the
physicalStructureandphysicalStructureInfoproperties is now deprecated. Public getter methods,getPhysicalStructure()andgetPhysicalStructureInfo(), have been introduced to provide a controlled API for retrieving this data, improving encapsulation.Accessing these properties directly via
__get()will now trigger a deprecation warning, guiding developers to use the new public methods. All internal usages have been updated accordingly.