Skip to content

Rename Project::getVersions() to fetchVersions(), Deprecate Project::getVersions() - #22

Merged
pavog merged 1 commit into
mainfrom
fetch-versions
Oct 16, 2026
Merged

pavog merged 1 commit into
mainfrom
fetch-versions

Conversation

@pavog

@pavog pavog commented Oct 16, 2026

Copy link
Copy Markdown
Member

Project::getVersions() sends a request to the SpigotMC API, but its name looks like a getter of the generated model. Methods that send a request are now prefixed with fetch, so it is clear when the client calls the API.

Changes

  • New Project::fetchVersions(). It has the same parameters and returns the same PaginatedVersionList. The PHPDoc states that it sends a request on every call and that the result is not cached.
  • Project::getVersions() is deprecated and calls fetchVersions(). It will be removed in the next major version.
  • Tests and README use fetchVersions(). A new test checks that the deprecated getVersions() still fetches the versions.

This is not a breaking change.

@pavog pavog changed the title Rename Project::getVersions() to fetchVersions() Rename Project::getVersions() to fetchVersions(), Deprecate Project::getVersions() Oct 16, 2026
@pavog
pavog merged commit 113abaa into main Oct 16, 2026
5 checks passed
@pavog
pavog deleted the fetch-versions branch October 16, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant