Repository navigation
Conversation
Several 5.0 changes need to be listed in the update guide. Add it with an empty list so those changes do not conflict over creating the file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
These methods and classes target endpoints that GitHub has removed or
replaced, so they cannot work against the live API: the OAuth
Authorizations API, the Downloads API, the legacy search API, the legacy
watching and /teams/{team_id} routes, Orgs\Hooks::edit(), which created a
hook instead of editing one, and Users\Keys::edit(), for which GitHub has
no endpoint. They are deprecated in 4.x; remove them and list them with
their replacements in the update guide.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No method had native types, and several doc blocks were wrong (gist IDs documented as integer, the release draft flag as string, the milestone title as integer, among others). Add parameter types from the doc blocks after correcting them, return types where a method always returns the same type, and property types, and list the changes in the update guide. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 of Changes
No method in the package had native parameter or return types, and several doc blocks were wrong. This adds:
string,int,bool,array, unions where documented), nullable where the default isnull. Parameters whose default does not match the documented type, or that are documented asmixed, stay untyped (e.g.Gists::create($files),Users::edit($hireable),processResponse($expectedCode)— the latter accepts a list of codes after [4.x] Fix the expected status codes and fail on invalid JSON responses #92).string(as in [4.x] Treat gist IDs as strings #86),Issues::create()/edit()milestoneint|string|null,Milestones::create()/edit()titlestring,Pulls\Comments::create()positionint,Releases::edit()bodystringand draft/prereleasebool,Data\Trees::create()treearray,Users::edit()hireableboolean|string. Two tests passed values of the wrong type and were adjusted (TreesTest::testCreate,ReleasesTest::testEdit).bool(check…(),is…()),string,void, plusfetchUrl(): Uri,processResponse(): mixed,Github::getOption(): mixed,Github::setOption(): static,__get(). Methods returning the decoded JSON stay without a return type (object, array ornulldepending on the endpoint).$options,$client,$package,$hookEvents.Not done: making classes
final. The package classes are meant to be extended and mocked (the tests mock them), so whether any of them should be final is left to the maintainers.Depends on #106 (removal of the dead-endpoint wrappers, so they are not typed) and #105 (update guide); this branch contains both commits until they are merged.
Merge-up: this touches almost every method signature, so every open 4.x PR that changes a signature or doc block conflicts with it when 4.x-dev is merged into 5.x-dev (in particular #86, #87, #89, #90, #91, #92, #93, #96–#101 and the new API packages #68–#85, which need the same typing afterwards). Take the 4.x behaviour and re-apply the types.
Testing Instructions
vendor/bin/phpunit,phpstan(no new errors) andphpcspass on 5.x-dev.Documentation Changes Required
docs/v4-to-v5-update.md: new section on the native types and the corrected parameter types.🤖 Generated with Claude Code