Repository navigation
Make the GitHub client README match the public API - #126
Merged
Merged
Conversation
The README and docs named methods, return types, and a connector interface the package does not have, and the test badge tracked main while the default branch is master. Co-authored-by: Jordan Partridge <jordan@partridge.rocks>
There was a problem hiding this comment.
Ship it after the two constructor/priority nits are verified on the branch.
- Matches every public method and return type in the README, docs, and tests/DocumentationExamplesTest.php.
- Removes dead migration/factory/view, stale PHPStan baseline, and unused config keys.
- OAuth now throws on missing credentials and accepts an explicit state.
- Token order updated to config → GH_TOKEN → CLI.
- CI now runs on PRs; badges point at master.
Two small drift items flagged inline; otherwise the patch is consistent and the tests pass.
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.
Summary
A hiring manager landing from the portfolio would have copied the README and hit methods that do not exist. This PR makes the README, docs, config, and badges describe the code on
master.Readiness: 4/10 before, 8/10 after. The package already had a real Saloon client, Pest coverage, and a Packagist release. The first README snippet called
repos()->get()with a string, the resource table listedpullRequests()->commits,files()->get,files()->contents, andreleases()->create, and dependency injection used aGithubConnectorInterfacethat is not in the repo. Docs described Spatie Data objects,withRateLimiting(), andGithub::fake(). The test badge trackedmain. The default branch ismaster. PHPStan onmasterwas failing becausephpstan-baseline.neonignored errors the analyser no longer reports.What changed
docs/so every example matches a real method and return type.tests/DocumentationExamplesTest.phpruns the issue, pull request, and repository examples.masterand added a PHPStan badge forphpstan.yml.github_client_tablemigration, the commented factory, and the empty view. The service provider no longer publishes them.AuthenticationExceptionwhen the client id, secret, or redirect URL is missing, andgetAuthorizationUrl()accepts astateargument. The package still does not store or check that state.config('github-client.token'), thenconfig('github-client.gh_token'), thengh auth token. Unused config keys (base URL, auto retry, CLI preference, OAuth scopes, installation id) are gone because the code never read them.vendor/bin/phpstan analysereports no errors.vendor/bin/pestreports 229 passed.conduit-uiComposer keyword.composer require jordanpartridge/github-clientstill installs Packagistv3.0.0. The core examples (repos, issues, pull requests, commits, releases, Actions) match that tag and this branch.Github::forInstallation(),Github::withApp(), andinstallations()are on this branch only.Suggested GitHub description
Laravel client for the GitHub REST API, built with Saloon. Typed responses for repositories, issues, pull requests, commits, releases, and Actions.
Suggested topics
Keep
api,github,laravel,laravel-package. Addphp,github-api,saloon,api-client.Left for Jordan
composer requireinstallsv3.0.0.repos()->get()takes aRepovalue object, several methods return a Saloon response instead of a DTO,comments()->forPullRequest()requires arepositoryfilter, andPullRequestResourceEnhancedis not registered onGithub. DTOs need a full GitHub payload.files()->all()returns a commit tree response, not file contents. There is no retry and no custom API base URL.statewhen the caller does not pass one, and does not persist or verify it.