Skip to content

[FEATURE] Add methods for querying MODS elements by parameters#38

Open
beatrycze-volk wants to merge 2 commits into
slub:masterfrom
beatrycze-volk:parameters3
Open

[FEATURE] Add methods for querying MODS elements by parameters#38
beatrycze-volk wants to merge 2 commits into
slub:masterfrom
beatrycze-volk:parameters3

Conversation

@beatrycze-volk

Copy link
Copy Markdown
Collaborator

Depends on #36

Extracts common patterns for fetching single and multiple XML elements into new `getElement()` and `getElements()` helper methods in `BaseElement`.

This reduces code duplication across various element-specific getter methods, enhancing maintainability and extensibility. Redundant private helper methods are removed from `BaseNameElement` by leveraging these new generic methods.
@beatrycze-volk beatrycze-volk added this to the PHP MODS Reader 1.0.0 milestone Jul 3, 2026
@beatrycze-volk beatrycze-volk self-assigned this Jul 3, 2026
@beatrycze-volk beatrycze-volk added feature New functionality, enhancements, or user requests for improvements php Pull requests that update PHP code labels Jul 3, 2026
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 4 complexity · 0 duplication

Metric Results
Complexity 4
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Introduce new `get...ByParameters()` methods in  elements. These methods provide a more flexible way to query MODS metadata by allowing searches using a combination of XPath fragments, attributes, and element values.

The `Query` utility class is leveraged to construct dynamic XPath expressions based on the provided parameters, standardizing complex query generation. Existing single-parameter getter methods are also refactored to utilize generic element retrieval helpers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New functionality, enhancements, or user requests for improvements php Pull requests that update PHP code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant