Repository navigation
⚠️ !Breaking Change! Prefix wrapper methods that send a request with fetch - #38
Merged
Merged
Conversation
JulianVennen
approved these changes
Oct 19, 2026
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.
Depends on #37
The wrappers extend the generated models, so they have many getters that only return data, e.g.
$project->getName(). Methods that send a request to the Hangar API, e.g.$project->getVersions(), looked the same. These methods are now prefixed withfetch:Every
fetch*method sends a request each time it is called, exceptfetchProject()ofVersionandProjectPage(see below). This is also mentioned in the PHPDoc of each method.Renamed methods
fetchProject()ofVersionandProjectPageThese two methods keep the project once it is known, as before. They only send a request if the project is not known yet, e.g. a version returned by
Project::fetchVersions()already knows its project. They are renamed anyway, because they can send a request.Not renamed
Project::getSlug()andCompactProject::getSlug(), they do not send a request.ProjectPage::save(), the name already says that it sends a request.HangarAPIClient.Breaking changes
The old method names are removed. They are not kept as deprecated aliases, because this is part of a major release.
Tests and README
testFetch*.fetchDailyStats()ofProject,CompactProjectandVersion, andfetchProject()ofVersionandProjectPage. ThefetchProject()tests check that the request is only sent once.fetchprefix.