Skip to content

Rename Author::getProjects() to fetchProjects(), Deprecate Author::getProjects() - #23

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

pavog merged 1 commit into
mainfrom
author-fetch-projects

Conversation

@pavog

@pavog pavog commented Oct 16, 2026

Copy link
Copy Markdown
Member

Author::getProjects() 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 Author::fetchProjects(). It returns the same PaginatedAuthorProjectList. The PHPDoc states that it sends a request on every call and that the result is not cached.
  • Author::getProjects() is deprecated and calls fetchProjects(). It will be removed in the next major version.
  • Tests and README use fetchProjects(). A new test checks that the deprecated getProjects() still fetches the projects.
  • The README named the wrong return type (PaginatedProjectList), it now says PaginatedAuthorProjectList.

This is not a breaking change.

@pavog
pavog merged commit fc8a874 into main Oct 16, 2026
5 checks passed
@pavog
pavog deleted the author-fetch-projects branch October 16, 2026 16:02
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