Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Resources/ChecksResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
*
* @return array{total_count: int, check_runs: array<int, array<string, mixed>>}
*/
public function forRef(string $owner, string $repo, string $ref): array
public function forRef(string $owner, string $repo, string $ref, ?int $perPage = null, ?int $page = null): array
{
$response = $this->github()->connector()->send(
new GetCheckRunsForRef($owner, $repo, $ref),
new GetCheckRunsForRef($owner, $repo, $ref, $perPage, $page),
);

return $response->json();
Expand Down
4 changes: 3 additions & 1 deletion src/Resources/FileResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ public function all(string $repo_name, string $commit_sha): Response
/**
* Get the contents of a file at a specific ref (branch, tag, or SHA).
*
* @return array{name: string, path: string, sha: string, size: int, content: string, encoding: string}
* Note: If the path is a directory, GitHub returns an array of entries instead.
*
* @return array{name: string, path: string, sha: string, size: int, content: string, encoding: string}|array<int, array<string, mixed>>
*/
public function contents(string $owner, string $repo, string $path, ?string $ref = null): array
{
Expand Down
3 changes: 2 additions & 1 deletion tests/AuthenticationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use JordanPartridge\GithubClient\Auth\TokenResolver;
use JordanPartridge\GithubClient\Connectors\GithubConnector;
use JordanPartridge\GithubClient\Facades\Github;
use JordanPartridge\GithubClient\Github as GithubClient;
use Saloon\Http\Faking\MockClient;
use Saloon\Http\Faking\MockResponse;
use JordanPartridge\GithubClient\Data\Repos\RepoData;
Expand Down Expand Up @@ -169,7 +170,7 @@
$connector->withMockClient($mockClient);

// Create Github instance with unauthenticated connector
$github = new JordanPartridge\GithubClient\Github($connector);
$github = new GithubClient($connector);

// Should be able to get public repo without auth
$repo = $github->getRepo('owner/public-repo');
Expand Down
3 changes: 2 additions & 1 deletion tests/CommitResourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Carbon\Carbon;
use JordanPartridge\GithubClient\Facades\Github;
use JordanPartridge\GithubClient\Github as GithubClient;
use JordanPartridge\GithubClient\Resources\CommitResource;
use JordanPartridge\GithubClient\ValueObjects\Repo;
use Saloon\Http\Faking\MockClient;
Expand All @@ -16,7 +17,7 @@
]);

Github::connector()->withMockClient($mockClient);
$this->resource = new CommitResource(app(JordanPartridge\GithubClient\Github::class));
$this->resource = new CommitResource(app(GithubClient::class));
});

it('can fetch all commits for a repository', function () {
Expand Down
Loading