Skip to content

Conversation

@JasonTheAdams
Copy link
Member

Resolves #68

This adds an AbstractApiProvider class, which provides a convenient way for API urls to be constructed, cleaning up a bunch of duplicate path constructing code.

I went with an abstract baseUrl method instead of using a constant that gets overridden so that it's clearer to extending classes and doesn't fail at runtime.

@JasonTheAdams JasonTheAdams added this to the 0.2.0 milestone Oct 17, 2025
@JasonTheAdams JasonTheAdams self-assigned this Oct 17, 2025
@github-actions
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: JasonTheAdams <jason_the_adams@git.wordpress.org>
Co-authored-by: felixarntz <flixos90@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JasonTheAdams Two tiny but important problems here that need to be addressed before merge, but otherwise this looks good to go, so I'll preemptively approve.

Please feel free to merge as soon as you have addressed these. 🚢

@felixarntz felixarntz added the [Type] Enhancement A suggestion for improvement. label Oct 17, 2025
@JasonTheAdams JasonTheAdams merged commit d55311e into trunk Oct 17, 2025
7 of 8 checks passed
@JasonTheAdams JasonTheAdams deleted the add-abstract-api-provider branch October 17, 2025 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide an AbstractApiProvider to clean up paths

3 participants