gitea/src/4b355731-bbcc-430f-a451-f94.../code.power

33 lines
785 B
Plaintext

/**
* List a repo's stargazers.
*
* @param string $ownerName The owner name.
* @param string $repoName The repository name.
* @param int $page The page number of results to return (1-based).
* @param int $limit The page size of results.
*
* @return array|null
* @since 3.2.0
**/
public function list(
string $ownerName,
string $repoName,
int $page = 1,
int $limit = 10
): ?array
{
// Build the request path.
$path = "/repos/{$ownerName}/{$repoName}/stargazers";
// Set the page and limit values.
$this->uri->setVar('page', $page);
$this->uri->setVar('limit', $limit);
// Send the get request.
return $this->response->get(
$this->http->get(
$this->uri->get($path)
)
);
}