From 31981158e1d795cfc4ecb83d0776f6b297d1ebfd Mon Sep 17 00:00:00 2001 From: Maxcastel Date: Tue, 29 Sep 2026 15:09:47 +0200 Subject: [PATCH] Fix broken and generic @link/@see annotations across the REST API classes --- doc/activity.md | 2 +- doc/apps.md | 2 +- doc/authorizations.md | 2 +- doc/caching.md | 2 +- doc/commits.md | 2 +- doc/copilot/usage.md | 2 +- doc/currentuser/emails.md | 2 +- doc/currentuser/memberships.md | 2 +- doc/currentuser/publickeys.md | 2 +- doc/currentuser/repositories.md | 2 +- doc/enterprise.md | 2 +- doc/enterprise/secret-scanning.md | 2 +- doc/gists.md | 2 +- doc/gists/comments.md | 2 +- doc/gitdata/blobs.md | 2 + doc/gitdata/commits.md | 2 + doc/gitdata/references.md | 1 + doc/gitdata/tags.md | 2 + doc/gitdata/trees.md | 2 + doc/graphql.md | 10 +- doc/issue/assignees.md | 2 +- doc/issue/comments.md | 2 +- doc/issue/labels.md | 2 +- doc/issue/milestones.md | 2 +- doc/issue/timeline.md | 2 +- doc/issues.md | 2 +- doc/meta.md | 2 +- doc/miscellaneous/codeofconduct.md | 2 + doc/miscellaneous/emojis.md | 2 + doc/miscellaneous/gitignore.md | 2 + doc/miscellaneous/licenses.md | 2 + doc/miscellaneous/markdown.md | 2 + doc/notification.md | 2 +- doc/organization.md | 4 +- doc/organization/actions/secrets.md | 18 +-- .../actions/self_hosted_runners.md | 8 +- doc/organization/actions/variables.md | 18 +-- doc/organization/members.md | 2 +- doc/organization/organization-roles.md | 2 +- doc/organization/secret-scanning.md | 2 +- doc/organization/teams.md | 2 +- doc/organization/webhooks.md | 2 +- doc/project/cards.md | 2 + doc/project/columns.md | 2 + doc/project/projects.md | 2 + doc/pull_request/comments.md | 2 +- doc/pull_request/review_request.md | 2 + doc/pull_request/reviews.md | 4 +- doc/pull_requests.md | 2 +- doc/rate_limits.md | 2 +- doc/repo/actions/artifacts.md | 10 +- doc/repo/actions/secrets.md | 12 +- doc/repo/actions/self_hosted_runners.md | 8 +- doc/repo/actions/variables.md | 10 +- doc/repo/actions/workflow_jobs.md | 6 +- doc/repo/actions/workflow_runs.md | 20 +-- doc/repo/actions/workflows.md | 8 +- doc/repo/assets.md | 2 + doc/repo/check_runs.md | 14 +- doc/repo/check_suites.md | 10 +- doc/repo/checks.md | 10 +- doc/repo/contents.md | 17 +- doc/repo/deployments.md | 4 +- doc/repo/deployments/environment/secrets.md | 10 +- doc/repo/deployments/environment/variables.md | 10 +- doc/repo/deployments/environments.md | 2 +- doc/repo/deployments/policies.md | 2 +- doc/repo/hooks.md | 2 +- doc/repo/labels.md | 2 + doc/repo/protection.md | 2 +- doc/repo/releases.md | 2 +- doc/repo/secret-scanning.md | 8 +- doc/repo/stargazers.md | 2 + doc/repo/statuses.md | 2 +- doc/repo/tags.md | 2 + doc/repos.md | 12 +- doc/request_any_route.md | 2 +- doc/search.md | 4 +- doc/security.md | 8 +- doc/user/migration.md | 12 +- doc/users.md | 2 +- lib/Github/Api/App/Hook.php | 10 +- lib/Github/Api/Apps.php | 26 ++-- lib/Github/Api/Authorizations.php | 10 +- lib/Github/Api/Copilot/Usage.php | 50 ++++++ lib/Github/Api/CurrentUser.php | 41 ++++- lib/Github/Api/CurrentUser/Emails.php | 12 +- lib/Github/Api/CurrentUser/Followers.php | 10 +- lib/Github/Api/CurrentUser/Memberships.php | 6 +- lib/Github/Api/CurrentUser/Notifications.php | 20 +-- lib/Github/Api/CurrentUser/PublicKeys.php | 10 +- lib/Github/Api/CurrentUser/Starring.php | 12 +- lib/Github/Api/CurrentUser/Watchers.php | 10 +- lib/Github/Api/Deployment.php | 24 ++- lib/Github/Api/Deployment/Environments.php | 14 +- lib/Github/Api/Deployment/Policies.php | 12 +- lib/Github/Api/Enterprise.php | 2 +- lib/Github/Api/Enterprise/License.php | 2 +- .../Api/Enterprise/ManagementConsole.php | 8 +- lib/Github/Api/Enterprise/SecretScanning.php | 2 +- lib/Github/Api/Enterprise/Stats.php | 24 +++ lib/Github/Api/Enterprise/UserAdmin.php | 4 +- lib/Github/Api/Environment/Secrets.php | 12 +- lib/Github/Api/Environment/Variables.php | 12 +- lib/Github/Api/Gist/Comments.php | 14 +- lib/Github/Api/Gists.php | 61 +++++++- lib/Github/Api/GitData.php | 2 +- lib/Github/Api/GitData/Blobs.php | 8 +- lib/Github/Api/GitData/Commits.php | 6 +- lib/Github/Api/GitData/References.php | 18 ++- lib/Github/Api/GitData/Tags.php | 8 +- lib/Github/Api/GitData/Trees.php | 6 +- lib/Github/Api/GraphQL.php | 10 +- lib/Github/Api/Issue.php | 30 ++-- lib/Github/Api/Issue/Assignees.php | 8 +- lib/Github/Api/Issue/Comments.php | 14 +- lib/Github/Api/Issue/Events.php | 6 +- lib/Github/Api/Issue/Labels.php | 21 +-- lib/Github/Api/Issue/Milestones.php | 14 +- lib/Github/Api/Issue/Timeline.php | 7 +- lib/Github/Api/Markdown.php | 10 +- lib/Github/Api/Meta.php | 4 +- .../Api/Miscellaneous/CodeOfConduct.php | 9 +- lib/Github/Api/Miscellaneous/Emojis.php | 2 +- lib/Github/Api/Miscellaneous/Gitignore.php | 4 +- lib/Github/Api/Miscellaneous/Licenses.php | 4 +- lib/Github/Api/Notification.php | 10 +- lib/Github/Api/Organization.php | 27 +++- .../Api/Organization/Actions/Secrets.php | 22 +-- .../Actions/SelfHostedRunners.php | 8 +- .../Api/Organization/Actions/Variables.php | 20 +-- lib/Github/Api/Organization/Hooks.php | 12 +- lib/Github/Api/Organization/Members.php | 97 +++++++++++- .../Api/Organization/OrganizationRoles.php | 93 ++++++++++- .../Api/Organization/OutsideCollaborators.php | 8 +- lib/Github/Api/Organization/Projects.php | 25 +++ .../Api/Organization/SecretScanning.php | 2 +- lib/Github/Api/Organization/Teams.php | 68 ++++++-- lib/Github/Api/Project/AbstractProjectApi.php | 48 +++++- lib/Github/Api/Project/Cards.php | 77 ++++++++- lib/Github/Api/Project/Columns.php | 88 ++++++++++- lib/Github/Api/PullRequest.php | 76 ++++++++- lib/Github/Api/PullRequest/Comments.php | 16 +- lib/Github/Api/PullRequest/Review.php | 23 +-- lib/Github/Api/PullRequest/ReviewRequest.php | 13 +- lib/Github/Api/RateLimit.php | 4 +- .../Api/RateLimit/RateLimitResource.php | 2 + lib/Github/Api/Repo.php | 146 +++++++++++------- .../Api/Repository/Actions/Artifacts.php | 12 +- lib/Github/Api/Repository/Actions/Secrets.php | 14 +- .../Repository/Actions/SelfHostedRunners.php | 10 +- .../Api/Repository/Actions/Variables.php | 12 +- .../Api/Repository/Actions/WorkflowJobs.php | 8 +- .../Api/Repository/Actions/WorkflowRuns.php | 22 +-- .../Api/Repository/Actions/Workflows.php | 10 +- lib/Github/Api/Repository/Assets.php | 12 +- .../Api/Repository/Checks/CheckRuns.php | 16 +- .../Api/Repository/Checks/CheckSuites.php | 12 +- lib/Github/Api/Repository/Collaborators.php | 12 +- lib/Github/Api/Repository/Comments.php | 65 +++++++- lib/Github/Api/Repository/Commits.php | 50 +++++- lib/Github/Api/Repository/Contents.php | 18 +-- lib/Github/Api/Repository/DeployKeys.php | 64 +++++++- lib/Github/Api/Repository/Downloads.php | 12 +- lib/Github/Api/Repository/Forks.php | 24 ++- lib/Github/Api/Repository/Hooks.php | 83 +++++++++- lib/Github/Api/Repository/Labels.php | 59 ++++++- lib/Github/Api/Repository/Pages.php | 85 +++++++++- lib/Github/Api/Repository/Projects.php | 32 ++++ lib/Github/Api/Repository/Protection.php | 54 +++---- lib/Github/Api/Repository/Releases.php | 20 ++- lib/Github/Api/Repository/SecretScanning.php | 8 +- lib/Github/Api/Repository/Stargazers.php | 16 +- lib/Github/Api/Repository/Statuses.php | 8 +- lib/Github/Api/Repository/Traffic.php | 10 +- lib/Github/Api/Search.php | 16 +- lib/Github/Api/User.php | 32 ++-- lib/Github/Api/User/Migration.php | 12 +- phpstan.neon.dist | 4 + 179 files changed, 2016 insertions(+), 646 deletions(-) diff --git a/doc/activity.md b/doc/activity.md index 48d7cfb423d..f45f81a56a6 100644 --- a/doc/activity.md +++ b/doc/activity.md @@ -2,7 +2,7 @@ [Back to the navigation](README.md) Access to Starring and Watching a Repository for [non] authenticated users. -Wrap [GitHub Activity API](https://developer.github.com/v3/activity/). +Wrap [GitHub Activity API](https://docs.github.com/rest/activity). > *** No authentication required. *** diff --git a/doc/apps.md b/doc/apps.md index 14de9e4434d..6e5f76a81a8 100644 --- a/doc/apps.md +++ b/doc/apps.md @@ -1,7 +1,7 @@ ## Applications API [Back to the navigation](README.md) -Wraps [GitHub Applications API](http://developer.github.com/v3/apps/). +Wraps [GitHub Applications API](https://docs.github.com/rest/apps/apps). ### Create a new installation token For the installation id 123 use the following: diff --git a/doc/authorizations.md b/doc/authorizations.md index b037e402c27..3c14efa487c 100644 --- a/doc/authorizations.md +++ b/doc/authorizations.md @@ -1,7 +1,7 @@ ## Authorizations API [Back to the navigation](README.md) -Creating, deleting and listing authorizations. Wraps [GitHub Authorizations API](http://developer.github.com/v3/oauth_authorizations/). +Creating, deleting and listing authorizations. Wraps [GitHub Authorizations API](https://docs.github.com/rest/apps/oauth-applications). #### List all authorizations. diff --git a/doc/caching.md b/doc/caching.md index 1a004cc8781..4f9a9f96881 100644 --- a/doc/caching.md +++ b/doc/caching.md @@ -26,5 +26,5 @@ $client->removeCache(); ``` Using cache, the client will get cached responses if resources haven't changed since last time, -**without** reaching the `X-Rate-Limit` [imposed by GitHub](http://developer.github.com/v3/#rate-limiting). +**without** reaching the `X-Rate-Limit` [imposed by GitHub](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api). diff --git a/doc/commits.md b/doc/commits.md index 165d71ecae2..4f5530d8654 100644 --- a/doc/commits.md +++ b/doc/commits.md @@ -2,7 +2,7 @@ [Back to the navigation](README.md) Getting information on specific commits, the diffs they introduce, the files they've changed. -Wrap [GitHub Commit API](http://developer.github.com/v3/git/commits/). +Wrap [GitHub Commit API](https://docs.github.com/rest/commits/commits). ### List commits in a branch diff --git a/doc/copilot/usage.md b/doc/copilot/usage.md index 6005adc1600..b19c8f2dbaf 100644 --- a/doc/copilot/usage.md +++ b/doc/copilot/usage.md @@ -5,7 +5,7 @@ The Copilot Usage API provides endpoints to retrieve usage summaries for organizations and enterprises. -**Note**: This endpoint is in beta and is subject to change. +**Note**: This endpoint has been deprecated by GitHub in favor of the [Copilot usage metrics API](https://docs.github.com/rest/copilot/copilot-usage-metrics). ## Endpoints diff --git a/doc/currentuser/emails.md b/doc/currentuser/emails.md index ef099f468d5..03b9165fc4a 100644 --- a/doc/currentuser/emails.md +++ b/doc/currentuser/emails.md @@ -1,7 +1,7 @@ ## Current user / Emails API [Back to the navigation](../README.md) -Wraps [GitHub User Emails API](https://developer.github.com/v3/users/emails/#emails). +Wraps [GitHub User Emails API](https://docs.github.com/rest/users/emails). > Requires [authentication](../security.md). diff --git a/doc/currentuser/memberships.md b/doc/currentuser/memberships.md index 53ee81eb96e..9726db9ecb4 100644 --- a/doc/currentuser/memberships.md +++ b/doc/currentuser/memberships.md @@ -1,7 +1,7 @@ ## Current user / Memberships API [Back to the navigation](../README.md) -Wraps [GitHub Issue Comments API](https://developer.github.com/v3/orgs/members/#get-your-organization-membership). +Wraps [GitHub Organization Memberships API](https://docs.github.com/rest/orgs/members). ### List your memberships diff --git a/doc/currentuser/publickeys.md b/doc/currentuser/publickeys.md index 444dd58fa0c..487c993b5b2 100644 --- a/doc/currentuser/publickeys.md +++ b/doc/currentuser/publickeys.md @@ -1,7 +1,7 @@ ## Current user / Public Keys API [Back to the navigation](../README.md) -Wraps [GitHub User Public Keys API](https://developer.github.com/v3/users/keys/#public-keys). +Wraps [GitHub User Public Keys API](https://docs.github.com/rest/users/keys). ### List your public keys diff --git a/doc/currentuser/repositories.md b/doc/currentuser/repositories.md index 9b5e1d85e94..dd4a7ef4325 100644 --- a/doc/currentuser/repositories.md +++ b/doc/currentuser/repositories.md @@ -19,7 +19,7 @@ There are three values that can be passed into the `repositories` method: `type` | sort | `full_name` | `created`, `updated`, `pushed`, `full_name` | direction | `asc` | `asc`, `desc` -> See https://developer.github.com/v3/repos/#list-your-repositories for possible values and additional information +> See https://docs.github.com/rest/repos/repos#list-repositories-for-the-authenticated-user for possible values and additional information #### Code Example: diff --git a/doc/enterprise.md b/doc/enterprise.md index 5245fe7c3d8..c3c10ab52ef 100644 --- a/doc/enterprise.md +++ b/doc/enterprise.md @@ -1,7 +1,7 @@ ## Enterprise API [Back to the navigation](README.md) -Provides information about a GitHub Enterprise installation. Wraps [GitHub Enterprise API](http://developer.github.com/v3/enterprise/). +Provides information about a GitHub Enterprise installation. Wraps [GitHub Enterprise API](https://docs.github.com/rest/enterprise-admin). ### Configuration In order to configure the client to point to a GitHub Enterprise installation, do the following: diff --git a/doc/enterprise/secret-scanning.md b/doc/enterprise/secret-scanning.md index ad7626c4709..245b6baa5cc 100644 --- a/doc/enterprise/secret-scanning.md +++ b/doc/enterprise/secret-scanning.md @@ -3,7 +3,7 @@ # List secret-scanning alerts for an Enterprise -https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-secret-scanning-alerts-for-an-enterprise +https://docs.github.com/enterprise-cloud@latest/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-enterprise ```php $alerts = $client->api('enterprise')->secretScanning()->alerts('KnpLabs'); diff --git a/doc/gists.md b/doc/gists.md index 7db9f2c6cd5..159ccda740c 100644 --- a/doc/gists.md +++ b/doc/gists.md @@ -2,7 +2,7 @@ [Back to the navigation](README.md) Creating, editing, deleting and listing gists. -Wraps [GitHub Gists API](http://developer.github.com/v3/gists/). +Wraps [GitHub Gists API](https://docs.github.com/rest/gists/gists). Additional APIs: * [Comments](gists/comments.md) diff --git a/doc/gists/comments.md b/doc/gists/comments.md index 2df9966537a..411af813079 100644 --- a/doc/gists/comments.md +++ b/doc/gists/comments.md @@ -2,7 +2,7 @@ [Back to the "Gists API"](../gists.md) | [Back to the navigation](../README.md) -Wraps [GitHub Issue Comments API](http://developer.github.com/v3/gists/comments/). +Wraps [GitHub Gist Comments API](https://docs.github.com/rest/gists/comments). ### List a gist comments diff --git a/doc/gitdata/blobs.md b/doc/gitdata/blobs.md index 78a79ac0810..7d19b7c05a4 100644 --- a/doc/gitdata/blobs.md +++ b/doc/gitdata/blobs.md @@ -1,6 +1,8 @@ ## Blobs API [Back to the navigation](../README.md) +Wraps [GitHub Git Blobs API](https://docs.github.com/rest/git/blobs). + ### Show a blob ```php diff --git a/doc/gitdata/commits.md b/doc/gitdata/commits.md index 07584e49929..110e96af13b 100644 --- a/doc/gitdata/commits.md +++ b/doc/gitdata/commits.md @@ -1,6 +1,8 @@ ## Commits API [Back to the navigation](../README.md) +Wraps [GitHub Git Commits API](https://docs.github.com/rest/git/commits). + ### Show a commit ```php diff --git a/doc/gitdata/references.md b/doc/gitdata/references.md index 8cc2b971e7e..1bd15ea3aa3 100644 --- a/doc/gitdata/references.md +++ b/doc/gitdata/references.md @@ -1,6 +1,7 @@ ## References API [Back to the navigation](../README.md) +Wraps [GitHub Git References API](https://docs.github.com/rest/git/refs). ### List all references ```php diff --git a/doc/gitdata/tags.md b/doc/gitdata/tags.md index 36b323e5c74..9ece7375d99 100644 --- a/doc/gitdata/tags.md +++ b/doc/gitdata/tags.md @@ -1,6 +1,8 @@ ## Tags API [Back to the navigation](../README.md) +Wraps [GitHub Git Tags API](https://docs.github.com/rest/git/tags). + ### Show all tags ```php diff --git a/doc/gitdata/trees.md b/doc/gitdata/trees.md index dcdd0b49c08..906c5fe1bc0 100644 --- a/doc/gitdata/trees.md +++ b/doc/gitdata/trees.md @@ -1,6 +1,8 @@ ## Trees API [Back to the navigation](../README.md) +Wraps [GitHub Git Trees API](https://docs.github.com/rest/git/trees). + ### Show a tree ```php diff --git a/doc/graphql.md b/doc/graphql.md index dfe83639085..1611a68ca9c 100644 --- a/doc/graphql.md +++ b/doc/graphql.md @@ -1,7 +1,7 @@ ## GraphQL API [Back to the navigation](README.md) -Wraps [GitHub v4 API (GraphQL API)](http://developer.github.com/v4/). +Wraps [GitHub GraphQL API](https://docs.github.com/graphql). #### Execute a query @@ -11,7 +11,7 @@ $rateLimits = $client->api('graphql')->execute($query); #### Authentication -To use [GitHub v4 API (GraphQL API)](http://developer.github.com/v4/) requests must [authenticate](security.md). +To use [GitHub GraphQL API](https://docs.github.com/graphql) requests must [authenticate](security.md). ```php $client->authenticate($token, null, Github\AuthMethod::ACCESS_TOKEN); @@ -21,9 +21,9 @@ $result = $client->api('graphql')->execute($query); #### Use different `Accept` Headers You can preview upcoming features and changes to the GitHub GraphQL schema before they are added to the GitHub GraphQL API. -To access a schema preview, you'll need to provide a custom media type in the Accept header for your requests. Feature documentation for each preview specifies which custom media type to provide. More info about [Schema Previews](https://docs.github.com/en/graphql/overview/schema-previews). +To access a schema preview, you'll need to provide a custom media type in the Accept header for your requests. Feature documentation for each preview specifies which custom media type to provide. More info about [Schema Previews](https://docs.github.com/graphql/overview/schema-previews). -To use [GitHub v4 API (GraphQL API)](http://developer.github.com/v4/) with different `Accept` header you can pass third argument to execute method. +To use [GitHub GraphQL API](https://docs.github.com/graphql) with different `Accept` header you can pass third argument to execute method. ```php $result = $client->api('graphql')->execute($query, [], 'application/vnd.github.starfox-preview+json') @@ -34,7 +34,7 @@ $result = $client->api('graphql')->execute($query, [], 'application/vnd.github.s #### Use variables -[Variables](https://developer.github.com/v4/guides/forming-calls/#working-with-variables) allow specifying of requested data without dynamical change of a query on a client side. +[Variables](https://docs.github.com/graphql/guides/forming-calls-with-graphql#working-with-variables) allow specifying of requested data without dynamical change of a query on a client side. ```php $query = <<<'QUERY' diff --git a/doc/issue/assignees.md b/doc/issue/assignees.md index 58071d74f97..f46ae464dd9 100644 --- a/doc/issue/assignees.md +++ b/doc/issue/assignees.md @@ -1,7 +1,7 @@ ## Issues / Assignees API [Back to the "Issues API"](../issues.md) | [Back to the navigation](../README.md) -Wraps [GitHub Issue Assignees API](https://developer.github.com/v3/issues/assignees/). +Wraps [GitHub Issue Assignees API](https://docs.github.com/rest/issues/assignees). ### List all available assignees diff --git a/doc/issue/comments.md b/doc/issue/comments.md index ac0f8a619ea..9571b5a3b0b 100644 --- a/doc/issue/comments.md +++ b/doc/issue/comments.md @@ -1,7 +1,7 @@ ## Issues / Comments API [Back to the "Issues API"](../issues.md) | [Back to the navigation](../README.md) -Wraps [GitHub Issue Comments API](http://developer.github.com/v3/issues/comments/). +Wraps [GitHub Issue Comments API](https://docs.github.com/rest/issues/comments). ### List an issue comments diff --git a/doc/issue/labels.md b/doc/issue/labels.md index 4a9964f4402..dc21b10ad97 100644 --- a/doc/issue/labels.md +++ b/doc/issue/labels.md @@ -1,7 +1,7 @@ ## Issues / Labels API [Back to the "Issues API"](../issues.md) | [Back to the navigation](../README.md) -Wraps [GitHub Issue Labels API](http://developer.github.com/v3/issues/labels/). +Wraps [GitHub Issue Labels API](https://docs.github.com/rest/issues/labels). ### List project labels diff --git a/doc/issue/milestones.md b/doc/issue/milestones.md index e376d221fa6..16ec57423f6 100644 --- a/doc/issue/milestones.md +++ b/doc/issue/milestones.md @@ -1,7 +1,7 @@ ## Issues / Milestones API [Back to the "Issues API"](../issues.md) | [Back to the navigation](../README.md) -Wraps [GitHub Issue Milestones API](http://developer.github.com/v3/issues/milestones/). +Wraps [GitHub Issue Milestones API](https://docs.github.com/rest/issues/milestones). ### List milestones for a repository diff --git a/doc/issue/timeline.md b/doc/issue/timeline.md index 5b0760f92ee..adacd3afce3 100644 --- a/doc/issue/timeline.md +++ b/doc/issue/timeline.md @@ -1,7 +1,7 @@ ## Issues / Timeline API [Back to the "Issues API"](../issues.md) | [Back to the navigation](../README.md) -Wraps [GitHub Issue Timeline API](http://developer.github.com/v3/issues/timeline/). +Wraps [GitHub Issue Timeline API](https://docs.github.com/rest/issues/timeline). This api is currently only available to developers in Early Access. To access the API during the Early Access period, you must provide a custom media type in the Accept header. diff --git a/doc/issues.md b/doc/issues.md index 317f4babebe..d385568c7d9 100644 --- a/doc/issues.md +++ b/doc/issues.md @@ -2,7 +2,7 @@ [Back to the navigation](README.md) Listing issues, searching, editing and closing your projects issues. -Wraps [GitHub Issue API](http://developer.github.com/v3/issues/). +Wraps [GitHub Issue API](https://docs.github.com/rest/issues/issues). Additional APIs: * [Comments](issue/comments.md) diff --git a/doc/meta.md b/doc/meta.md index fb3d579f1d9..befb3f013b1 100644 --- a/doc/meta.md +++ b/doc/meta.md @@ -2,7 +2,7 @@ [Back to the navigation](README.md) -Wrap [GitHub Meta API](http://developer.github.com/v3/meta/). +Wrap [GitHub Meta API](https://docs.github.com/rest/meta/meta). ### Get information about GitHub services diff --git a/doc/miscellaneous/codeofconduct.md b/doc/miscellaneous/codeofconduct.md index c47b3c49774..fadfd5f31e7 100644 --- a/doc/miscellaneous/codeofconduct.md +++ b/doc/miscellaneous/codeofconduct.md @@ -1,6 +1,8 @@ ## CodeOfConduct API [Back to the navigation](../README.md) +Wraps [GitHub Codes of conduct API](https://docs.github.com/rest/codes-of-conduct/codes-of-conduct). + ### Lists all code of conducts. ```php diff --git a/doc/miscellaneous/emojis.md b/doc/miscellaneous/emojis.md index 0ba2045596e..0d914ac4799 100644 --- a/doc/miscellaneous/emojis.md +++ b/doc/miscellaneous/emojis.md @@ -1,6 +1,8 @@ ## Emojis API [Back to the navigation](../README.md) +Wraps [GitHub Emojis API](https://docs.github.com/rest/emojis/emojis). + ### Lists all available emojis on GitHub. ```php diff --git a/doc/miscellaneous/gitignore.md b/doc/miscellaneous/gitignore.md index 181424f34ad..90848e44bd4 100644 --- a/doc/miscellaneous/gitignore.md +++ b/doc/miscellaneous/gitignore.md @@ -1,6 +1,8 @@ ## Gitignore API [Back to the navigation](../README.md) +Wraps [GitHub Gitignore API](https://docs.github.com/rest/gitignore/gitignore). + ### Lists all available gitignore templates ```php diff --git a/doc/miscellaneous/licenses.md b/doc/miscellaneous/licenses.md index c533f7ffda0..f3addb6badc 100644 --- a/doc/miscellaneous/licenses.md +++ b/doc/miscellaneous/licenses.md @@ -1,6 +1,8 @@ ## Licenses API [Back to the navigation](../README.md) +Wraps [GitHub Licenses API](https://docs.github.com/rest/licenses/licenses). + ### Lists all licenses. ```php diff --git a/doc/miscellaneous/markdown.md b/doc/miscellaneous/markdown.md index 4f9ffecc179..ea997b7d312 100644 --- a/doc/miscellaneous/markdown.md +++ b/doc/miscellaneous/markdown.md @@ -1,6 +1,8 @@ ## Markdown API [Back to the navigation](../README.md) +Wraps [GitHub Markdown API](https://docs.github.com/rest/markdown/markdown). + ### Render an arbitrary Markdown document ```php diff --git a/doc/notification.md b/doc/notification.md index ad022cad835..cacdfe0c6d4 100644 --- a/doc/notification.md +++ b/doc/notification.md @@ -2,7 +2,7 @@ [Back to the navigation](README.md) Listing notifications and marking them as read. -Wraps [GitHub Notification API](https://developer.github.com/v3/activity/notifications/). +Wraps [GitHub Notification API](https://docs.github.com/rest/activity/notifications). ### List notifications diff --git a/doc/organization.md b/doc/organization.md index e44c436dff3..81ced9598a2 100644 --- a/doc/organization.md +++ b/doc/organization.md @@ -1,14 +1,14 @@ ## Organization API [Back to the navigation](README.md) -Wraps [GitHub Organization API](http://developer.github.com/v3/orgs/). +Wraps [GitHub Organization API](https://docs.github.com/rest/orgs/orgs). Additional APIs: * [Members API](organization/members.md) * [Teams API](organization/teams.md) ### List issues in an organization -[GitHub Issues API](https://developer.github.com/v3/issues/). +[GitHub Issues API](https://docs.github.com/rest/issues/issues#list-organization-issues-assigned-to-the-authenticated-user). ```php $issues = $client->api('organizations')->issues('KnpLabs', 'php-github-api', array('state' => 'open')); diff --git a/doc/organization/actions/secrets.md b/doc/organization/actions/secrets.md index 04b10877fa2..9f5c922d653 100644 --- a/doc/organization/actions/secrets.md +++ b/doc/organization/actions/secrets.md @@ -3,7 +3,7 @@ ### List organization secrets -https://docs.github.com/en/rest/reference/actions#list-organization-secrets +https://docs.github.com/rest/actions/secrets#list-organization-secrets ```php $secrets = $client->organization()->secrets()->all('KnpLabs'); @@ -11,7 +11,7 @@ $secrets = $client->organization()->secrets()->all('KnpLabs'); ### Get an organization secret -https://docs.github.com/en/rest/reference/actions#get-an-organization-secret +https://docs.github.com/rest/actions/secrets#get-an-organization-secret ```php $secret = $client->organization()->secrets()->show('KnpLabs', $secretName); @@ -19,7 +19,7 @@ $secret = $client->organization()->secrets()->show('KnpLabs', $secretName); ### Create an organization secret -https://docs.github.com/en/rest/reference/actions#create-or-update-an-organization-secret +https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret ```php $client->organization()->secrets()->create('KnpLabs', $secretName, [ @@ -31,7 +31,7 @@ $client->organization()->secrets()->create('KnpLabs', $secretName, [ ### Update an organization secret -https://docs.github.com/en/rest/reference/actions#create-or-update-an-organization-secret +https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret ```php $client->organization()->secrets()->update('KnpLabs', $secretName, [ @@ -43,7 +43,7 @@ $client->organization()->secrets()->update('KnpLabs', $secretName, [ ### Delete an organization secret -https://docs.github.com/en/rest/reference/actions#delete-an-organization-secret +https://docs.github.com/rest/actions/secrets#delete-an-organization-secret ```php $client->organization()->secrets()->remove('KnpLabs', $secretName); @@ -51,7 +51,7 @@ $client->organization()->secrets()->remove('KnpLabs', $secretName); ### List selected repositories for organization secret -https://docs.github.com/en/rest/reference/actions#list-selected-repositories-for-an-organization-secret +https://docs.github.com/rest/actions/secrets#list-selected-repositories-for-an-organization-secret ```php $client->organization()->secrets()->selectedRepositories('KnpLabs', $secretName); @@ -59,7 +59,7 @@ $client->organization()->secrets()->selectedRepositories('KnpLabs', $secretName) ### Set selected repositories for an organization secret -https://docs.github.com/en/rest/reference/actions#set-selected-repositories-for-an-organization-secret +https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret ```php $client->organization()->secrets()->setSelectedRepositories('KnpLabs', 'secretName', [ @@ -69,7 +69,7 @@ $client->organization()->secrets()->setSelectedRepositories('KnpLabs', 'secretNa ### Remove selected repository from an organization secret -https://docs.github.com/en/rest/reference/actions#remove-selected-repository-from-an-organization-secret +https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret ```php $client->organization()->secrets()->addSecret('KnpLabs', $repositoryId, $secretName); @@ -77,7 +77,7 @@ $client->organization()->secrets()->addSecret('KnpLabs', $repositoryId, $secretN ### Get an organization public key -https://docs.github.com/en/rest/reference/actions#get-an-organization-public-key +https://docs.github.com/rest/actions/secrets#get-an-organization-public-key ```php $client->organization()->secrets()->publicKey('KnpLabs'); diff --git a/doc/organization/actions/self_hosted_runners.md b/doc/organization/actions/self_hosted_runners.md index f6e915cdce5..473697bcbe9 100644 --- a/doc/organization/actions/self_hosted_runners.md +++ b/doc/organization/actions/self_hosted_runners.md @@ -3,7 +3,7 @@ # List self-hosted runners for an Organization -https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-an-organization +https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization ```php $runners = $client->api('organization')->runners()->all('KnpLabs'); @@ -11,7 +11,7 @@ $runners = $client->api('organization')->runners()->all('KnpLabs'); # Get a self-hosted runner for an Organization - https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#get-a-self-hosted-runner-for-an-organization + https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-organization ```php $runner = $client->api('organization')->runners()->show('KnpLabs', $runnerId); @@ -19,7 +19,7 @@ $runner = $client->api('organization')->runners()->show('KnpLabs', $runnerId); # Delete a self-hosted runner from an Organization -https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-organization +https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-organization ```php $client->api('organization')->runners()->remove('KnpLabs', $runnerId); @@ -27,7 +27,7 @@ $client->api('organization')->runners()->remove('KnpLabs', $runnerId); # List runner applications for an Organization -https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-organization +https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization ```php $applications = $client->api('organization')->selfHostedRunners()->applications('KnpLabs'); diff --git a/doc/organization/actions/variables.md b/doc/organization/actions/variables.md index 89c641007f3..9434264a60b 100644 --- a/doc/organization/actions/variables.md +++ b/doc/organization/actions/variables.md @@ -3,7 +3,7 @@ ### List organization variables -https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#list-organization-variables +https://docs.github.com/rest/actions/variables#list-organization-variables ```php $variables = $client->organization()->variables()->all('KnpLabs'); @@ -11,7 +11,7 @@ $variables = $client->organization()->variables()->all('KnpLabs'); ### Get an organization variable -https://docs.github.com/en/rest/reference/actions#get-an-organization-secret +https://docs.github.com/rest/actions/variables#get-an-organization-variable ```php $variable = $client->organization()->variables()->show('KnpLabs', $variableName); @@ -19,7 +19,7 @@ $variable = $client->organization()->variables()->show('KnpLabs', $variableName) ### Create an organization variable -https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#create-an-organization-variable +https://docs.github.com/rest/actions/variables#create-an-organization-variable ```php $client->organization()->variables()->create('KnpLabs', [ @@ -32,7 +32,7 @@ $client->organization()->variables()->create('KnpLabs', [ ### Update an organization variable -https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#update-an-organization-variable +https://docs.github.com/rest/actions/variables#update-an-organization-variable ```php $client->organization()->variables()->update('KnpLabs', $variableName, [ @@ -45,7 +45,7 @@ $client->organization()->variables()->update('KnpLabs', $variableName, [ ### Delete an organization variable -https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#delete-an-organization-variable +https://docs.github.com/rest/actions/variables#delete-an-organization-variable ```php $client->organization()->variables()->remove('KnpLabs', $variableName); @@ -53,7 +53,7 @@ $client->organization()->variables()->remove('KnpLabs', $variableName); ### List selected repositories for organization variable -https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#list-selected-repositories-for-an-organization-variable +https://docs.github.com/rest/actions/variables#list-selected-repositories-for-an-organization-variable ```php $client->organization()->variables()->selectedRepositories('KnpLabs', $variableName); @@ -61,7 +61,7 @@ $client->organization()->variables()->selectedRepositories('KnpLabs', $variableN ### Set selected repositories for an organization variable -https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#set-selected-repositories-for-an-organization-variable +https://docs.github.com/rest/actions/variables#set-selected-repositories-for-an-organization-variable ```php $client->organization()->variables()->setSelectedRepositories('KnpLabs', 'variableName', [ @@ -71,7 +71,7 @@ $client->organization()->variables()->setSelectedRepositories('KnpLabs', 'variab ### Add selected repository to an organization variable -https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#add-selected-repository-to-an-organization-variable +https://docs.github.com/rest/actions/variables#add-selected-repository-to-an-organization-variable ```php $client->organization()->variables()->addRepository('KnpLabs', $repositoryId, $variableName); @@ -79,7 +79,7 @@ $client->organization()->variables()->addRepository('KnpLabs', $repositoryId, $v ### Remove selected repository from an organization variable -https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#remove-selected-repository-from-an-organization-variable +https://docs.github.com/rest/actions/variables#remove-selected-repository-from-an-organization-variable ```php $client->organization()->variables()->removeRepository('KnpLabs', $repositoryId, $variableName); diff --git a/doc/organization/members.md b/doc/organization/members.md index b22b79c6008..6058d25e884 100644 --- a/doc/organization/members.md +++ b/doc/organization/members.md @@ -1,6 +1,6 @@ ## Organization / Members API [Back to the "Organization API"](../organization.md) | [Back to the navigation](../README.md) -Wraps [GitHub Organization Members API](http://developer.github.com/v3/organization/members/). +Wraps [GitHub Organization Members API](https://docs.github.com/rest/orgs/members). To be written... diff --git a/doc/organization/organization-roles.md b/doc/organization/organization-roles.md index a320b6eb047..fee3eeda8dd 100644 --- a/doc/organization/organization-roles.md +++ b/doc/organization/organization-roles.md @@ -2,7 +2,7 @@ [Back to the navigation](../README.md) Listing, showing, assigning, and removing orgniazationroles. -Wraps [GitHub Organization Roles API](https://docs.github.com/en/rest/orgs/organization-roles). +Wraps [GitHub Organization Roles API](https://docs.github.com/rest/orgs/organization-roles). Additional APIs: * [Organization](../doc/organization) diff --git a/doc/organization/secret-scanning.md b/doc/organization/secret-scanning.md index 9ee5d4d972d..a200447b5cd 100644 --- a/doc/organization/secret-scanning.md +++ b/doc/organization/secret-scanning.md @@ -3,7 +3,7 @@ # List secret-scanning alerts for an Organization -https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-secret-scanning-alerts-for-an-organization +https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-organization ```php $alerts = $client->api('organization')->secretScanning()->alerts('KnpLabs'); diff --git a/doc/organization/teams.md b/doc/organization/teams.md index 7fc1c8b1075..50db12205b8 100644 --- a/doc/organization/teams.md +++ b/doc/organization/teams.md @@ -1,6 +1,6 @@ ## Organization / Teams API [Back to the "Organization API"](../organization.md) | [Back to the navigation](../README.md) -Wraps [GitHub Organization Teams API](http://developer.github.com/v3/organization/teams/). +Wraps [GitHub Organization Teams API](https://docs.github.com/rest/teams/teams). To be written... diff --git a/doc/organization/webhooks.md b/doc/organization/webhooks.md index 669e3446125..642059a7ad2 100644 --- a/doc/organization/webhooks.md +++ b/doc/organization/webhooks.md @@ -2,7 +2,7 @@ [Back to the navigation](../README.md) Listing, showing, creating, updating, testing and removing organizations webhooks. -Wraps [GitHub Organization Webhooks API](https://developer.github.com/v3/orgs/hooks/). +Wraps [GitHub Organization Webhooks API](https://docs.github.com/rest/orgs/webhooks). Additional APIs: * [Organization](../doc/organization) diff --git a/doc/project/cards.md b/doc/project/cards.md index b66707e6779..a6671ad7f59 100644 --- a/doc/project/cards.md +++ b/doc/project/cards.md @@ -1,6 +1,8 @@ ## Repo / Cards API [Back to the "Repos API"](../repos.md) | [Back to the navigation](../README.md) +> **Deprecated**: GitHub Projects (classic) was sunset on 2024-08-23 and this REST API is no longer part of the current documentation on docs.github.com. + This api is currently only available to developers in Early Access. To access the API during the Early Access period, you must provide a custom media type in the Accept header. diff --git a/doc/project/columns.md b/doc/project/columns.md index 2f4a990942d..4f6dbd3a3c3 100644 --- a/doc/project/columns.md +++ b/doc/project/columns.md @@ -1,6 +1,8 @@ ## Repo / Columns API [Back to the "Repos API"](../repos.md) | [Back to the navigation](../README.md) +> **Deprecated**: GitHub Projects (classic) was sunset on 2024-08-23 and this REST API is no longer part of the current documentation on docs.github.com. + This api is currently only available to developers in Early Access. To access the API during the Early Access period, you must provide a custom media type in the Accept header. diff --git a/doc/project/projects.md b/doc/project/projects.md index 103bbe10c86..5cba2272aff 100644 --- a/doc/project/projects.md +++ b/doc/project/projects.md @@ -1,6 +1,8 @@ ## Repo / Projects API [Back to the "Repos API"](../) | [Back to the navigation](../README.md) +> **Deprecated**: GitHub Projects (classic) was sunset on 2024-08-23 and this REST API is no longer part of the current documentation on docs.github.com. + This api is currently only available to developers in Early Access. To access the API during the Early Access period, you must provide a custom media type in the Accept header. diff --git a/doc/pull_request/comments.md b/doc/pull_request/comments.md index e996f804989..06061865952 100644 --- a/doc/pull_request/comments.md +++ b/doc/pull_request/comments.md @@ -5,7 +5,7 @@ Review Comments are comments on a portion of the unified diff. These are separat are applied directly to a commit, outside of the Pull Request view), and Issue Comments (which do not reference a portion of the unified diff). -Wraps [GitHub PR Review Comments API](http://developer.github.com/v3/pulls/comments/). +Wraps [GitHub PR Review Comments API](https://docs.github.com/rest/pulls/comments). > **Note:** > New comments are assigned to the [authenticated](../security.md) user. diff --git a/doc/pull_request/review_request.md b/doc/pull_request/review_request.md index bed33a426c2..742bdaf16c1 100644 --- a/doc/pull_request/review_request.md +++ b/doc/pull_request/review_request.md @@ -1,6 +1,8 @@ ## Pull Requests / Review Requests API [Back to the "Pull Requests API"](../pull_requests.md) | [Back to the navigation](../README.md) +Wraps [GitHub Pull Request Review Requests API](https://docs.github.com/rest/pulls/review-requests). + ### List all review requests ```php diff --git a/doc/pull_request/reviews.md b/doc/pull_request/reviews.md index fdc5f09442e..d7443679504 100644 --- a/doc/pull_request/reviews.md +++ b/doc/pull_request/reviews.md @@ -1,6 +1,8 @@ ## Pull Requests / Reviews API [Back to the "Pull Requests API"](../pull_requests.md) | [Back to the navigation](../README.md) +Wraps [GitHub Pull Request Reviews API](https://docs.github.com/rest/pulls/reviews). + ### List all reviews ```php @@ -11,7 +13,7 @@ $reviewRequests = $client->api('pull_request')->reviews()->all('twbs', 'bootstra ```php $client->api('pull_request')->reviews()->create('twbs', 'bootstrap', 12, array( - 'event' => 'APPROVE', // Accepted values: APPROVE, REQUEST_CHANGES, COMMENT, see https://developer.github.com/v3/pulls/reviews/#input-1 + 'event' => 'APPROVE', // Accepted values: APPROVE, REQUEST_CHANGES, COMMENT, see https://docs.github.com/rest/pulls/reviews#create-a-review-for-a-pull-request 'body' => 'OK, looks good :)',// Optional, the review body text 'commit_id' => $commitSha, // Optional, default value is HEAD sha )); diff --git a/doc/pull_requests.md b/doc/pull_requests.md index d87e6180043..ba56ced83d0 100644 --- a/doc/pull_requests.md +++ b/doc/pull_requests.md @@ -8,7 +8,7 @@ Additional APIs: Lets you list pull requests for a given repository, list one pull request in particular along with its discussion, and create a pull-request. -Wraps [GitHub Pull Request API](http://developer.github.com/v3/pulls/). +Wraps [GitHub Pull Request API](https://docs.github.com/rest/pulls/pulls). ### List all pull requests, per repository diff --git a/doc/rate_limits.md b/doc/rate_limits.md index 454981d0b4f..72386c63e79 100644 --- a/doc/rate_limits.md +++ b/doc/rate_limits.md @@ -1,7 +1,7 @@ ## Rate Limit API [Back to the navigation](README.md) -Get rate limit wrappers from [GitHub Rate Limit API](http://developer.github.com/v3/rate_limit/). +Get rate limit wrappers from [GitHub Rate Limit API](https://docs.github.com/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user). #### Get All Rate Limits diff --git a/doc/repo/actions/artifacts.md b/doc/repo/actions/artifacts.md index 58d68ff66e8..1b521972ea3 100644 --- a/doc/repo/actions/artifacts.md +++ b/doc/repo/actions/artifacts.md @@ -3,7 +3,7 @@ ### List artifacts for a repository -https://docs.github.com/en/rest/reference/actions#list-artifacts-for-a-repository +https://docs.github.com/rest/actions/artifacts#list-artifacts-for-a-repository ```php $artifacts = $client->api('repo')->artifacts()->all('KnpLabs'); @@ -11,7 +11,7 @@ $artifacts = $client->api('repo')->artifacts()->all('KnpLabs'); ### List workflow run artifacts -https://docs.github.com/en/rest/reference/actions#list-workflow-run-artifacts +https://docs.github.com/rest/actions/artifacts#list-workflow-run-artifacts ```php $runArtifacts = $client->api('repo')->artifacts()->runArtifacts('KnpLabs', 'php-github-api', $runId); @@ -19,7 +19,7 @@ $runArtifacts = $client->api('repo')->artifacts()->runArtifacts('KnpLabs', 'php- ### Get an artifact -https://docs.github.com/en/rest/reference/actions#get-an-artifact +https://docs.github.com/rest/actions/artifacts#get-an-artifact ```php $artifact = $client->api('repo')->artifacts()->show('KnpLabs', 'php-github-api', $artifactId); @@ -27,7 +27,7 @@ $artifact = $client->api('repo')->artifacts()->show('KnpLabs', 'php-github-api', ### Delete an artifact -https://docs.github.com/en/rest/reference/actions#delete-an-artifact +https://docs.github.com/rest/actions/artifacts#delete-an-artifact ```php $client->api('repo')->artifacts()->delete('KnpLabs', 'php-github-api', $artifactId); @@ -36,7 +36,7 @@ $client->api('repo')->artifacts()->delete('KnpLabs', 'php-github-api', $artifact ### Download an artifact -https://docs.github.com/en/rest/reference/actions#download-an-artifact +https://docs.github.com/rest/actions/artifacts#download-an-artifact ```php $artifactFile = $client->api('repo')->artifacts()->download('KnpLabs', 'php-github-api', $artifactId, $format = 'zip'); diff --git a/doc/repo/actions/secrets.md b/doc/repo/actions/secrets.md index d4769639d37..07cc1d2825a 100644 --- a/doc/repo/actions/secrets.md +++ b/doc/repo/actions/secrets.md @@ -3,7 +3,7 @@ ### List repository secrets -https://docs.github.com/en/rest/reference/actions#list-repository-secrets +https://docs.github.com/rest/actions/secrets#list-repository-secrets ```php $secrets = $client->api('repo')->secrets()->all('KnpLabs', 'php-github-api'); @@ -11,7 +11,7 @@ $secrets = $client->api('repo')->secrets()->all('KnpLabs', 'php-github-api'); ### Get a repository secret -https://docs.github.com/en/rest/reference/actions#get-a-repository-secret +https://docs.github.com/rest/actions/secrets#get-a-repository-secret ```php $secret = $client->api('repo')->secrets()->show('KnpLabs', 'php-github-api', $secretName); @@ -19,7 +19,7 @@ $secret = $client->api('repo')->secrets()->show('KnpLabs', 'php-github-api', $se ### Create a repository secret -https://docs.github.com/en/rest/reference/actions#create-or-update-a-repository-secret +https://docs.github.com/rest/actions/secrets#create-or-update-a-repository-secret ```php $client->api('repo')->secrets()->create('KnpLabs', 'php-github-api', $secretName, [ @@ -29,7 +29,7 @@ $client->api('repo')->secrets()->create('KnpLabs', 'php-github-api', $secretName ### Update a repository secret -https://docs.github.com/en/rest/reference/actions#create-or-update-a-repository-secret +https://docs.github.com/rest/actions/secrets#create-or-update-a-repository-secret ```php $client->api('repo')->secrets()->update('KnpLabs', 'php-github-api', $secretName, [ @@ -39,7 +39,7 @@ $client->api('repo')->secrets()->update('KnpLabs', 'php-github-api', $secretName ### Delete a repository secret -https://docs.github.com/en/rest/reference/actions#delete-a-repository-secret +https://docs.github.com/rest/actions/secrets#delete-a-repository-secret ```php $client->api('repo')->secrets()->remove('KnpLabs', 'php-github-api', $secretName); @@ -47,7 +47,7 @@ $client->api('repo')->secrets()->remove('KnpLabs', 'php-github-api', $secretName ### Get a repository public key -https://docs.github.com/en/rest/reference/actions#get-a-repository-public-key +https://docs.github.com/rest/actions/secrets#get-a-repository-public-key ```php $publicKey = $client->api('repo')->secrets()->publicKey('KnpLabs', 'php-github-api'); diff --git a/doc/repo/actions/self_hosted_runners.md b/doc/repo/actions/self_hosted_runners.md index 55a1ed0e420..7693d9c833f 100644 --- a/doc/repo/actions/self_hosted_runners.md +++ b/doc/repo/actions/self_hosted_runners.md @@ -3,7 +3,7 @@ # List self-hosted runners for a repository -https://docs.github.com/en/rest/reference/actions#list-self-hosted-runners-for-a-repository +https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository ```php $runners = $client->api('repo')->selfHostedRunners()->all('KnpLabs', 'php-github-api'); @@ -11,7 +11,7 @@ $runners = $client->api('repo')->selfHostedRunners()->all('KnpLabs', 'php-github # Get a self-hosted runner for a repository -https://docs.github.com/en/rest/reference/actions#get-a-self-hosted-runner-for-a-repository +https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-a-repository ```php $runner = $client->api('repo')->selfHostedRunners()->show('KnpLabs', 'php-github-api', $runnerId); @@ -19,7 +19,7 @@ $runner = $client->api('repo')->selfHostedRunners()->show('KnpLabs', 'php-github # Delete a self-hosted runner from a repository -https://docs.github.com/en/rest/reference/actions#delete-a-self-hosted-runner-from-a-repository +https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-a-repository ```php $client->api('repo')->selfHostedRunners()->remove('KnpLabs', 'php-github-api', $runnerId); @@ -27,7 +27,7 @@ $client->api('repo')->selfHostedRunners()->remove('KnpLabs', 'php-github-api', $ # List runner applications for a repository -https://docs.github.com/en/rest/reference/actions#list-runner-applications-for-a-repository +https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-a-repository ```php $applications = $client->api('repo')->selfHostedRunners()->applications('KnpLabs', 'php-github-api'); diff --git a/doc/repo/actions/variables.md b/doc/repo/actions/variables.md index c6cc26ac1df..4fc9e0672c4 100644 --- a/doc/repo/actions/variables.md +++ b/doc/repo/actions/variables.md @@ -3,7 +3,7 @@ ### List repository variables -https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#list-repository-variables +https://docs.github.com/rest/actions/variables#list-repository-variables ```php $variables = $client->api('repo')->variables()->all('KnpLabs', 'php-github-api'); @@ -11,7 +11,7 @@ $variables = $client->api('repo')->variables()->all('KnpLabs', 'php-github-api') ### Get a repository variable -https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#get-a-repository-variable +https://docs.github.com/rest/actions/variables#get-a-repository-variable ```php $variable = $client->api('repo')->variables()->show('KnpLabs', 'php-github-api', $variableName); @@ -19,7 +19,7 @@ $variable = $client->api('repo')->variables()->show('KnpLabs', 'php-github-api', ### Create a repository variable -https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#create-a-repository-variable +https://docs.github.com/rest/actions/variables#create-a-repository-variable ```php $client->api('repo')->variables()->create('KnpLabs', 'php-github-api', [ @@ -30,7 +30,7 @@ $client->api('repo')->variables()->create('KnpLabs', 'php-github-api', [ ### Update a repository variable -https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#update-a-repository-variable +https://docs.github.com/rest/actions/variables#update-a-repository-variable ```php $client->api('repo')->variables()->update('KnpLabs', 'php-github-api', $variableName, [ @@ -41,7 +41,7 @@ $client->api('repo')->variables()->update('KnpLabs', 'php-github-api', $variable ### Delete a repository variable -https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#delete-a-repository-variable +https://docs.github.com/rest/actions/variables#delete-a-repository-variable ```php $client->api('repo')->variables()->remove('KnpLabs', 'php-github-api', $variableName); diff --git a/doc/repo/actions/workflow_jobs.md b/doc/repo/actions/workflow_jobs.md index 62467353c53..d45a4938ec2 100644 --- a/doc/repo/actions/workflow_jobs.md +++ b/doc/repo/actions/workflow_jobs.md @@ -3,7 +3,7 @@ ### List jobs for a workflow run -https://docs.github.com/en/rest/reference/actions#list-jobs-for-a-workflow-run +https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run ```php $client->api('repo')->workflowJobs()->all('KnpLabs', 'php-github-api', $runId); @@ -11,7 +11,7 @@ $client->api('repo')->workflowJobs()->all('KnpLabs', 'php-github-api', $runId); ### Get a job for a workflow run -https://docs.github.com/en/rest/reference/actions#get-a-job-for-a-workflow-run +https://docs.github.com/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run ```php $job = $client->api('repo')->workflowJobs()->all('KnpLabs', 'php-github-api', $jobId); @@ -19,7 +19,7 @@ $job = $client->api('repo')->workflowJobs()->all('KnpLabs', 'php-github-api', $j ### Download job logs for a workflow run -https://docs.github.com/en/rest/reference/actions#download-job-logs-for-a-workflow-run +https://docs.github.com/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run ```php $jobLogs = $client->api('repo')->workflowJobs()->downloadLogs('KnpLabs', 'php-github-api', $jobId); diff --git a/doc/repo/actions/workflow_runs.md b/doc/repo/actions/workflow_runs.md index 4b879ca5b98..a20b3bf81fc 100644 --- a/doc/repo/actions/workflow_runs.md +++ b/doc/repo/actions/workflow_runs.md @@ -3,7 +3,7 @@ ### List workflow runs for a repository -https://docs.github.com/en/rest/reference/actions#list-workflow-runs-for-a-repository +https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-repository ```php $workflowRuns = $client->api('repo')->workflowRuns()->all('KnpLabs', 'php-github-api'); @@ -11,7 +11,7 @@ $workflowRuns = $client->api('repo')->workflowRuns()->all('KnpLabs', 'php-github ### List workflow runs -https://docs.github.com/en/rest/reference/actions#list-workflow-runs +https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow ```php $runs = $client->api('repo')->workflowRuns()->listRuns('KnpLabs', 'php-github-api', $workflow); @@ -19,7 +19,7 @@ $runs = $client->api('repo')->workflowRuns()->listRuns('KnpLabs', 'php-github-ap ### Get a workflow run -https://docs.github.com/en/rest/reference/actions#get-a-workflow-run +https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run ```php $workflowRun = $client->api('repo')->workflowRuns()->show('KnpLabs', 'php-github-api', $runId); @@ -27,7 +27,7 @@ $workflowRun = $client->api('repo')->workflowRuns()->show('KnpLabs', 'php-github ### Delete a workflow run -https://docs.github.com/en/rest/reference/actions#delete-a-workflow-run +https://docs.github.com/rest/actions/workflow-runs#delete-a-workflow-run ```php $client->api('repo')->workflowRuns()->remove('KnpLabs', 'php-github-api', $runId); @@ -35,7 +35,7 @@ $client->api('repo')->workflowRuns()->remove('KnpLabs', 'php-github-api', $runId ### Re-run a workflow -https://docs.github.com/en/rest/reference/actions#re-run-a-workflow +https://docs.github.com/rest/actions/workflow-runs#re-run-a-workflow ```php $client->api('repo')->workflowRuns()->rerun('KnpLabs', 'php-github-api', $runId); @@ -43,7 +43,7 @@ $client->api('repo')->workflowRuns()->rerun('KnpLabs', 'php-github-api', $runId) ### Cancel a workflow run -https://docs.github.com/en/rest/reference/actions#cancel-a-workflow-run +https://docs.github.com/rest/actions/workflow-runs#cancel-a-workflow-run ```php $client->api('repo')->workflowRuns()->cancel('KnpLabs', 'php-github-api', $runId); @@ -51,7 +51,7 @@ $client->api('repo')->workflowRuns()->cancel('KnpLabs', 'php-github-api', $runId ### Get workflow run usage -https://docs.github.com/en/rest/reference/actions#get-workflow-run-usage +https://docs.github.com/rest/actions/workflow-runs#get-workflow-run-usage ```php $workflowUsage = $client->api('repo')->workflowRuns()->usage('KnpLabs', 'php-github-api', $runId); @@ -59,7 +59,7 @@ $workflowUsage = $client->api('repo')->workflowRuns()->usage('KnpLabs', 'php-git ### Download workflow run logs -https://docs.github.com/en/rest/reference/actions#download-workflow-run-logs +https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-logs ```php $logs = $client->api('repo')->workflowRuns()->downloadLogs('KnpLabs', 'php-github-api', $runId); @@ -69,7 +69,7 @@ file_put_contents('logs.zip', $logs); ### Delete workflow run logs -https://docs.github.com/en/rest/reference/actions#delete-workflow-run-logs +https://docs.github.com/rest/actions/workflow-runs#delete-workflow-run-logs ```php $client->api('repo')->workflowRuns()->deleteLogs('KnpLabs', 'php-github-api', $runId); @@ -77,7 +77,7 @@ $client->api('repo')->workflowRuns()->deleteLogs('KnpLabs', 'php-github-api', $r ### Approve workflow run -https://docs.github.com/en/rest/reference/actions#approve-a-workflow-run-for-a-fork-pull-request +https://docs.github.com/rest/actions/workflow-runs#approve-a-workflow-run-for-a-fork-pull-request ```php $client->api('repo')->workflowRuns()->approve('KnpLabs', 'php-github-api', $runId); diff --git a/doc/repo/actions/workflows.md b/doc/repo/actions/workflows.md index 91839cf0ecf..a9b96da643a 100644 --- a/doc/repo/actions/workflows.md +++ b/doc/repo/actions/workflows.md @@ -3,7 +3,7 @@ ### List repository workflows -https://docs.github.com/en/rest/reference/actions#list-repository-workflows +https://docs.github.com/rest/actions/workflows#list-repository-workflows ```php $workflows = $client->api('repo')->workflows()->all('KnpLabs', 'php-github-api'); @@ -11,7 +11,7 @@ $workflows = $client->api('repo')->workflows()->all('KnpLabs', 'php-github-api') ### Get a workflow -https://docs.github.com/en/rest/reference/actions#get-a-workflow +https://docs.github.com/rest/actions/workflows#get-a-workflow ```php $workflow = $client->api('repo')->workflows()->show('KnpLabs', 'php-github-api', $workflow); @@ -19,7 +19,7 @@ $workflow = $client->api('repo')->workflows()->show('KnpLabs', 'php-github-api', ### Get workflow usage -https://docs.github.com/en/rest/reference/actions#get-workflow-usage +https://docs.github.com/rest/actions/workflows#get-workflow-usage ```php $usage = $client->api('repo')->workflows()->usage('KnpLabs', 'php-github-api', $workflow); @@ -27,7 +27,7 @@ $usage = $client->api('repo')->workflows()->usage('KnpLabs', 'php-github-api', $ ### Dispatch a workflow -https://docs.github.com/en/rest/reference/actions#create-a-workflow-dispatch-event +https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event ```php $client->api('repo')->workflows()->dispatches('KnpLabs', 'php-github-api', $workflow, 'main'); diff --git a/doc/repo/assets.md b/doc/repo/assets.md index 93234929074..8e06b1b7f30 100644 --- a/doc/repo/assets.md +++ b/doc/repo/assets.md @@ -1,6 +1,8 @@ ## Repo / Releases API [Back to the "Repos API"](../repos.md) | [Back to the navigation](../README.md) +Provides information about release assets for a repository. Wraps [GitHub Release assets API](https://docs.github.com/rest/releases/assets). + ### List all assets by release ```php diff --git a/doc/repo/check_runs.md b/doc/repo/check_runs.md index 3b7b69b8f86..549ecc327fa 100644 --- a/doc/repo/check_runs.md +++ b/doc/repo/check_runs.md @@ -3,7 +3,7 @@ ### Create a check run -[Visit GitHub for a full of list of parameters and their descriptions.](https://docs.github.com/en/rest/reference/checks#create-a-check-run) +[Visit GitHub for a full of list of parameters and their descriptions.](https://docs.github.com/rest/checks/runs#create-a-check-run) ```php $params = [ @@ -17,7 +17,7 @@ $check = $client->api('repo')->checkRuns()->create('KnpLabs', 'php-github-api', ### Get a check run -https://docs.github.com/en/rest/reference/checks#get-a-check-run +https://docs.github.com/rest/checks/runs#get-a-check-run ```php $check = $client->api('repo')->checkRuns()->show('KnpLabs', 'php-github-api', $checkRunId); @@ -25,7 +25,7 @@ $check = $client->api('repo')->checkRuns()->show('KnpLabs', 'php-github-api', $c ### Update an existing check run -https://docs.github.com/en/rest/reference/checks#update-a-check-run +https://docs.github.com/rest/checks/runs#update-a-check-run ```php $params = [ @@ -38,7 +38,7 @@ $check = $client->api('repo')->checkRuns()->update('KnpLabs', 'php-github-api', ### List check run annotations -https://docs.github.com/en/rest/reference/checks#list-check-run-annotations +https://docs.github.com/rest/checks/runs#list-check-run-annotations ```php $annotations = $client->api('repo')->checkRuns()->annotations('KnpLabs', 'php-github-api', $checkRunId); @@ -46,7 +46,7 @@ $annotations = $client->api('repo')->checkRuns()->annotations('KnpLabs', 'php-gi ### List check runs for a check suite -https://docs.github.com/en/rest/reference/checks#list-check-runs-in-a-check-suite +https://docs.github.com/rest/checks/runs#list-check-runs-in-a-check-suite ```php $params = [/*...*/]; @@ -55,7 +55,7 @@ $checks = $client->api('repo')->checkRuns()->allForCheckSuite('KnpLabs', 'php-gi ### List check runs for a Git reference -https://docs.github.com/en/rest/reference/checks#list-check-runs-for-a-git-reference +https://docs.github.com/rest/checks/runs#list-check-runs-for-a-git-reference ```php $params = [/*...*/]; @@ -64,7 +64,7 @@ $checks = $client->api('repo')->checkRuns()->allForReference('KnpLabs', 'php-git ### Rerequest a check run -https://docs.github.com/en/rest/reference/checks#rerequest-a-check-run +https://docs.github.com/rest/checks/runs#rerequest-a-check-run ```php $checks = $client->api('repo')->checkRuns()->rerequest('KnpLabs', 'php-github-api', $checkRunId); diff --git a/doc/repo/check_suites.md b/doc/repo/check_suites.md index b91c8199813..cea183e654e 100644 --- a/doc/repo/check_suites.md +++ b/doc/repo/check_suites.md @@ -3,7 +3,7 @@ ### Create a check suite -https://docs.github.com/en/rest/reference/checks#create-a-check-suite +https://docs.github.com/rest/checks/suites#create-a-check-suite ```php $params = [ @@ -14,7 +14,7 @@ $check = $client->api('repo')->checkSuites()->create('KnpLabs', 'php-github-api' ### Update check suite preferences -https://docs.github.com/en/rest/reference/checks#update-repository-preferences-for-check-suites +https://docs.github.com/rest/checks/suites#update-repository-preferences-for-check-suites ```php $params = [/*...*/]; @@ -23,7 +23,7 @@ $check = $client->api('repo')->checkSuites()->updatePreferences('KnpLabs', 'php- ### Get a check suite -https://docs.github.com/en/rest/reference/checks#get-a-check-suite +https://docs.github.com/rest/checks/suites#get-a-check-suite ```php $check = $client->api('repo')->checkSuites()->getCheckSuite('KnpLabs', 'php-github-api', $checkSuiteId); @@ -31,7 +31,7 @@ $check = $client->api('repo')->checkSuites()->getCheckSuite('KnpLabs', 'php-gith ### Rerequest a check suite -https://docs.github.com/en/rest/reference/checks#rerequest-a-check-suite +https://docs.github.com/rest/checks/suites#rerequest-a-check-suite ```php $annotations = $client->api('repo')->checkSuites()->rerequest('KnpLabs', 'php-github-api', $checkSuiteId); @@ -40,7 +40,7 @@ $annotations = $client->api('repo')->checkSuites()->rerequest('KnpLabs', 'php-gi ### List check suites for a Git reference -https://docs.github.com/en/rest/reference/checks#list-check-suites-for-a-git-reference +https://docs.github.com/rest/checks/suites#list-check-suites-for-a-git-reference ```php $params = [/*...*/]; diff --git a/doc/repo/checks.md b/doc/repo/checks.md index f81f1f6f8f3..891bf135e8c 100644 --- a/doc/repo/checks.md +++ b/doc/repo/checks.md @@ -5,7 +5,7 @@ ### Create a check for a commit -[Visit GitHub for a full of list of parameters and their descriptions.](https://developer.github.com/v3/checks/runs/#create-a-check-run) +[Visit GitHub for a full of list of parameters and their descriptions.](https://docs.github.com/rest/checks/runs#create-a-check-run) ```php $params = [ @@ -20,7 +20,7 @@ $check = $client->api('repo')->checks()->create('NimbleCI', 'docker-web-tester-b ### Update an existing check on a commit -https://developer.github.com/v3/checks/runs/#update-a-check-run +https://docs.github.com/rest/checks/runs#update-a-check-run ```php $params = [ @@ -34,7 +34,7 @@ $check = $client->api('repo')->checks()->create('NimbleCI', 'docker-web-tester-b ### List check runs for a Git reference -https://developer.github.com/v3/checks/runs/#list-check-runs-for-a-git-reference +https://docs.github.com/rest/checks/runs#list-check-runs-for-a-git-reference ```php $params = [ @@ -47,7 +47,7 @@ $checks = $client->api('repo')->checks()->all('NimbleCI', 'docker-web-tester-beh ### Get a check run -https://developer.github.com/v3/checks/runs/#get-a-check-run +https://docs.github.com/rest/checks/runs#get-a-check-run ```php $check = $client->api('repo')->checks()->show('NimbleCI', 'docker-web-tester-behat', $checkRunId); @@ -55,7 +55,7 @@ $check = $client->api('repo')->checks()->show('NimbleCI', 'docker-web-tester-beh ### List check run annotations -https://developer.github.com/v3/checks/runs/#list-check-run-annotations +https://docs.github.com/rest/checks/runs#list-check-run-annotations ```php $annotations = $client->api('repo')->checks()->annotations('NimbleCI', 'docker-web-tester-behat', $checkRunId); diff --git a/doc/repo/contents.md b/doc/repo/contents.md index 756a5785316..97e2c1e71f6 100644 --- a/doc/repo/contents.md +++ b/doc/repo/contents.md @@ -3,17 +3,23 @@ --- -You can read about references [here](https://developer.github.com/v3/git/refs/). +Wraps [GitHub Repository Contents API](https://docs.github.com/rest/repos/contents). + +You can read about references [here](https://docs.github.com/rest/git/refs). ### Get a repository's README +https://docs.github.com/rest/repos/contents#get-a-repository-readme + ```php $readme = $client->api('repo')->contents()->readme('KnpLabs', 'php-github-api', $reference); ``` ### Get information about a repository file or directory +https://docs.github.com/rest/repos/contents#get-repository-content + ```php $fileInfo = $client->api('repo')->contents()->show('KnpLabs', 'php-github-api', $path, $reference); ``` @@ -24,6 +30,9 @@ $fileExists = $client->api('repo')->contents()->exists('KnpLabs', 'php-github-ap ``` ### Create a file + +https://docs.github.com/rest/repos/contents#create-or-update-file-contents + ```php $committer = array('name' => 'KnpLabs', 'email' => 'info@knplabs.com'); @@ -32,6 +41,8 @@ $fileInfo = $client->api('repo')->contents()->create('KnpLabs', 'php-github-api' ### Update a file +https://docs.github.com/rest/repos/contents#create-or-update-file-contents + ```php $committer = array('name' => 'KnpLabs', 'email' => 'info@knplabs.com'); $oldFile = $client->api('repo')->contents()->show('KnpLabs', 'php-github-api', $path, $branch); @@ -41,6 +52,8 @@ $fileInfo = $client->api('repo')->contents()->update('KnpLabs', 'php-github-api' ### Remove a file +https://docs.github.com/rest/repos/contents#delete-a-file + ```php $committer = array('name' => 'KnpLabs', 'email' => 'info@knplabs.com'); $oldFile = $client->api('repo')->contents()->show('KnpLabs', 'php-github-api', $path, $branch); @@ -50,6 +63,8 @@ $fileInfo = $client->api('repo')->contents()->rm('KnpLabs', 'php-github-api', $p ### Get repository archive +https://docs.github.com/rest/repos/contents#download-a-repository-archive-tar + ```php $archive = $client->api('repo')->contents()->archive('KnpLabs', 'php-github-api', $format, $reference); ``` diff --git a/doc/repo/deployments.md b/doc/repo/deployments.md index 8c2ae1a8675..7d0356a1439 100644 --- a/doc/repo/deployments.md +++ b/doc/repo/deployments.md @@ -1,7 +1,7 @@ ## Repo / Deployments API [Back to the "Repos API"](../repos.md) | [Back to the navigation](../index.md) -Provides information about deployments for a repository. Wraps [GitHub Deployments API](https://developer.github.com/v3/repos/deployments/). +Provides information about deployments for a repository. Wraps [GitHub Deployments API](https://docs.github.com/rest/deployments/deployments). #### List all deployments. @@ -9,7 +9,7 @@ Provides information about deployments for a repository. Wraps [GitHub Deploymen $deployments = $client->api('deployment')->all('KnpLabs', 'php-github-api'); ``` -You can also filter the returned results (see [the documentation](https://developer.github.com/v3/repos/deployments/#list-deployments) for more information): +You can also filter the returned results (see [the documentation](https://docs.github.com/rest/deployments/deployments#list-deployments) for more information): ```php $deployments = $client->api('deployment')->all('KnpLabs', 'php-github-api', array('environment' => 'production')); diff --git a/doc/repo/deployments/environment/secrets.md b/doc/repo/deployments/environment/secrets.md index 5c0c86b85d7..7ffeeb515c8 100644 --- a/doc/repo/deployments/environment/secrets.md +++ b/doc/repo/deployments/environment/secrets.md @@ -3,7 +3,7 @@ ### List environment secrets -https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28 +https://docs.github.com/rest/actions/secrets#list-environment-secrets ```php $secrets = $client->environment()->secrets()->all($repoId, $envName); @@ -11,7 +11,7 @@ $secrets = $client->environment()->secrets()->all($repoId, $envName); ### Get an environment secret -https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#get-an-environment-secret +https://docs.github.com/rest/actions/secrets#get-an-environment-secret ```php $secret = $client->environment()->secrets()->show($repoId, $envName, $secretName); @@ -19,7 +19,7 @@ $secret = $client->environment()->secrets()->show($repoId, $envName, $secretName ### Create or Update an environment secret -https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#create-or-update-an-environment-secret +https://docs.github.com/rest/actions/secrets#create-or-update-an-environment-secret ```php $client->environment()->secrets()->createOrUpdate($repoId, $envName, $secretName, [ @@ -30,7 +30,7 @@ $client->environment()->secrets()->createOrUpdate($repoId, $envName, $secretName ### Delete an environment secret -https://docs.github.com/en/rest/reference/actions#delete-an-organization-secret +https://docs.github.com/rest/actions/secrets#delete-an-environment-secret ```php $client->environment()->secrets()->remove($repoId, $envName, $secretName); @@ -38,7 +38,7 @@ $client->environment()->secrets()->remove($repoId, $envName, $secretName); ### Get an environment public key -https://docs.github.com/en/rest/reference/actions#get-an-organization-public-key +https://docs.github.com/rest/actions/secrets#get-an-environment-public-key ```php $client->environment()->secrets()->publicKey($repoId, $envName); diff --git a/doc/repo/deployments/environment/variables.md b/doc/repo/deployments/environment/variables.md index d645349a204..033a24d1c91 100644 --- a/doc/repo/deployments/environment/variables.md +++ b/doc/repo/deployments/environment/variables.md @@ -3,7 +3,7 @@ ### List environment variables -https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#list-environment-variables +https://docs.github.com/rest/actions/variables#list-environment-variables ```php $variables = $client->environment()->variables()->all($repoId, $envName); @@ -11,7 +11,7 @@ $variables = $client->environment()->variables()->all($repoId, $envName); ### Get an environment variable -https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#get-an-environment-variable +https://docs.github.com/rest/actions/variables#get-an-environment-variable ```php $variable = $client->environment()->variables()->show($repoId, $envName, $variableName); @@ -19,7 +19,7 @@ $variable = $client->environment()->variables()->show($repoId, $envName, $variab ### Create environment variable -https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#create-an-environment-variable +https://docs.github.com/rest/actions/variables#create-an-environment-variable ```php $client->environment()->variables()->create($repoId, $envName, [ @@ -30,7 +30,7 @@ $client->environment()->variables()->create($repoId, $envName, [ ### Update environment variable -https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#update-an-environment-variable +https://docs.github.com/rest/actions/variables#update-an-environment-variable ```php $client->environment()->variables()->update($repoId, $envName, $variableName, [ @@ -41,7 +41,7 @@ $client->environment()->variables()->update($repoId, $envName, $variableName, [ ### Delete an environment variable -https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#delete-an-environment-variable +https://docs.github.com/rest/actions/variables#delete-an-environment-variable ```php $client->environment()->variables()->remove($repoId, $envName, $variableName); diff --git a/doc/repo/deployments/environments.md b/doc/repo/deployments/environments.md index 6cb409ae3b3..8d664978c3f 100644 --- a/doc/repo/deployments/environments.md +++ b/doc/repo/deployments/environments.md @@ -1,7 +1,7 @@ ## Deployment / Environments API [Back to the "Deployment API"](../deployments.md) | [Back to the navigation](../index.md) -Provides information about environments for a repository. Wraps [GitHub Environments API](https://docs.github.com/en/rest/deployments/environments?apiVersion=2022-11-28). +Provides information about environments for a repository. Wraps [GitHub Environments API](https://docs.github.com/rest/deployments/environments). Additional APIs: * [Secrets API](environment/secrets.md) diff --git a/doc/repo/deployments/policies.md b/doc/repo/deployments/policies.md index 442fc0c4acb..affdaa3329f 100644 --- a/doc/repo/deployments/policies.md +++ b/doc/repo/deployments/policies.md @@ -1,7 +1,7 @@ ## Deployment / Branch policies API [Back to the "Deployment API"](../deployments.md) | [Back to the navigation](../index.md) -Provides information about deployment branch policies. Wraps [GitHub Deployment branch policies API](https://docs.github.com/en/rest/deployments/branch-policies?apiVersion=2022-11-28#about-deployment-branch-policies). +Provides information about deployment branch policies. Wraps [GitHub Deployment branch policies API](https://docs.github.com/rest/deployments/branch-policies#list-deployment-branch-policies). #### List deployment branch policies. diff --git a/doc/repo/hooks.md b/doc/repo/hooks.md index a4f9d9af655..34592d56981 100644 --- a/doc/repo/hooks.md +++ b/doc/repo/hooks.md @@ -1,7 +1,7 @@ ## Repo / Hooks API [Back to the "Repos API"](../repos.md) | [Back to the navigation](../README.md) -For extended info see the [GitHub documentation](https://docs.github.com/en/rest/reference/repos#webhooks) +For extended info see the [GitHub documentation](https://docs.github.com/rest/repos/webhooks) ### List repository webhooks diff --git a/doc/repo/labels.md b/doc/repo/labels.md index 5e924058f77..c64382b25b1 100644 --- a/doc/repo/labels.md +++ b/doc/repo/labels.md @@ -1,6 +1,8 @@ ## Repo / Labels API [Back to the "Repos API"](../repos.md) | [Back to the navigation](../README.md) +Provides information about labels for a repository. Wraps [GitHub Repository labels API](https://docs.github.com/rest/issues/labels). + ### List all labels for this repository ```php diff --git a/doc/repo/protection.md b/doc/repo/protection.md index 9ba596dca1a..30d959ed815 100644 --- a/doc/repo/protection.md +++ b/doc/repo/protection.md @@ -20,7 +20,7 @@ $protection = $client->api('repo')->protection()->show('twbs', 'bootstrap', 'mas > Requires [authentication](../security.md). -For the full list of parameters see https://developer.github.com/v3/repos/branches/#parameters-1 +For the full list of parameters see https://docs.github.com/rest/branches/branch-protection#update-branch-protection ```php $params = [ diff --git a/doc/repo/releases.md b/doc/repo/releases.md index 1b433a5f6ab..b82cc609bf3 100644 --- a/doc/repo/releases.md +++ b/doc/repo/releases.md @@ -1,7 +1,7 @@ ## Repo / Releases API [Back to the "Repos API"](../repos.md) | [Back to the navigation](../README.md) -Provides information about releases for a repository. Wraps [GitHub Releases API](https://developer.github.com/v3/repos/releases/). +Provides information about releases for a repository. Wraps [GitHub Releases API](https://docs.github.com/rest/releases/releases). ### Get latest actual release diff --git a/doc/repo/secret-scanning.md b/doc/repo/secret-scanning.md index 18f3ef20b28..7a4f01dc5d0 100644 --- a/doc/repo/secret-scanning.md +++ b/doc/repo/secret-scanning.md @@ -3,7 +3,7 @@ # List secret-scanning alerts for a repository -https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-secret-scanning-alerts-for-a-repository +https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-a-repository ```php $alerts = $client->api('repos')->secretScanning()->alerts('KnpLabs', 'php-github-api'); @@ -11,7 +11,7 @@ $alerts = $client->api('repos')->secretScanning()->alerts('KnpLabs', 'php-github # Get a secret-scanning alert -https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#get-a-secret-scanning-alert +https://docs.github.com/rest/secret-scanning/secret-scanning#get-a-secret-scanning-alert ```php $alert = $client->api('repos')->secretScanning()->getAlert('KnpLabs', 'php-github-api', $alertNumber); @@ -19,7 +19,7 @@ $alert = $client->api('repos')->secretScanning()->getAlert('KnpLabs', 'php-githu # Update a secret-scanning alert -https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#update-a-secret-scanning-alert +https://docs.github.com/rest/secret-scanning/secret-scanning#update-a-secret-scanning-alert ```php $client->api('repos')->secretScanning()->updateAlert('KnpLabs', 'php-github-api', $alertNumber, [ @@ -30,7 +30,7 @@ $client->api('repos')->secretScanning()->updateAlert('KnpLabs', 'php-github-api' # List Locations for a secret-scanning alert -https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-locations-for-a-secret-scanning-alert +https://docs.github.com/rest/secret-scanning/secret-scanning#list-locations-for-a-secret-scanning-alert ```php $locations = $client->api('repos')->secretScanning()->locations('KnpLabs', 'php-github-api', $alertNumber); diff --git a/doc/repo/stargazers.md b/doc/repo/stargazers.md index 003f2ad8d71..2d9d8468015 100644 --- a/doc/repo/stargazers.md +++ b/doc/repo/stargazers.md @@ -1,6 +1,8 @@ ## Repo / Stargazers API [Back to the "Repos API"](../repos.md) | [Back to the navigation](../README.md) +Provides information about the users who have starred a repository. Wraps [GitHub Starring API](https://docs.github.com/rest/activity/starring#list-stargazers). + ### List all stargazers ```php diff --git a/doc/repo/statuses.md b/doc/repo/statuses.md index 4f4378c2b54..da4a0836feb 100644 --- a/doc/repo/statuses.md +++ b/doc/repo/statuses.md @@ -15,7 +15,7 @@ $statuses = $client->api('repo')->statuses()->combined('NimbleCI', 'docker-web-t ### Create a status for a commit -For the full list of parameters see https://developer.github.com/v3/repos/statuses/#parameters +For the full list of parameters see https://docs.github.com/rest/commits/statuses#create-a-commit-status ```php $params = [ diff --git a/doc/repo/tags.md b/doc/repo/tags.md index 95e35bb0665..a64cba2c14c 100644 --- a/doc/repo/tags.md +++ b/doc/repo/tags.md @@ -1,6 +1,8 @@ ## Repo / Tags API [Back to the "Repos API"](../repos.md) | [Back to the navigation](../README.md) +Provides information about tags for a repository. Wraps [GitHub Repository tags API](https://docs.github.com/rest/repos/repos#list-repository-tags). + ### List all tags ```php diff --git a/doc/repos.md b/doc/repos.md index d7c30d490f4..c5a3b8dec4d 100644 --- a/doc/repos.md +++ b/doc/repos.md @@ -2,7 +2,7 @@ [Back to the navigation](README.md) Searching repositories, getting repository information and managing repository information for authenticated users. -Wrap [GitHub Repo API](http://developer.github.com/v3/repos/). All methods are described on that page. +Wrap [GitHub Repo API](https://docs.github.com/rest/repos/repos). All methods are described on that page. ### List all repositories @@ -282,7 +282,7 @@ Returns a list of languages. ### Enable automated security fixes -https://docs.github.com/en/rest/reference/repos#enable-automated-security-fixes +https://docs.github.com/rest/repos/repos#enable-dependabot-security-updates ```php $client->api('repo')->enableAutomatedSecurityFixes('KnpLabs', 'php-github-api'); @@ -290,7 +290,7 @@ $client->api('repo')->enableAutomatedSecurityFixes('KnpLabs', 'php-github-api'); ### Disable automated security fixes -https://docs.github.com/en/rest/reference/repos#disable-automated-security-fixes +https://docs.github.com/rest/repos/repos#disable-dependabot-security-updates ```php $client->api('repo')->disableAutomatedSecurityFixes('KnpLabs', 'php-github-api'); @@ -393,7 +393,7 @@ $client->api('repo')->createFromTemplate('template-owner', 'template-repo', [ ### Check if vulnerability alerts (dependabot alerts) are enabled for a repository -https://developer.github.com/v3/repos/#check-if-vulnerability-alerts-are-enabled-for-a-repository +https://docs.github.com/rest/repos/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository ```php $client->api('repo')->isVulnerabilityAlertsEnabled('KnpLabs', 'php-github-api'); @@ -401,7 +401,7 @@ $client->api('repo')->isVulnerabilityAlertsEnabled('KnpLabs', 'php-github-api'); ### Enable vulnerability alerts (dependabot alerts) -https://developer.github.com/v3/repos/#enable-vulnerability-alerts +https://docs.github.com/rest/repos/repos#enable-vulnerability-alerts ```php $client->api('repo')->enableVulnerabilityAlerts('KnpLabs', 'php-github-api'); @@ -409,7 +409,7 @@ $client->api('repo')->enableVulnerabilityAlerts('KnpLabs', 'php-github-api'); ### Disable vulnerability alerts (dependabot alerts) -https://developer.github.com/v3/repos/#disable-vulnerability-alerts +https://docs.github.com/rest/repos/repos#disable-vulnerability-alerts ```php $client->api('repo')->disableVulnerabilityAlerts('KnpLabs', 'php-github-api'); diff --git a/doc/request_any_route.md b/doc/request_any_route.md index 76680fe857f..87baa23f81b 100644 --- a/doc/request_any_route.md +++ b/doc/request_any_route.md @@ -12,4 +12,4 @@ $repo = Github\HttpClient\Message\ResponseMediator::getContent($response); Returns an array describing the "php-github-api" repository. -See all GitHub API routes: [http://developer.github.com/](http://developer.github.com/) +See all GitHub API routes: [https://docs.github.com/rest](https://docs.github.com/rest) diff --git a/doc/search.md b/doc/search.md index 24dbbef2302..fe633fe3cdf 100644 --- a/doc/search.md +++ b/doc/search.md @@ -2,7 +2,7 @@ [Back to the navigation](README.md) Searching repositories, code, issues and users. -Wrap [GitHub Search API](http://developer.github.com/v3/search/). All methods are described on that page. +Wrap [GitHub Search API](https://docs.github.com/rest/search/search). All methods are described on that page. ### Search repositories @@ -24,7 +24,7 @@ Returns a list of files found by such criteria (containing "@todo" and language= $files = $client->api('search')->codeWithMatch('@todo language:php'); ``` -Same as code, with additional data to highlight the matching fragments (see [Text match metadata](https://docs.github.com/en/rest/reference/search#text-match-metadata)). +Same as code, with additional data to highlight the matching fragments (see [Text match metadata](https://docs.github.com/rest/search/search#text-match-metadata)). ### Search issues diff --git a/doc/security.md b/doc/security.md index a8596de20b1..f187d057bab 100644 --- a/doc/security.md +++ b/doc/security.md @@ -17,9 +17,9 @@ $client->authenticate($usernameOrToken, $password, $method); and guess what should contain `$password`. The `$method` can contain one of the three allowed values: #### Supported methods -* `Github\AuthMethod::CLIENT_ID` - https://developer.github.com/v3/#oauth2-keysecret -* `Github\AuthMethod::ACCESS_TOKEN` - https://developer.github.com/v3/#oauth2-token-sent-in-a-header -* `Github\AuthMethod::JWT` - https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app +* `Github\AuthMethod::CLIENT_ID` - https://docs.github.com/rest/authentication/authenticating-to-the-rest-api +* `Github\AuthMethod::ACCESS_TOKEN` - https://docs.github.com/rest/authentication/authenticating-to-the-rest-api +* `Github\AuthMethod::JWT` - https://docs.github.com/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app The required value of `$password` depends on the chosen `$method`. For `Github\AuthMethod::CLIENT_ID`, `Github\AuthMethod::ACCESS_TOKEN` and `Github\AuthMethod::JWT` methods you should provide the API token in `$usernameOrToken` variable (`$password` is omitted in @@ -34,7 +34,7 @@ further requests are done as the given user. To authenticate as an integration you need to supply a JSON Web Token with `Github\AuthMethod::JWT` to request and installation access token which is then usable with `Github\AuthMethod::ACCESS_TOKEN`. [GitHub´s integration -authentication docs](https://developer.github.com/apps/building-github-apps/authentication-options-for-github-apps/#authenticating-as-a-github-app) describe the flow in detail. +authentication docs](https://docs.github.com/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app) describe the flow in detail. It´s important for integration requests to use the custom Accept header `application/vnd.github.machine-man-preview`. The following sample code authenticates as an installation using [lcobucci/jwt 4.1](https://github.com/lcobucci/jwt/tree/4.1.x) diff --git a/doc/user/migration.md b/doc/user/migration.md index a2c3eb14c5e..7654c4db2ea 100644 --- a/doc/user/migration.md +++ b/doc/user/migration.md @@ -3,7 +3,7 @@ # List user migrations -https://docs.github.com/en/rest/migrations/users?apiVersion=2022-11-28#list-user-migrations +https://docs.github.com/rest/migrations/users#list-user-migrations ```php $api = $github->api('user')->migration(); @@ -22,7 +22,7 @@ while($paginator->hasNext()); # Start a User Migration -https://docs.github.com/en/rest/migrations/users?apiVersion=2022-11-28#start-a-user-migration +https://docs.github.com/rest/migrations/users#start-a-user-migration ```php $client->users()->migration()->start([ @@ -44,7 +44,7 @@ $client->users()->migration()->start([ # Get a User Migration Status -https://docs.github.com/en/rest/migrations/users?apiVersion=2022-11-28#get-a-user-migration-status +https://docs.github.com/rest/migrations/users#get-a-user-migration-status ```php $status = $client->user()->migration()->status(12, [ @@ -56,7 +56,7 @@ $status = $client->user()->migration()->status(12, [ # Delete a User Migration Archive -https://docs.github.com/en/rest/migrations/users?apiVersion=2022-11-28#delete-a-user-migration-archive +https://docs.github.com/rest/migrations/users#delete-a-user-migration-archive ```php $client->user()->migration()->deleteArchive(12); @@ -64,7 +64,7 @@ $client->user()->migration()->deleteArchive(12); # Unlock a User Repository -https://docs.github.com/en/rest/migrations/users?apiVersion=2022-11-28#unlock-a-user-repository +https://docs.github.com/rest/migrations/users#unlock-a-user-repository ```php $client->user()->migration()->unlockRepo(12, 'php-github-api'); @@ -72,7 +72,7 @@ $client->user()->migration()->unlockRepo(12, 'php-github-api'); # List repositories for a User Migration -https://docs.github.com/en/rest/migrations/users?apiVersion=2022-11-28#list-repositories-for-a-user-migration +https://docs.github.com/rest/migrations/users#list-repositories-for-a-user-migration ```php $repos = $client->user()->migration()->repos(2); diff --git a/doc/users.md b/doc/users.md index 48bb0d7dc15..45320e8fe13 100644 --- a/doc/users.md +++ b/doc/users.md @@ -2,7 +2,7 @@ [Back to the navigation](README.md) Searching users, getting user information and managing authenticated user account information. -Wrap [GitHub User API](http://developer.github.com/v3/users/). +Wrap [GitHub User API](https://docs.github.com/rest/users/users). ### Search for users by keyword diff --git a/lib/Github/Api/App/Hook.php b/lib/Github/Api/App/Hook.php index e7475dce740..546b74f2283 100644 --- a/lib/Github/Api/App/Hook.php +++ b/lib/Github/Api/App/Hook.php @@ -11,7 +11,7 @@ class Hook extends AbstractApi /** * Show the app hook configuration. * - * @link https://docs.github.com/en/rest/apps/webhooks#get-a-webhook-configuration-for-an-app + * @link https://docs.github.com/rest/apps/webhooks#get-a-webhook-configuration-for-an-app * * @return array */ @@ -23,7 +23,7 @@ public function showConfig() /** * Update the hook configuration of an app. * - * @link https://docs.github.com/en/rest/apps/webhooks#update-a-webhook-configuration-for-an-app + * @link https://docs.github.com/rest/apps/webhooks#update-a-webhook-configuration-for-an-app * * @param array $params * @@ -37,7 +37,7 @@ public function updateConfig(array $params) /** * List deliveries for an app webhook. * - * @link https://docs.github.com/en/rest/apps/webhooks#list-deliveries-for-an-app-webhook + * @link https://docs.github.com/rest/apps/webhooks#list-deliveries-for-an-app-webhook * * @return array */ @@ -49,7 +49,7 @@ public function deliveries() /** * Get a delivery for an app webhook. * - * @link https://docs.github.com/en/rest/apps/webhooks#get-a-delivery-for-an-app-webhook + * @link https://docs.github.com/rest/apps/webhooks#get-a-delivery-for-an-app-webhook * * @param int $delivery * @@ -63,7 +63,7 @@ public function delivery($delivery) /** * Redeliver a delivery for an app webhook. * - * @link https://docs.github.com/en/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook + * @link https://docs.github.com/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook * * @param int $delivery * diff --git a/lib/Github/Api/Apps.php b/lib/Github/Api/Apps.php index 15e1dfdcd4a..f7da05bfbda 100644 --- a/lib/Github/Api/Apps.php +++ b/lib/Github/Api/Apps.php @@ -5,7 +5,7 @@ use Github\Api\App\Hook; /** - * @link https://developer.github.com/v3/apps/ + * @link https://docs.github.com/rest/apps/apps * * @author Nils Adermann */ @@ -25,7 +25,7 @@ private function configurePreviewHeader() * @param int $userId An optional user id on behalf of whom the * token will be requested * - * @link https://developer.github.com/v3/apps/#create-a-new-installation-token + * @link https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app * * @return array token and token metadata */ @@ -44,7 +44,7 @@ public function createInstallationToken($installationId, $userId = null) /** * Find all installations for the authenticated application. * - * @link https://developer.github.com/v3/apps/#find-installations + * @link https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app * * @return array */ @@ -58,7 +58,7 @@ public function findInstallations() /** * Get an installation of the application. * - * @link https://developer.github.com/v3/apps/#get-an-installation + * @link https://docs.github.com/rest/apps/apps#get-an-installation-for-the-authenticated-app * * @param int $installationId An integration installation id * @@ -74,7 +74,7 @@ public function getInstallation($installationId) /** * Get an installation of the application for an organization. * - * @link https://developer.github.com/v3/apps/#get-an-organization-installation + * @link https://docs.github.com/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app * * @param string $org An organization * @@ -90,7 +90,7 @@ public function getInstallationForOrganization($org) /** * Get an installation of the application for a repository. * - * @link https://developer.github.com/v3/apps/#get-a-repository-installation + * @link https://docs.github.com/rest/apps/apps#get-a-repository-installation-for-the-authenticated-app * * @param string $owner the owner of a repository * @param string $repo the name of the repository @@ -107,7 +107,7 @@ public function getInstallationForRepo($owner, $repo) /** * Get an installation of the application for a user. * - * @link https://developer.github.com/v3/apps/#get-a-user-installation + * @link https://docs.github.com/rest/apps/apps#get-a-user-installation-for-the-authenticated-app * * @param string $username * @@ -123,7 +123,7 @@ public function getInstallationForUser($username) /** * Delete an installation of the application. * - * @link https://developer.github.com/v3/apps/#delete-an-installation + * @link https://docs.github.com/rest/apps/apps#delete-an-installation-for-the-authenticated-app * * @param int $installationId An integration installation id */ @@ -137,7 +137,7 @@ public function removeInstallation($installationId) /** * List repositories that are accessible to the authenticated installation. * - * @link https://developer.github.com/v3/apps/installations/#list-repositories + * @link https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-app-installation * * @param int $userId * @@ -158,7 +158,7 @@ public function listRepositories($userId = null) /** * Add a single repository to an installation. * - * @link https://developer.github.com/v3/apps/installations/#add-repository-to-installation + * @link https://docs.github.com/rest/apps/installations#add-a-repository-to-an-app-installation * * @param int $installationId * @param int $repositoryId @@ -175,7 +175,7 @@ public function addRepository($installationId, $repositoryId) /** * Remove a single repository from an installation. * - * @link https://developer.github.com/v3/apps/installations/#remove-repository-from-installation + * @link https://docs.github.com/rest/apps/installations#remove-a-repository-from-an-app-installation * * @param int $installationId * @param int $repositoryId @@ -192,7 +192,7 @@ public function removeRepository($installationId, $repositoryId) /** * Get the currently authenticated app. * - * @link https://docs.github.com/en/rest/reference/apps#get-the-authenticated-app + * @link https://docs.github.com/rest/apps/apps#get-the-authenticated-app * * @return array */ @@ -204,7 +204,7 @@ public function getAuthenticatedApp() /** * Manage the hook of an app. * - * @link https://docs.github.com/en/rest/apps/webhooks + * @link https://docs.github.com/rest/apps/webhooks * * @return Hook */ diff --git a/lib/Github/Api/Authorizations.php b/lib/Github/Api/Authorizations.php index 6032c7fadb2..8f9e9f7ef8e 100644 --- a/lib/Github/Api/Authorizations.php +++ b/lib/Github/Api/Authorizations.php @@ -5,7 +5,7 @@ /** * Creating, deleting and listing authorizations. * - * @link http://developer.github.com/v3/oauth_authorizations/ + * @link https://docs.github.com/rest/apps/oauth-applications * * @author Evgeniy Guseletov */ @@ -14,6 +14,8 @@ class Authorizations extends AbstractApi /** * Check an application token. * + * @link https://docs.github.com/rest/apps/oauth-applications#check-a-token + * * @param string $clientId * @param string|null $token * @@ -27,6 +29,8 @@ public function checkToken($clientId, $token = null) /** * Reset an application token. * + * @link https://docs.github.com/rest/apps/oauth-applications#reset-a-token + * * @param string $clientId * @param string|null $token * @@ -40,6 +44,8 @@ public function resetToken($clientId, $token = null) /** * Revoke an application token. * + * @link https://docs.github.com/rest/apps/oauth-applications#delete-an-app-token + * * @param string $clientId * @param string|null $token * @@ -53,6 +59,8 @@ public function deleteToken($clientId, $token = null) /** * Revoke an application authorization. * + * @link https://docs.github.com/rest/apps/oauth-applications#delete-an-app-authorization + * * @param string $clientId * @param string|null $token * diff --git a/lib/Github/Api/Copilot/Usage.php b/lib/Github/Api/Copilot/Usage.php index 0110a58bb40..13df260939c 100644 --- a/lib/Github/Api/Copilot/Usage.php +++ b/lib/Github/Api/Copilot/Usage.php @@ -6,11 +6,36 @@ class Usage extends AbstractApi { + /** + * Get a summary of Copilot usage for an organization. + * + * @deprecated This endpoint has been deprecated by GitHub in favor of the Copilot usage metrics API. + * + * @link https://docs.github.com/rest/copilot/copilot-usage-metrics + * + * @param string $organization the organization name + * @param array $params the parameters (e.g. since, until, per_page, page) + * + * @return array + */ public function orgUsageSummary(string $organization, array $params = []): array { return $this->get('/orgs/'.rawurlencode($organization).'/copilot/usage', $params); } + /** + * Get a summary of Copilot usage for a team within an organization. + * + * @deprecated This endpoint has been deprecated by GitHub in favor of the Copilot usage metrics API. + * + * @link https://docs.github.com/rest/copilot/copilot-usage-metrics + * + * @param string $organization the organization name + * @param string $teamSlug the slug of the team + * @param array $params the parameters (e.g. since, until, per_page, page) + * + * @return array + */ public function orgTeamUsageSummary(string $organization, string $teamSlug, array $params = []): array { return $this->get( @@ -19,11 +44,36 @@ public function orgTeamUsageSummary(string $organization, string $teamSlug, arra ); } + /** + * Get a summary of Copilot usage for an enterprise. + * + * @deprecated This endpoint has been deprecated by GitHub in favor of the Copilot usage metrics API. + * + * @link https://docs.github.com/rest/copilot/copilot-usage-metrics + * + * @param string $enterprise the enterprise slug + * @param array $params the parameters (e.g. since, until, per_page, page) + * + * @return array + */ public function enterpriseUsageSummary(string $enterprise, array $params = []): array { return $this->get('/enterprises/'.rawurlencode($enterprise).'/copilot/usage', $params); } + /** + * Get a summary of Copilot usage for a team within an enterprise. + * + * @deprecated This endpoint has been deprecated by GitHub in favor of the Copilot usage metrics API. + * + * @link https://docs.github.com/rest/copilot/copilot-usage-metrics + * + * @param string $enterprise the enterprise slug + * @param string $teamSlug the slug of the team + * @param array $params the parameters (e.g. since, until, per_page, page) + * + * @return array + */ public function enterpriseTeamUsageSummary(string $enterprise, string $teamSlug, array $params = []): array { return $this->get( diff --git a/lib/Github/Api/CurrentUser.php b/lib/Github/Api/CurrentUser.php index b5cbc89a376..0d4992adc80 100644 --- a/lib/Github/Api/CurrentUser.php +++ b/lib/Github/Api/CurrentUser.php @@ -11,7 +11,7 @@ use Github\Api\CurrentUser\Watchers; /** - * @link http://developer.github.com/v3/users/ + * @link https://docs.github.com/rest/users/users * * @author Joseph Bielawski * @author Felipe Valtl de Mello @@ -20,11 +20,27 @@ class CurrentUser extends AbstractApi { use AcceptHeaderTrait; + /** + * Get the authenticated user. + * + * @link https://docs.github.com/rest/users/users#get-the-authenticated-user + * + * @return array + */ public function show() { return $this->get('/user'); } + /** + * Update the authenticated user. + * + * @link https://docs.github.com/rest/users/users#update-the-authenticated-user + * + * @param array $params + * + * @return array + */ public function update(array $params) { return $this->patch('/user', $params); @@ -46,6 +62,15 @@ public function follow() return new Followers($this->getClient()); } + /** + * List followers of the authenticated user. + * + * @link https://docs.github.com/rest/users/followers#list-followers-of-the-authenticated-user + * + * @param int $page + * + * @return array + */ public function followers($page = 1) { return $this->get('/user/followers', [ @@ -54,7 +79,7 @@ public function followers($page = 1) } /** - * @link https://docs.github.com/en/rest/reference/issues#list-user-account-issues-assigned-to-the-authenticated-user + * @link https://docs.github.com/rest/issues/issues#list-user-account-issues-assigned-to-the-authenticated-user * * @param array $params * @param bool $includeOrgIssues @@ -91,7 +116,7 @@ public function memberships() } /** - * @link https://docs.github.com/en/rest/reference/orgs#list-organizations-for-the-authenticated-user + * @link https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user * * @return array */ @@ -101,7 +126,7 @@ public function organizations() } /** - * @link https://developer.github.com/v3/orgs/teams/#list-user-teams + * @link https://docs.github.com/rest/teams/teams#list-teams-for-the-authenticated-user * * @return array */ @@ -111,7 +136,7 @@ public function teams() } /** - * @link https://docs.github.com/en/rest/reference/repos#list-repositories-for-the-authenticated-user + * @link https://docs.github.com/rest/repos/repos#list-repositories-for-the-authenticated-user * * @param string $type role in the repository * @param string $sort sort by @@ -159,7 +184,7 @@ public function starring() } /** - * @link https://docs.github.com/en/rest/reference/activity#list-repositories-watched-by-the-authenticated-user + * @link https://docs.github.com/rest/activity/watching#list-repositories-watched-by-the-authenticated-user */ public function subscriptions() { @@ -167,7 +192,7 @@ public function subscriptions() } /** - * @link https://docs.github.com/en/rest/reference/apps#list-app-installations-accessible-to-the-user-access-token + * @link https://docs.github.com/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token * * @param array $params */ @@ -179,7 +204,7 @@ public function installations(array $params = []) } /** - * @link https://developer.github.com/v3/apps/installations/#list-repositories-accessible-to-the-user-access-token + * @link https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-user-access-token * * @param string $installationId the ID of the Installation * @param array $params diff --git a/lib/Github/Api/CurrentUser/Emails.php b/lib/Github/Api/CurrentUser/Emails.php index 23f2ab2402d..398148ab32e 100644 --- a/lib/Github/Api/CurrentUser/Emails.php +++ b/lib/Github/Api/CurrentUser/Emails.php @@ -6,7 +6,7 @@ use Github\Exception\InvalidArgumentException; /** - * @link http://developer.github.com/v3/users/emails/ + * @link https://docs.github.com/rest/users/emails * * @author Joseph Bielawski */ @@ -15,7 +15,7 @@ class Emails extends AbstractApi /** * List emails for the authenticated user. * - * @link http://developer.github.com/v3/users/emails/ + * @link https://docs.github.com/rest/users/emails#list-email-addresses-for-the-authenticated-user * * @return array */ @@ -27,7 +27,7 @@ public function all() /** * List public email addresses for a user. * - * @link https://developer.github.com/v3/users/emails/#list-public-email-addresses-for-a-user + * @link https://docs.github.com/rest/users/emails#list-public-email-addresses-for-the-authenticated-user * * @return array */ @@ -39,7 +39,7 @@ public function allPublic() /** * Adds one or more email for the authenticated user. * - * @link http://developer.github.com/v3/users/emails/ + * @link https://docs.github.com/rest/users/emails#add-an-email-address-for-the-authenticated-user * * @param string|array $emails * @@ -61,7 +61,7 @@ public function add($emails) /** * Removes one or more email for the authenticated user. * - * @link http://developer.github.com/v3/users/emails/ + * @link https://docs.github.com/rest/users/emails#delete-an-email-address-for-the-authenticated-user * * @param string|array $emails * @@ -83,7 +83,7 @@ public function remove($emails) /** * Toggle primary email visibility. * - * @link https://developer.github.com/v3/users/emails/#toggle-primary-email-visibility + * @link https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user * * @return array */ diff --git a/lib/Github/Api/CurrentUser/Followers.php b/lib/Github/Api/CurrentUser/Followers.php index 52a712ca99e..bf1c5209fe8 100644 --- a/lib/Github/Api/CurrentUser/Followers.php +++ b/lib/Github/Api/CurrentUser/Followers.php @@ -5,7 +5,7 @@ use Github\Api\AbstractApi; /** - * @link http://developer.github.com/v3/users/followers/ + * @link https://docs.github.com/rest/users/followers * * @author Joseph Bielawski */ @@ -14,7 +14,7 @@ class Followers extends AbstractApi /** * List followed users by the authenticated user. * - * @link http://developer.github.com/v3/repos/followers/ + * @link https://docs.github.com/rest/users/followers#list-the-people-the-authenticated-user-follows * * @param int $page * @@ -30,7 +30,7 @@ public function all($page = 1) /** * Check that the authenticated user follows a user. * - * @link http://developer.github.com/v3/repos/followers/ + * @link https://docs.github.com/rest/users/followers#check-if-a-person-is-followed-by-the-authenticated-user * * @param string $username the username to follow * @@ -44,7 +44,7 @@ public function check($username) /** * Make the authenticated user follow a user. * - * @link http://developer.github.com/v3/repos/followers/ + * @link https://docs.github.com/rest/users/followers#follow-a-user * * @param string $username the username to follow * @@ -58,7 +58,7 @@ public function follow($username) /** * Make the authenticated user un-follow a user. * - * @link http://developer.github.com/v3/repos/followers/ + * @link https://docs.github.com/rest/users/followers#unfollow-a-user * * @param string $username the username to un-follow * diff --git a/lib/Github/Api/CurrentUser/Memberships.php b/lib/Github/Api/CurrentUser/Memberships.php index da727397407..73cf460ae23 100644 --- a/lib/Github/Api/CurrentUser/Memberships.php +++ b/lib/Github/Api/CurrentUser/Memberships.php @@ -9,7 +9,7 @@ class Memberships extends AbstractApi /** * List your organization memberships. * - * @link https://developer.github.com/v3/orgs/members/#get-your-organization-membership + * @link https://docs.github.com/rest/orgs/members#list-organization-memberships-for-the-authenticated-user * * @return array */ @@ -21,7 +21,7 @@ public function all() /** * Get your organization membership. * - * @link https://developer.github.com/v3/orgs/members/#get-your-organization-membership + * @link https://docs.github.com/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user * * @param string $organization * @@ -35,7 +35,7 @@ public function organization($organization) /** * Edit your organization membership. * - * @link https://developer.github.com/v3/orgs/members/#edit-your-organization-membership + * @link https://docs.github.com/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user * * @param string $organization * diff --git a/lib/Github/Api/CurrentUser/Notifications.php b/lib/Github/Api/CurrentUser/Notifications.php index 9f3f2ce7bac..c628764ba1b 100644 --- a/lib/Github/Api/CurrentUser/Notifications.php +++ b/lib/Github/Api/CurrentUser/Notifications.php @@ -5,7 +5,7 @@ use Github\Api\AbstractApi; /** - * @link http://developer.github.com/v3/activity/notifications/ + * @link https://docs.github.com/rest/activity/notifications * * @author Joseph Bielawski */ @@ -14,7 +14,7 @@ class Notifications extends AbstractApi /** * List all notifications for the authenticated user. * - * @link http://developer.github.com/v3/activity/notifications/#list-your-notifications + * @link https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user * * @param array $params * @@ -28,7 +28,7 @@ public function all(array $params = []) /** * List all notifications for the authenticated user in selected repository. * - * @link http://developer.github.com/v3/activity/notifications/#list-your-notifications-in-a-repository + * @link https://docs.github.com/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user * * @param string $username the user who owns the repo * @param string $repository the name of the repo @@ -44,7 +44,7 @@ public function allInRepository($username, $repository, array $params = []) /** * Mark all notifications as read. * - * @link http://developer.github.com/v3/activity/notifications/#mark-as-read + * @link https://docs.github.com/rest/activity/notifications#mark-notifications-as-read * * @param array $params * @@ -58,7 +58,7 @@ public function markAsReadAll(array $params = []) /** * Mark all notifications for a repository as read. * - * @link http://developer.github.com/v3/activity/notifications/#mark-notifications-as-read-in-a-repository + * @link https://docs.github.com/rest/activity/notifications#mark-repository-notifications-as-read * * @param string $username the user who owns the repo * @param string $repository the name of the repo @@ -74,7 +74,7 @@ public function markAsReadInRepository($username, $repository, array $params = [ /** * Mark a notification as read. * - * @link http://developer.github.com/v3/activity/notifications/#mark-a-thread-as-read + * @link https://docs.github.com/rest/activity/notifications#mark-a-thread-as-read * * @param int $id the notification number * @param array $params @@ -89,7 +89,7 @@ public function markAsRead($id, array $params) /** * Show a notification. * - * @link http://developer.github.com/v3/activity/notifications/#view-a-single-thread + * @link https://docs.github.com/rest/activity/notifications#get-a-thread * * @param int $id the notification number * @@ -103,7 +103,7 @@ public function show($id) /** * Show a subscription. * - * @link http://developer.github.com/v3/activity/notifications/#get-a-thread-subscription + * @link https://docs.github.com/rest/activity/notifications#get-a-thread-subscription-for-the-authenticated-user * * @param int $id the notification number * @@ -117,7 +117,7 @@ public function showSubscription($id) /** * Create a subscription. * - * @link http://developer.github.com/v3/activity/notifications/#set-a-thread-subscription + * @link https://docs.github.com/rest/activity/notifications#set-a-thread-subscription * * @param int $id the notification number * @param array $params @@ -132,7 +132,7 @@ public function createSubscription($id, array $params) /** * Delete a subscription. * - * @link http://developer.github.com/v3/activity/notifications/#delete-a-thread-subscription + * @link https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription * * @param int $id the notification number * diff --git a/lib/Github/Api/CurrentUser/PublicKeys.php b/lib/Github/Api/CurrentUser/PublicKeys.php index cb24dec9ace..f2078fd2e28 100644 --- a/lib/Github/Api/CurrentUser/PublicKeys.php +++ b/lib/Github/Api/CurrentUser/PublicKeys.php @@ -6,7 +6,7 @@ use Github\Exception\MissingArgumentException; /** - * @link http://developer.github.com/v3/users/keys/ + * @link https://docs.github.com/rest/users/keys * * @author Joseph Bielawski */ @@ -15,7 +15,7 @@ class PublicKeys extends AbstractApi /** * List deploy keys for the authenticated user. * - * @link https://developer.github.com/v3/users/keys/ + * @link https://docs.github.com/rest/users/keys#list-public-ssh-keys-for-the-authenticated-user * * @return array */ @@ -27,7 +27,7 @@ public function all() /** * Shows deploy key for the authenticated user. * - * @link https://developer.github.com/v3/users/keys/ + * @link https://docs.github.com/rest/users/keys#get-a-public-ssh-key-for-the-authenticated-user * * @param int $id * @@ -41,7 +41,7 @@ public function show($id) /** * Adds deploy key for the authenticated user. * - * @link https://developer.github.com/v3/users/keys/ + * @link https://docs.github.com/rest/users/keys#create-a-public-ssh-key-for-the-authenticated-user * * @param array $params * @@ -61,7 +61,7 @@ public function create(array $params) /** * Removes deploy key for the authenticated user. * - * @link https://developer.github.com/v3/users/keys/ + * @link https://docs.github.com/rest/users/keys#delete-a-public-ssh-key-for-the-authenticated-user * * @param int $id * diff --git a/lib/Github/Api/CurrentUser/Starring.php b/lib/Github/Api/CurrentUser/Starring.php index ee2c50233e3..9ee690ff644 100644 --- a/lib/Github/Api/CurrentUser/Starring.php +++ b/lib/Github/Api/CurrentUser/Starring.php @@ -6,7 +6,7 @@ use Github\Api\AcceptHeaderTrait; /** - * @link https://developer.github.com/v3/activity/starring/ + * @link https://docs.github.com/rest/activity/starring * * @author Felipe Valtl de Mello */ @@ -17,7 +17,7 @@ class Starring extends AbstractApi /** * Configure the body type. * - * @see https://developer.github.com/v3/activity/starring/#list-stargazers + * @see https://docs.github.com/rest/activity/starring#list-stargazers * * @param string $bodyType * @@ -35,7 +35,7 @@ public function configure($bodyType = null) /** * List repositories starred by the authenticated user. * - * @link https://developer.github.com/v3/activity/starring/ + * @link https://docs.github.com/rest/activity/starring#list-repositories-starred-by-the-authenticated-user * * @param int $page * @param int $perPage @@ -53,7 +53,7 @@ public function all($page = 1, $perPage = 30) /** * Check that the authenticated user starres a repository. * - * @link https://developer.github.com/v3/activity/starring/ + * @link https://docs.github.com/rest/activity/starring#check-if-a-repository-is-starred-by-the-authenticated-user * * @param string $username the user who owns the repo * @param string $repository the name of the repo @@ -68,7 +68,7 @@ public function check($username, $repository) /** * Make the authenticated user star a repository. * - * @link https://developer.github.com/v3/activity/starring/ + * @link https://docs.github.com/rest/activity/starring#star-a-repository-for-the-authenticated-user * * @param string $username the user who owns the repo * @param string $repository the name of the repo @@ -83,7 +83,7 @@ public function star($username, $repository) /** * Make the authenticated user unstar a repository. * - * @link https://developer.github.com/v3/activity/starring + * @link https://docs.github.com/rest/activity/starring#unstar-a-repository-for-the-authenticated-user * * @param string $username the user who owns the repo * @param string $repository the name of the repo diff --git a/lib/Github/Api/CurrentUser/Watchers.php b/lib/Github/Api/CurrentUser/Watchers.php index 79c04b5df36..c717c4d5336 100644 --- a/lib/Github/Api/CurrentUser/Watchers.php +++ b/lib/Github/Api/CurrentUser/Watchers.php @@ -5,7 +5,7 @@ use Github\Api\AbstractApi; /** - * @link https://developer.github.com/v3/activity/watching/ + * @link https://docs.github.com/rest/activity/watching * * @author Joseph Bielawski * @@ -16,7 +16,7 @@ class Watchers extends AbstractApi /** * List repositories watched by the authenticated user. * - * @link https://developer.github.com/v3/activity/watching/ + * @link https://docs.github.com/rest/activity/watching#list-repositories-watched-by-the-authenticated-user * * @param int $page * @@ -32,7 +32,7 @@ public function all($page = 1) /** * Check that the authenticated user watches a repository. * - * @link https://developer.github.com/v3/activity/watching/ + * @link https://docs.github.com/rest/activity/watching * * @param string $username the user who owns the repo * @param string $repository the name of the repo @@ -47,7 +47,7 @@ public function check($username, $repository) /** * Make the authenticated user watch a repository. * - * @link https://developer.github.com/v3/activity/watching/ + * @link https://docs.github.com/rest/activity/watching * * @param string $username the user who owns the repo * @param string $repository the name of the repo @@ -62,7 +62,7 @@ public function watch($username, $repository) /** * Make the authenticated user unwatch a repository. * - * @link https://developer.github.com/v3/activity/watching/ + * @link https://docs.github.com/rest/activity/watching * * @param string $username the user who owns the repo * @param string $repository the name of the repo diff --git a/lib/Github/Api/Deployment.php b/lib/Github/Api/Deployment.php index de5b0cb0eb9..8cf3af390d4 100644 --- a/lib/Github/Api/Deployment.php +++ b/lib/Github/Api/Deployment.php @@ -9,7 +9,7 @@ /** * Listing, creating and updating deployments. * - * @link https://developer.github.com/v3/repos/deployments/ + * @link https://docs.github.com/rest/deployments/deployments */ class Deployment extends AbstractApi { @@ -18,7 +18,7 @@ class Deployment extends AbstractApi /** * List deployments for a particular repository. * - * @link https://developer.github.com/v3/repos/deployments/#list-deployments + * @link https://docs.github.com/rest/deployments/deployments#list-deployments * * @param string $username the username of the user who owns the repository * @param string $repository the name of the repository @@ -34,6 +34,8 @@ public function all($username, $repository, array $params = []) /** * Get a deployment in selected repository. * + * @link https://docs.github.com/rest/deployments/deployments#get-a-deployment + * * @param string $username the user who owns the repo * @param string $repository the name of the repo * @param int $id the id of the deployment @@ -48,7 +50,7 @@ public function show($username, $repository, $id) /** * Create a new deployment for the given username and repo. * - * @link https://developer.github.com/v3/repos/deployments/#create-a-deployment + * @link https://docs.github.com/rest/deployments/deployments#create-a-deployment * * Important: Once a deployment is created, it cannot be updated. Changes are indicated by creating new statuses. * @see updateStatus @@ -73,7 +75,7 @@ public function create($username, $repository, array $params) /** * Delete a deployment for the given username and repo. * - * @link https://docs.github.com/en/rest/reference/repos#delete-a-deployment + * @link https://docs.github.com/rest/deployments/deployments#delete-a-deployment * * Important: Deployments can only be deleted when in inactive state * @see updateStatus @@ -88,7 +90,7 @@ public function remove(string $username, string $repository, int $id) /** * Updates a deployment by creating a new status update. * - * @link https://developer.github.com/v3/repos/deployments/#create-a-deployment-status + * @link https://docs.github.com/rest/deployments/statuses#create-a-deployment-status * * @param string $username the username * @param string $repository the repository @@ -108,7 +110,7 @@ public function updateStatus($username, $repository, $id, array $params) } // adjust media-type per github docs - // https://docs.github.com/en/rest/reference/repos#create-a-deployment-status + // https://docs.github.com/rest/deployments/statuses#create-a-deployment-status if ($params['state'] === 'inactive') { $this->acceptHeaderValue = 'application/vnd.github.ant-man-preview+json'; } @@ -122,6 +124,8 @@ public function updateStatus($username, $repository, $id, array $params) /** * Gets all of the status updates tied to a given deployment. * + * @link https://docs.github.com/rest/deployments/statuses#list-deployment-statuses + * * @param string $username the username * @param string $repository the repository * @param int $id the deployment identifier @@ -134,6 +138,10 @@ public function getStatuses($username, $repository, $id) } /** + * Manage the environments of a repository. + * + * @link https://docs.github.com/rest/deployments/environments + * * @return Environments */ public function environments() @@ -142,6 +150,10 @@ public function environments() } /** + * Manage the deployment branch policies of an environment. + * + * @link https://docs.github.com/rest/deployments/branch-policies + * * @return Policies */ public function policies() diff --git a/lib/Github/Api/Deployment/Environments.php b/lib/Github/Api/Deployment/Environments.php index 191ec498eab..dcb1b156db4 100644 --- a/lib/Github/Api/Deployment/Environments.php +++ b/lib/Github/Api/Deployment/Environments.php @@ -9,14 +9,14 @@ /** * Listing, creating and updating environments. * - * @link https://docs.github.com/en/rest/deployments/environments?apiVersion=2022-11-28# + * @link https://docs.github.com/rest/deployments/environments */ class Environments extends AbstractApi { /** * List environments for a particular repository. * - * @link https://docs.github.com/en/rest/deployments/environments?apiVersion=2022-11-28##list-environments + * @link https://docs.github.com/rest/deployments/environments#list-environments * * @param string $username the username of the user who owns the repository * @param string $repository the name of the repository @@ -32,6 +32,8 @@ public function all($username, $repository, array $params = []) /** * Get a environment in selected repository. * + * @link https://docs.github.com/rest/deployments/environments#get-an-environment + * * @param string $username the user who owns the repo * @param string $repository the name of the repo * @param string $name the name of the environment @@ -46,7 +48,7 @@ public function show($username, $repository, $name) /** * Create or update a environment for the given username and repo. * - * @link https://docs.github.com/en/rest/deployments/environments?apiVersion=2022-11-28#create-or-update-an-environment + * @link https://docs.github.com/rest/deployments/environments#create-or-update-an-environment * * @param string $username the username * @param string $repository the repository @@ -63,7 +65,7 @@ public function createOrUpdate($username, $repository, $name, array $params = [] /** * Delete a environment for the given username and repo. * - * @link https://docs.github.com/en/rest/deployments/environments?apiVersion=2022-11-28#delete-an-environment + * @link https://docs.github.com/rest/deployments/environments#delete-an-environment * * @return mixed null on success, array on error with 'message' */ @@ -73,7 +75,7 @@ public function remove(string $username, string $repository, string $name) } /** - * @link https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#about-secrets-in-github-actions + * @link https://docs.github.com/rest/actions/secrets#about-secrets-in-github-actions */ public function secrets(): Secrets { @@ -81,7 +83,7 @@ public function secrets(): Secrets } /** - * @link https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#about-variables-in-github-actions + * @link https://docs.github.com/rest/actions/variables#about-variables-in-github-actions */ public function variables(): Variables { diff --git a/lib/Github/Api/Deployment/Policies.php b/lib/Github/Api/Deployment/Policies.php index e2d8fb59680..5eb58ebd58a 100644 --- a/lib/Github/Api/Deployment/Policies.php +++ b/lib/Github/Api/Deployment/Policies.php @@ -7,14 +7,14 @@ /** * Listing, creating and updating deployments. * - * @link https://docs.github.com/en/rest/deployments/branch-policies?apiVersion=2022-11-28#list-deployment-branch-policies + * @link https://docs.github.com/rest/deployments/branch-policies#list-deployment-branch-policies */ class Policies extends AbstractApi { /** * List deployment branch policies. * - * @link https://docs.github.com/en/rest/deployments/branch-policies?apiVersion=2022-11-28#list-deployment-branch-policies + * @link https://docs.github.com/rest/deployments/branch-policies#list-deployment-branch-policies * * @param string $username the username of the user who owns the repository * @param string $repository the name of the repository @@ -31,7 +31,7 @@ public function all(string $username, string $repository, string $environment, a /** * Get a deployment branch policy. * - * @link https://docs.github.com/en/rest/deployments/branch-policies?apiVersion=2022-11-28#get-a-deployment-branch-policy + * @link https://docs.github.com/rest/deployments/branch-policies#get-a-deployment-branch-policy * * @param string $username the username of the user who owns the repository * @param string $repository the name of the repository @@ -48,7 +48,7 @@ public function show(string $username, string $repository, string $environment, /** * Creates a deployment branch policy for an environment. * - * @link https://docs.github.com/en/rest/deployments/branch-policies?apiVersion=2022-11-28#create-a-deployment-branch-policy + * @link https://docs.github.com/rest/deployments/branch-policies#create-a-deployment-branch-policy * * @param string $username the username of the user who owns the repository * @param string $repository the name of the repository @@ -64,7 +64,7 @@ public function create(string $username, string $repository, string $environment /** * Updates a deployment branch policy for an environment. * - * @link https://docs.github.com/en/rest/deployments/branch-policies?apiVersion=2022-11-28#update-a-deployment-branch-policy + * @link https://docs.github.com/rest/deployments/branch-policies#update-a-deployment-branch-policy * * @param string $username the username of the user who owns the repository * @param string $repository the name of the repository @@ -81,7 +81,7 @@ public function update(string $username, string $repository, string $environment /** * Delete a deployment branch policy. * - * @link https://docs.github.com/en/rest/deployments/branch-policies?apiVersion=2022-11-28#delete-a-deployment-branch-policy + * @link https://docs.github.com/rest/deployments/branch-policies#delete-a-deployment-branch-policy * * @param string $username the username of the user who owns the repository * @param string $repository the name of the repository diff --git a/lib/Github/Api/Enterprise.php b/lib/Github/Api/Enterprise.php index 62abaff577e..68b6a3d22a1 100644 --- a/lib/Github/Api/Enterprise.php +++ b/lib/Github/Api/Enterprise.php @@ -11,7 +11,7 @@ /** * Getting information about a GitHub Enterprise instance. * - * @link https://developer.github.com/v3/enterprise/ + * @link https://docs.github.com/rest/enterprise-admin * * @author Joseph Bielawski * @author Guillermo A. Fisher diff --git a/lib/Github/Api/Enterprise/License.php b/lib/Github/Api/Enterprise/License.php index 67e1c2a96ea..842a227efe0 100644 --- a/lib/Github/Api/Enterprise/License.php +++ b/lib/Github/Api/Enterprise/License.php @@ -9,7 +9,7 @@ class License extends AbstractApi /** * Provides information about your Enterprise license (only available to site admins). * - * @link https://developer.github.com/v3/enterprise/license/ + * @link https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/license#get-license-information * * @return array array of license information */ diff --git a/lib/Github/Api/Enterprise/ManagementConsole.php b/lib/Github/Api/Enterprise/ManagementConsole.php index f11c47643eb..dd91547fec9 100644 --- a/lib/Github/Api/Enterprise/ManagementConsole.php +++ b/lib/Github/Api/Enterprise/ManagementConsole.php @@ -9,7 +9,7 @@ class ManagementConsole extends AbstractApi /** * Checks the status of your installation’s most recent configuration process. * - * @link https://developer.github.com/v3/enterprise/management_console/#check-configuration-status + * @link https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-the-configuration-status * * @param string $hash md5 hash of your license * @@ -23,7 +23,7 @@ public function configcheck($hash) /** * Retrieves your installation’s settings. * - * @link https://developer.github.com/v3/enterprise/management_console/#retrieve-settings + * @link https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-settings * * @param string $hash md5 hash of your license * @@ -37,7 +37,7 @@ public function settings($hash) /** * Checks your installation’s maintenance status. * - * @link https://developer.github.com/v3/enterprise/management_console/#check-maintenance-status + * @link https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-the-maintenance-status * * @param string $hash md5 hash of your license * @@ -51,7 +51,7 @@ public function maintenance($hash) /** * Retrieves your installation’s authorized SSH keys. * - * @link https://developer.github.com/v3/enterprise/management_console/#retrieve-authorized-ssh-keys + * @link https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-all-authorized-ssh-keys * * @param string $hash md5 hash of your license * diff --git a/lib/Github/Api/Enterprise/SecretScanning.php b/lib/Github/Api/Enterprise/SecretScanning.php index 5d92c1d8a47..c9af81849de 100644 --- a/lib/Github/Api/Enterprise/SecretScanning.php +++ b/lib/Github/Api/Enterprise/SecretScanning.php @@ -7,7 +7,7 @@ class SecretScanning extends AbstractApi { /** - * @link https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-secret-scanning-alerts-for-an-enterprise + * @link https://docs.github.com/enterprise-cloud@latest/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-enterprise * * @param string $enterprise * @param array $params diff --git a/lib/Github/Api/Enterprise/Stats.php b/lib/Github/Api/Enterprise/Stats.php index 78ba42565e9..dac354d46a1 100644 --- a/lib/Github/Api/Enterprise/Stats.php +++ b/lib/Github/Api/Enterprise/Stats.php @@ -9,6 +9,8 @@ class Stats extends AbstractApi /** * Returns the number of open and closed issues. * + * @link https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-issue-statistics + * * @return array array with totals of open and closed issues */ public function issues() @@ -19,6 +21,8 @@ public function issues() /** * Returns the number of active and inactive hooks. * + * @link https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-hooks-statistics + * * @return array array with totals of active and inactive hooks */ public function hooks() @@ -29,6 +33,8 @@ public function hooks() /** * Returns the number of open and closed milestones. * + * @link https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-milestone-statistics + * * @return array array with totals of open and closed milestones */ public function milestones() @@ -39,6 +45,8 @@ public function milestones() /** * Returns the number of organizations, teams, team members, and disabled organizations. * + * @link https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-organization-statistics + * * @return array array with totals of organizations, teams, team members, and disabled organizations */ public function orgs() @@ -49,6 +57,8 @@ public function orgs() /** * Returns the number of comments on issues, pull requests, commits, and gists. * + * @link https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-comment-statistics + * * @return array array with totals of comments on issues, pull requests, commits, and gists */ public function comments() @@ -59,6 +69,8 @@ public function comments() /** * Returns the number of GitHub Pages sites. * + * @link https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-pages-statistics + * * @return array array with totals of GitHub Pages sites */ public function pages() @@ -69,6 +81,8 @@ public function pages() /** * Returns the number of suspended and admin users. * + * @link https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-users-statistics + * * @return array array with totals of suspended and admin users */ public function users() @@ -79,6 +93,8 @@ public function users() /** * Returns the number of private and public gists. * + * @link https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-gist-statistics + * * @return array array with totals of private and public gists */ public function gists() @@ -89,6 +105,8 @@ public function gists() /** * Returns the number of merged, mergeable, and unmergeable pull requests. * + * @link https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-pull-request-statistics + * * @return array array with totals of merged, mergeable, and unmergeable pull requests */ public function pulls() @@ -99,6 +117,8 @@ public function pulls() /** * Returns the number of organization-owned repositories, root repositories, forks, pushed commits, and wikis. * + * @link https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-repository-statistics + * * @return array array with totals of organization-owned repositories, root repositories, forks, pushed commits, and wikis */ public function repos() @@ -109,6 +129,8 @@ public function repos() /** * Returns all of the statistics. * + * @link https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-all-statistics + * * @return array array with all of the statistics */ public function all() @@ -117,6 +139,8 @@ public function all() } /** + * @link https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats + * * @param string $type The type of statistics to show * * @return array diff --git a/lib/Github/Api/Enterprise/UserAdmin.php b/lib/Github/Api/Enterprise/UserAdmin.php index 0cd55a38c53..eb5060c3d20 100644 --- a/lib/Github/Api/Enterprise/UserAdmin.php +++ b/lib/Github/Api/Enterprise/UserAdmin.php @@ -9,7 +9,7 @@ class UserAdmin extends AbstractApi /** * Suspend a user. * - * @link https://developer.github.com/v3/users/administration/#suspend-a-user + * @link https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#suspend-a-user * * @param string $username * @@ -23,7 +23,7 @@ public function suspend($username) /** * Unsuspend a user. * - * @link https://developer.github.com/v3/users/administration/#unsuspend-a-user + * @link https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#unsuspend-a-user * * @param string $username * diff --git a/lib/Github/Api/Environment/Secrets.php b/lib/Github/Api/Environment/Secrets.php index cef84c34958..e62b323ed88 100644 --- a/lib/Github/Api/Environment/Secrets.php +++ b/lib/Github/Api/Environment/Secrets.php @@ -5,12 +5,12 @@ use Github\Api\AbstractApi; /** - * @link https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28 + * @link https://docs.github.com/rest/actions/secrets */ class Secrets extends AbstractApi { /** - * @link https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#list-environment-secrets + * @link https://docs.github.com/rest/actions/secrets#list-environment-secrets * * @param int $id * @param string $name @@ -23,7 +23,7 @@ public function all(int $id, string $name) } /** - * @link https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#get-an-environment-secret + * @link https://docs.github.com/rest/actions/secrets#get-an-environment-secret * * @param int $id * @param string $name @@ -37,7 +37,7 @@ public function show(int $id, string $name, string $secretName) } /** - * @link https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#create-or-update-an-environment-secret + * @link https://docs.github.com/rest/actions/secrets#create-or-update-an-environment-secret * * @param int $id * @param string $name @@ -52,7 +52,7 @@ public function createOrUpdate(int $id, string $name, string $secretName, array } /** - * @link https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#delete-an-environment-secret + * @link https://docs.github.com/rest/actions/secrets#delete-an-environment-secret * * @param int $id * @param string $name @@ -66,7 +66,7 @@ public function remove(int $id, string $name, string $secretName) } /** - * @link https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#get-an-environment-public-key + * @link https://docs.github.com/rest/actions/secrets#get-an-environment-public-key * * @param int $id * @param string $name diff --git a/lib/Github/Api/Environment/Variables.php b/lib/Github/Api/Environment/Variables.php index 035a8f605a3..862b0983858 100644 --- a/lib/Github/Api/Environment/Variables.php +++ b/lib/Github/Api/Environment/Variables.php @@ -5,12 +5,12 @@ use Github\Api\AbstractApi; /** - * @link https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28 + * @link https://docs.github.com/rest/actions/variables */ class Variables extends AbstractApi { /** - * @link https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#list-environment-variables + * @link https://docs.github.com/rest/actions/variables#list-environment-variables * * @param int $id * @param string $name @@ -23,7 +23,7 @@ public function all(int $id, string $name) } /** - * @link https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#get-an-environment-variable + * @link https://docs.github.com/rest/actions/variables#get-an-environment-variable * * @param int $id * @param string $name @@ -37,7 +37,7 @@ public function show(int $id, string $name, string $variableName) } /** - * @link https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#create-an-environment-variable + * @link https://docs.github.com/rest/actions/variables#create-an-environment-variable * * @param int $id * @param string $name @@ -51,7 +51,7 @@ public function create(int $id, string $name, array $parameters) } /** - * @link https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#update-an-environment-variable + * @link https://docs.github.com/rest/actions/variables#update-an-environment-variable * * @param int $id * @param string $name @@ -66,7 +66,7 @@ public function update(int $id, string $name, string $variableName, array $param } /** - * @link https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#delete-an-environment-variable + * @link https://docs.github.com/rest/actions/variables#delete-an-environment-variable * * @param int $id * @param string $name diff --git a/lib/Github/Api/Gist/Comments.php b/lib/Github/Api/Gist/Comments.php index 31587d94016..48d694be359 100644 --- a/lib/Github/Api/Gist/Comments.php +++ b/lib/Github/Api/Gist/Comments.php @@ -6,7 +6,7 @@ use Github\Api\AcceptHeaderTrait; /** - * @link https://developer.github.com/v3/gists/comments/ + * @link https://docs.github.com/rest/gists/comments * * @author Kayla Daniels */ @@ -17,7 +17,7 @@ class Comments extends AbstractApi /** * Configure the body type. * - * @link https://developer.github.com/v3/gists/comments/#custom-media-types + * @link https://docs.github.com/rest/gists/comments * * @param string|null $bodyType * @@ -37,6 +37,8 @@ public function configure($bodyType = null) /** * Get all comments for a gist. * + * @link https://docs.github.com/rest/gists/comments#list-gist-comments + * * @param string $gist * * @return array @@ -49,6 +51,8 @@ public function all($gist) /** * Get a comment of a gist. * + * @link https://docs.github.com/rest/gists/comments#get-a-gist-comment + * * @param string $gist * @param int $comment * @@ -62,6 +66,8 @@ public function show($gist, $comment) /** * Create a comment for gist. * + * @link https://docs.github.com/rest/gists/comments#create-a-gist-comment + * * @param string $gist * @param string $body * @@ -75,6 +81,8 @@ public function create($gist, $body) /** * Create a comment for a gist. * + * @link https://docs.github.com/rest/gists/comments#update-a-gist-comment + * * @param string $gist * @param int $comment_id * @param string $body @@ -89,6 +97,8 @@ public function update($gist, $comment_id, $body) /** * Delete a comment for a gist. * + * @link https://docs.github.com/rest/gists/comments#delete-a-gist-comment + * * @param string $gist * @param int $comment * diff --git a/lib/Github/Api/Gists.php b/lib/Github/Api/Gists.php index 42bbdb9c97b..8556428ff7a 100644 --- a/lib/Github/Api/Gists.php +++ b/lib/Github/Api/Gists.php @@ -8,7 +8,7 @@ /** * Creating, editing, deleting and listing gists. * - * @link http://developer.github.com/v3/gists/ + * @link https://docs.github.com/rest/gists/gists * * @author Joseph Bielawski * @author Edoardo Rivello @@ -20,7 +20,7 @@ class Gists extends AbstractApi /** * Configure the body type. * - * @link https://developer.github.com/v3/gists/#custom-media-types + * @link https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api * * @param string|null $bodyType * @@ -38,6 +38,10 @@ public function configure($bodyType = null) } /** + * List gists (for the authenticated user, public, or starred, depending on $type). + * + * @link https://docs.github.com/rest/gists/gists + * * @param string|null $type * * @return array|string @@ -52,6 +56,10 @@ public function all($type = null) } /** + * Get a gist. + * + * @link https://docs.github.com/rest/gists/gists#get-a-gist + * * @param string $number * * @return array @@ -64,11 +72,11 @@ public function show($number) /** * Get a specific revision of a gist. * + * @link https://docs.github.com/rest/gists/gists#get-a-gist-revision + * * @param string $number * @param string $sha * - * @link https://developer.github.com/v3/gists/#get-a-specific-revision-of-a-gist - * * @return array */ public function revision($number, $sha) @@ -76,6 +84,17 @@ public function revision($number, $sha) return $this->get('/gists/'.rawurlencode($number).'/'.rawurlencode($sha)); } + /** + * Create a gist. + * + * @link https://docs.github.com/rest/gists/gists#create-a-gist + * + * @param array $params + * + * @throws MissingArgumentException + * + * @return array + */ public function create(array $params) { if (!isset($params['files']) || (!is_array($params['files']) || 0 === count($params['files']))) { @@ -88,6 +107,10 @@ public function create(array $params) } /** + * Update a gist. + * + * @link https://docs.github.com/rest/gists/gists#update-a-gist + * * @param string $id * @param array $params * @@ -99,6 +122,10 @@ public function update($id, array $params) } /** + * List gist commits. + * + * @link https://docs.github.com/rest/gists/gists#list-gist-commits + * * @param string $id * * @return array @@ -109,6 +136,10 @@ public function commits($id) } /** + * Fork a gist. + * + * @link https://docs.github.com/rest/gists/gists#fork-a-gist + * * @param string $id * * @return array @@ -119,6 +150,10 @@ public function fork($id) } /** + * List gist forks. + * + * @link https://docs.github.com/rest/gists/gists#list-gist-forks + * * @param string $id * * @return array @@ -129,6 +164,10 @@ public function forks($id) } /** + * Delete a gist. + * + * @link https://docs.github.com/rest/gists/gists#delete-a-gist + * * @param string $id * * @return array @@ -139,6 +178,10 @@ public function remove($id) } /** + * Check if a gist is starred. + * + * @link https://docs.github.com/rest/gists/gists#check-if-a-gist-is-starred + * * @param string $id * * @return array @@ -149,6 +192,10 @@ public function check($id) } /** + * Star a gist. + * + * @link https://docs.github.com/rest/gists/gists#star-a-gist + * * @param string $id * * @return array @@ -159,6 +206,10 @@ public function star($id) } /** + * Unstar a gist. + * + * @link https://docs.github.com/rest/gists/gists#unstar-a-gist + * * @param string $id * * @return array @@ -171,7 +222,7 @@ public function unstar($id) /** * Get a gist's comments. * - * @link http://developer.github.com/v3/gists/comments/ + * @link https://docs.github.com/rest/gists/comments * * @return Comments */ diff --git a/lib/Github/Api/GitData.php b/lib/Github/Api/GitData.php index b7a9f48c344..f498b2199fc 100644 --- a/lib/Github/Api/GitData.php +++ b/lib/Github/Api/GitData.php @@ -11,7 +11,7 @@ /** * Getting full versions of specific files and trees in your Git repositories. * - * @link http://developer.github.com/v3/git/ + * @link https://docs.github.com/rest/git * * @author Joseph Bielawski */ diff --git a/lib/Github/Api/GitData/Blobs.php b/lib/Github/Api/GitData/Blobs.php index 31aacda5674..373406a5bb6 100644 --- a/lib/Github/Api/GitData/Blobs.php +++ b/lib/Github/Api/GitData/Blobs.php @@ -7,7 +7,7 @@ use Github\Exception\MissingArgumentException; /** - * @link http://developer.github.com/v3/git/blobs/ + * @link https://docs.github.com/rest/git/blobs * * @author Joseph Bielawski * @author Tobias Nyholm @@ -19,6 +19,8 @@ class Blobs extends AbstractApi /** * Configure the Accept header depending on the blob type. * + * @link https://docs.github.com/rest/git/blobs#get-a-blob + * * @param string|null $bodyType * * @return $this @@ -35,6 +37,8 @@ public function configure($bodyType = null) /** * Show a blob of a sha for a repository. * + * @link https://docs.github.com/rest/git/blobs#get-a-blob + * * @param string $username * @param string $repository * @param string $sha @@ -49,6 +53,8 @@ public function show($username, $repository, $sha) /** * Create a blob of a sha for a repository. * + * @link https://docs.github.com/rest/git/blobs#create-a-blob + * * @param string $username * @param string $repository * @param array $params diff --git a/lib/Github/Api/GitData/Commits.php b/lib/Github/Api/GitData/Commits.php index 4205931f408..99a945aa3fd 100644 --- a/lib/Github/Api/GitData/Commits.php +++ b/lib/Github/Api/GitData/Commits.php @@ -6,7 +6,7 @@ use Github\Exception\MissingArgumentException; /** - * @link http://developer.github.com/v3/git/commits/ + * @link https://docs.github.com/rest/git/commits * * @author Joseph Bielawski */ @@ -15,6 +15,8 @@ class Commits extends AbstractApi /** * Show a commit for a repository. * + * @link https://docs.github.com/rest/git/commits#get-a-commit-object + * * @param string $username * @param string $repository * @param string $sha @@ -29,6 +31,8 @@ public function show($username, $repository, $sha) /** * Create a commit for a repository. * + * @link https://docs.github.com/rest/git/commits#create-a-commit + * * @param string $username * @param string $repository * @param array $params diff --git a/lib/Github/Api/GitData/References.php b/lib/Github/Api/GitData/References.php index d67cbe512b9..d91b09802c3 100644 --- a/lib/Github/Api/GitData/References.php +++ b/lib/Github/Api/GitData/References.php @@ -6,7 +6,7 @@ use Github\Exception\MissingArgumentException; /** - * @link http://developer.github.com/v3/git/references/ + * @link https://docs.github.com/rest/git/refs * * @author Joseph Bielawski */ @@ -15,6 +15,8 @@ class References extends AbstractApi /** * Get all references of a repository. * + * @link https://docs.github.com/rest/git/refs#list-matching-references + * * @param string $username * @param string $repository * @@ -28,6 +30,8 @@ public function all($username, $repository) /** * Get all matching references for the supplied reference name. * + * @link https://docs.github.com/rest/git/refs#list-matching-references + * * @param string $username * @param string $repository * @param string $reference @@ -44,6 +48,8 @@ public function matching(string $username, string $repository, string $reference /** * Get all branches of a repository. * + * @link https://docs.github.com/rest/git/refs#list-matching-references + * * @param string $username * @param string $repository * @@ -57,6 +63,8 @@ public function branches($username, $repository) /** * Get all tags of a repository. * + * @link https://docs.github.com/rest/git/refs#list-matching-references + * * @param string $username * @param string $repository * @@ -70,6 +78,8 @@ public function tags($username, $repository) /** * Show the reference of a repository. * + * @link https://docs.github.com/rest/git/refs#get-a-reference + * * @param string $username * @param string $repository * @param string $reference @@ -86,6 +96,8 @@ public function show($username, $repository, $reference) /** * Create a reference for a repository. * + * @link https://docs.github.com/rest/git/refs#create-a-reference + * * @param string $username * @param string $repository * @param array $params @@ -106,6 +118,8 @@ public function create($username, $repository, array $params) /** * Update a reference for a repository. * + * @link https://docs.github.com/rest/git/refs#update-a-reference + * * @param string $username * @param string $repository * @param string $reference @@ -129,6 +143,8 @@ public function update($username, $repository, $reference, array $params) /** * Delete a reference of a repository. * + * @link https://docs.github.com/rest/git/refs#delete-a-reference + * * @param string $username * @param string $repository * @param string $reference diff --git a/lib/Github/Api/GitData/Tags.php b/lib/Github/Api/GitData/Tags.php index 11bf200a31f..fb0ef4dea18 100644 --- a/lib/Github/Api/GitData/Tags.php +++ b/lib/Github/Api/GitData/Tags.php @@ -6,7 +6,7 @@ use Github\Exception\MissingArgumentException; /** - * @link http://developer.github.com/v3/git/tags/ + * @link https://docs.github.com/rest/git/tags * * @author Joseph Bielawski */ @@ -15,6 +15,8 @@ class Tags extends AbstractApi /** * Get all tags for a repository. * + * @link https://docs.github.com/rest/git/refs#list-matching-references + * * @param string $username * @param string $repository * @@ -28,6 +30,8 @@ public function all($username, $repository) /** * Get a tag for a repository. * + * @link https://docs.github.com/rest/git/tags#get-a-tag + * * @param string $username * @param string $repository * @param string $sha @@ -42,6 +46,8 @@ public function show($username, $repository, $sha) /** * Create a tag for a repository. * + * @link https://docs.github.com/rest/git/tags#create-a-tag-object + * * @param string $username * @param string $repository * @param array $params diff --git a/lib/Github/Api/GitData/Trees.php b/lib/Github/Api/GitData/Trees.php index 939e8619b73..6009d39765d 100644 --- a/lib/Github/Api/GitData/Trees.php +++ b/lib/Github/Api/GitData/Trees.php @@ -6,7 +6,7 @@ use Github\Exception\MissingArgumentException; /** - * @link http://developer.github.com/v3/git/trees/ + * @link https://docs.github.com/rest/git/trees * * @author Joseph Bielawski */ @@ -15,6 +15,8 @@ class Trees extends AbstractApi /** * Get the tree for a repository. * + * @link https://docs.github.com/rest/git/trees#get-a-tree + * * @param string $username * @param string $repository * @param string $sha @@ -30,6 +32,8 @@ public function show($username, $repository, $sha, $recursive = false) /** * Create tree for a repository. * + * @link https://docs.github.com/rest/git/trees#create-a-tree + * * @param string $username * @param string $repository * @param array $params diff --git a/lib/Github/Api/GraphQL.php b/lib/Github/Api/GraphQL.php index 02499ad8ef7..655028fdf37 100644 --- a/lib/Github/Api/GraphQL.php +++ b/lib/Github/Api/GraphQL.php @@ -7,7 +7,7 @@ * * Part of the Github v4 API * - * @link https://developer.github.com/v4/ + * @link https://docs.github.com/graphql * * @author Miguel Piedrafita */ @@ -16,6 +16,10 @@ class GraphQL extends AbstractApi use AcceptHeaderTrait; /** + * Execute a GraphQL query. + * + * @link https://docs.github.com/graphql + * * @param string $query * @param array $variables * @param string $acceptHeaderValue @@ -36,6 +40,10 @@ public function execute($query, array $variables = [], string $acceptHeaderValue } /** + * Execute a GraphQL query read from a file. + * + * @link https://docs.github.com/graphql + * * @param string $file * @param array $variables * diff --git a/lib/Github/Api/Issue.php b/lib/Github/Api/Issue.php index 764f5e442a9..0d3b73701de 100644 --- a/lib/Github/Api/Issue.php +++ b/lib/Github/Api/Issue.php @@ -13,7 +13,7 @@ /** * Listing issues, searching, editing and closing your projects issues. * - * @link http://develop.github.com/p/issues.html + * @link https://docs.github.com/rest/issues/issues * * @author Thibault Duplessis * @author Joseph Bielawski @@ -25,7 +25,7 @@ class Issue extends AbstractApi /** * Configure the body type. * - * @link https://developer.github.com/v3/issues/#custom-media-types + * @link https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api * * @param string|null $bodyType * @@ -45,7 +45,7 @@ public function configure($bodyType = null) /** * List issues by username, repo and state. * - * @link http://developer.github.com/v3/issues/ + * @link https://docs.github.com/rest/issues/issues#list-repository-issues * * @param string $username the username * @param string $repository the repository @@ -61,7 +61,7 @@ public function all($username, $repository, array $params = []) /** * List issues by organization. * - * @link http://developer.github.com/v3/issues/ + * @link https://docs.github.com/rest/issues/issues#list-organization-issues-assigned-to-the-authenticated-user * * @param string $organization the organization * @param string $state the issue state, can be open or closed @@ -81,7 +81,7 @@ public function org($organization, $state, array $params = []) /** * Get extended information about an issue by its username, repo and number. * - * @link http://developer.github.com/v3/issues/ + * @link https://docs.github.com/rest/issues/issues#get-an-issue * * @param string $username the username * @param string $repository the repository @@ -98,7 +98,7 @@ public function show($username, $repository, $id) * Create a new issue for the given username and repo. * The issue is assigned to the authenticated user. Requires authentication. * - * @link http://developer.github.com/v3/issues/ + * @link https://docs.github.com/rest/issues/issues#create-an-issue * * @param string $username the username * @param string $repository the repository @@ -120,7 +120,7 @@ public function create($username, $repository, array $params) /** * Update issue information's by username, repo and issue number. Requires authentication. * - * @link http://developer.github.com/v3/issues/ + * @link https://docs.github.com/rest/issues/issues#update-an-issue * * @param string $username the username * @param string $repository the repository @@ -138,7 +138,7 @@ public function update($username, $repository, $id, array $params) /** * Lock an issue. Users with push access can lock an issue's conversation. * - * @link https://developer.github.com/v3/issues/#lock-an-issue + * @link https://docs.github.com/rest/issues/issues#lock-an-issue * * @param string $username * @param string $repository @@ -154,7 +154,7 @@ public function lock($username, $repository, $id) /** * Unlock an issue. Users with push access can unlock an issue's conversation. * - * @link https://developer.github.com/v3/issues/#lock-an-issue + * @link https://docs.github.com/rest/issues/issues#unlock-an-issue * * @param string $username * @param string $repository @@ -170,7 +170,7 @@ public function unlock($username, $repository, $id) /** * List an issue comments. * - * @link http://developer.github.com/v3/issues/comments/ + * @link https://docs.github.com/rest/issues/comments * * @return Comments */ @@ -182,7 +182,7 @@ public function comments() /** * List all project events. * - * @link http://developer.github.com/v3/issues/events/ + * @link https://docs.github.com/rest/issues/events * * @return Events */ @@ -194,7 +194,7 @@ public function events() /** * List all project labels. * - * @link http://developer.github.com/v3/issues/labels/ + * @link https://docs.github.com/rest/issues/labels * * @return Labels */ @@ -206,7 +206,7 @@ public function labels() /** * List all project milestones. * - * @link http://developer.github.com/v3/issues/milestones/ + * @link https://docs.github.com/rest/issues/milestones * * @return Milestones */ @@ -218,7 +218,7 @@ public function milestones() /** * List all assignees. * - * @link https://developer.github.com/v3/issues/assignees/ + * @link https://docs.github.com/rest/issues/assignees * * @return Assignees */ @@ -230,7 +230,7 @@ public function assignees() /** * List all events. * - * @link https://developer.github.com/v3/issues/timeline/ + * @link https://docs.github.com/rest/issues/timeline * * @return Timeline */ diff --git a/lib/Github/Api/Issue/Assignees.php b/lib/Github/Api/Issue/Assignees.php index 46435650823..b765d9523ff 100644 --- a/lib/Github/Api/Issue/Assignees.php +++ b/lib/Github/Api/Issue/Assignees.php @@ -11,6 +11,8 @@ class Assignees extends AbstractApi /** * List all the available assignees to which issues may be assigned. * + * @link https://docs.github.com/rest/issues/assignees#list-assignees + * * @param string $username * @param string $repository * @param array $parameters @@ -25,7 +27,7 @@ public function listAvailable($username, $repository, array $parameters = []) /** * Check to see if a particular user is an assignee for a repository. * - * @link https://developer.github.com/v3/issues/assignees/#check-assignee + * @link https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned * * @param string $username * @param string $repository @@ -41,7 +43,7 @@ public function check($username, $repository, $assignee) /** * Add assignees to an Issue. * - * @link https://developer.github.com/v3/issues/assignees/#add-assignees-to-an-issue + * @link https://docs.github.com/rest/issues/assignees#add-assignees-to-an-issue * * @param string $username * @param string $repository @@ -69,7 +71,7 @@ public function add($username, $repository, $issue, array $parameters) /** * Remove assignees from an Issue. * - * @link https://developer.github.com/v3/issues/assignees/#remove-assignees-from-an-issue + * @link https://docs.github.com/rest/issues/assignees#remove-assignees-from-an-issue * * @param string $username * @param string $repository diff --git a/lib/Github/Api/Issue/Comments.php b/lib/Github/Api/Issue/Comments.php index b0fe878797f..7f7d231f81a 100644 --- a/lib/Github/Api/Issue/Comments.php +++ b/lib/Github/Api/Issue/Comments.php @@ -7,7 +7,7 @@ use Github\Exception\MissingArgumentException; /** - * @link http://developer.github.com/v3/issues/comments/ + * @link https://docs.github.com/rest/issues/comments * * @author Joseph Bielawski * @author Tobias Nyholm @@ -19,7 +19,7 @@ class Comments extends AbstractApi /** * Configure the body type. * - * @link https://developer.github.com/v3/issues/comments/#custom-media-types + * @link https://docs.github.com/rest/using-the-rest-api/media-types#media-types * * @param string|null $bodyType * @@ -39,7 +39,7 @@ public function configure($bodyType = null) /** * Get all comments for an issue. * - * @link https://developer.github.com/v3/issues/comments/#list-comments-on-an-issue + * @link https://docs.github.com/rest/issues/comments#list-issue-comments * * @param string $username * @param string $repository @@ -56,7 +56,7 @@ public function all($username, $repository, $issue, array $params = []) /** * Get a comment for an issue. * - * @link https://developer.github.com/v3/issues/comments/#get-a-single-comment + * @link https://docs.github.com/rest/issues/comments#get-an-issue-comment * * @param string $username * @param string $repository @@ -72,7 +72,7 @@ public function show($username, $repository, $comment) /** * Create a comment for an issue. * - * @link https://developer.github.com/v3/issues/comments/#create-a-comment + * @link https://docs.github.com/rest/issues/comments#create-an-issue-comment * * @param string $username * @param string $repository @@ -95,7 +95,7 @@ public function create($username, $repository, $issue, array $params) /** * Update a comment for an issue. * - * @link https://developer.github.com/v3/issues/comments/#edit-a-comment + * @link https://docs.github.com/rest/issues/comments#update-an-issue-comment * * @param string $username * @param string $repository @@ -118,7 +118,7 @@ public function update($username, $repository, $comment, array $params) /** * Delete a comment for an issue. * - * @link https://developer.github.com/v3/issues/comments/#delete-a-comment + * @link https://docs.github.com/rest/issues/comments#delete-an-issue-comment * * @param string $username * @param string $repository diff --git a/lib/Github/Api/Issue/Events.php b/lib/Github/Api/Issue/Events.php index a628b2c60bf..1e85915ca5e 100644 --- a/lib/Github/Api/Issue/Events.php +++ b/lib/Github/Api/Issue/Events.php @@ -5,7 +5,7 @@ use Github\Api\AbstractApi; /** - * @link http://developer.github.com/v3/issues/events/ + * @link https://docs.github.com/rest/issues/events * * @author Joseph Bielawski */ @@ -14,7 +14,7 @@ class Events extends AbstractApi /** * Get all events for an issue. * - * @link https://developer.github.com/v3/issues/events/#list-events-for-an-issue + * @link https://docs.github.com/rest/issues/events#list-issue-events * * @param string $username * @param string $repository @@ -39,7 +39,7 @@ public function all($username, $repository, $issue = null, $page = 1) /** * Display an event for an issue. * - * @link https://developer.github.com/v3/issues/events/#get-a-single-event + * @link https://docs.github.com/rest/issues/events#get-an-issue-event * * @param string $username * @param string $repository diff --git a/lib/Github/Api/Issue/Labels.php b/lib/Github/Api/Issue/Labels.php index 3cfad23d5b0..b73d1ee296c 100644 --- a/lib/Github/Api/Issue/Labels.php +++ b/lib/Github/Api/Issue/Labels.php @@ -7,7 +7,7 @@ use Github\Exception\MissingArgumentException; /** - * @link http://developer.github.com/v3/issues/labels/ + * @link https://docs.github.com/rest/issues/labels * * @author Joseph Bielawski */ @@ -16,7 +16,8 @@ class Labels extends AbstractApi /** * Get all labels for a repository or the labels for a specific issue. * - * @link https://developer.github.com/v3/issues/labels/#list-labels-on-an-issue + * @link https://docs.github.com/rest/issues/labels#list-labels-for-a-repository + * @link https://docs.github.com/rest/issues/labels#list-labels-for-an-issue * * @param string $username * @param string $repository @@ -38,7 +39,7 @@ public function all($username, $repository, $issue = null) /** * Get a single label. * - * @link https://developer.github.com/v3/issues/labels/#get-a-single-label + * @link https://docs.github.com/rest/issues/labels#get-a-label * * @param string $username * @param string $repository @@ -54,7 +55,7 @@ public function show($username, $repository, $label) /** * Create a label for a repository. * - * @link https://developer.github.com/v3/issues/labels/#create-a-label + * @link https://docs.github.com/rest/issues/labels#create-a-label * * @param string $username * @param string $repository @@ -79,7 +80,7 @@ public function create($username, $repository, array $params) /** * Delete a label for a repository. * - * @link https://developer.github.com/v3/issues/labels/#remove-a-label-from-an-issue + * @link https://docs.github.com/rest/issues/labels#delete-a-label * * @param string $username * @param string $repository @@ -95,7 +96,7 @@ public function deleteLabel($username, $repository, $label) /** * Edit a label for a repository. * - * @link https://developer.github.com/v3/issues/labels/#update-a-label + * @link https://docs.github.com/rest/issues/labels#update-a-label * * @param string $username * @param string $repository @@ -118,7 +119,7 @@ public function update($username, $repository, $label, $newName, $color) /** * Add a label to an issue. * - * @link https://developer.github.com/v3/issues/labels/#add-labels-to-an-issue + * @link https://docs.github.com/rest/issues/labels#add-labels-to-an-issue * * @param string $username * @param string $repository @@ -143,7 +144,7 @@ public function add($username, $repository, $issue, $labels) /** * Replace labels for an issue. * - * @link https://developer.github.com/v3/issues/labels/#replace-all-labels-for-an-issue + * @link https://docs.github.com/rest/issues/labels#set-labels-for-an-issue * * @param string $username * @param string $repository @@ -160,7 +161,7 @@ public function replace($username, $repository, $issue, array $params) /** * Remove a label for an issue. * - * @link https://developer.github.com/v3/issues/labels/#remove-a-label-from-an-issue + * @link https://docs.github.com/rest/issues/labels#remove-a-label-from-an-issue * * @param string $username * @param string $repository @@ -177,7 +178,7 @@ public function remove($username, $repository, $issue, $label) /** * Remove all labels from an issue. * - * @link https://developer.github.com/v3/issues/labels/#replace-all-labels-for-an-issue + * @link https://docs.github.com/rest/issues/labels#remove-all-labels-from-an-issue * * @param string $username * @param string $repository diff --git a/lib/Github/Api/Issue/Milestones.php b/lib/Github/Api/Issue/Milestones.php index fe9f2296dd6..72c3b6d57e7 100644 --- a/lib/Github/Api/Issue/Milestones.php +++ b/lib/Github/Api/Issue/Milestones.php @@ -6,7 +6,7 @@ use Github\Exception\MissingArgumentException; /** - * @link http://developer.github.com/v3/issues/milestones/ + * @link https://docs.github.com/rest/issues/milestones * * @author Joseph Bielawski */ @@ -15,7 +15,7 @@ class Milestones extends AbstractApi /** * Get all milestones for a repository. * - * @link https://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository + * @link https://docs.github.com/rest/issues/milestones#list-milestones * * @param string $username * @param string $repository @@ -46,7 +46,7 @@ public function all($username, $repository, array $params = []) /** * Get a milestone for a repository. * - * @link https://developer.github.com/v3/issues/milestones/#get-a-single-milestone + * @link https://docs.github.com/rest/issues/milestones#get-a-milestone * * @param string $username * @param string $repository @@ -62,7 +62,7 @@ public function show($username, $repository, $id) /** * Create a milestone for a repository. * - * @link https://developer.github.com/v3/issues/milestones/#create-a-milestone + * @link https://docs.github.com/rest/issues/milestones#create-a-milestone * * @param string $username * @param string $repository @@ -87,7 +87,7 @@ public function create($username, $repository, array $params) /** * Update a milestone for a repository. * - * @link https://developer.github.com/v3/issues/milestones/#update-a-milestone + * @link https://docs.github.com/rest/issues/milestones#update-a-milestone * * @param string $username * @param string $repository @@ -108,7 +108,7 @@ public function update($username, $repository, $id, array $params) /** * Delete a milestone for a repository. * - * @link https://developer.github.com/v3/issues/milestones/#delete-a-milestone + * @link https://docs.github.com/rest/issues/milestones#delete-a-milestone * * @param string $username * @param string $repository @@ -124,7 +124,7 @@ public function remove($username, $repository, $id) /** * Get the labels of a milestone. * - * @link https://developer.github.com/v3/issues/labels/#get-labels-for-every-issue-in-a-milestone + * @link https://docs.github.com/rest/issues/labels#list-labels-for-issues-in-a-milestone * * @param string $username * @param string $repository diff --git a/lib/Github/Api/Issue/Timeline.php b/lib/Github/Api/Issue/Timeline.php index 16ec4b069b2..40d02c93db7 100644 --- a/lib/Github/Api/Issue/Timeline.php +++ b/lib/Github/Api/Issue/Timeline.php @@ -9,6 +9,11 @@ class Timeline extends AbstractApi { use AcceptHeaderTrait; + /** + * Configure the accept header to use the timeline preview media type. + * + * @return $this + */ public function configure() { $this->acceptHeaderValue = 'application/vnd.github.mockingbird-preview'; @@ -19,7 +24,7 @@ public function configure() /** * Get all events for a specific issue. * - * @link https://developer.github.com/v3/issues/timeline/#list-events-for-an-issue + * @link https://docs.github.com/rest/issues/timeline#list-timeline-events-for-an-issue * * @param string $username * @param string $repository diff --git a/lib/Github/Api/Markdown.php b/lib/Github/Api/Markdown.php index 977b1d048e0..ba2d68fd854 100644 --- a/lib/Github/Api/Markdown.php +++ b/lib/Github/Api/Markdown.php @@ -5,13 +5,17 @@ /** * Markdown Rendering API. * - * @link http://developer.github.com/v3/markdown/ + * @link https://docs.github.com/rest/markdown/markdown * * @author Joseph Bielawski */ class Markdown extends AbstractApi { /** + * Render an arbitrary Markdown document. + * + * @link https://docs.github.com/rest/markdown/markdown#render-a-markdown-document + * * @param string $text * @param string $mode * @param string $context @@ -36,6 +40,10 @@ public function render($text, $mode = 'markdown', $context = null) } /** + * Render a Markdown document in raw mode. + * + * @link https://docs.github.com/rest/markdown/markdown#render-a-markdown-document-in-raw-mode + * * @param string $file * * @return string diff --git a/lib/Github/Api/Meta.php b/lib/Github/Api/Meta.php index 0ec81f65ef9..25c8eed39fe 100644 --- a/lib/Github/Api/Meta.php +++ b/lib/Github/Api/Meta.php @@ -5,7 +5,7 @@ /** * Getting GitHub service information. * - * @link https://developer.github.com/v3/meta/ + * @link https://docs.github.com/rest/meta/meta * * @author Claude Dioudonnat */ @@ -14,6 +14,8 @@ class Meta extends AbstractApi /** * Get the ip address of the hook and git servers for the GitHub.com service. * + * @link https://docs.github.com/rest/meta/meta#get-github-meta-information + * * @return array Information about the service of GitHub.com */ public function service() diff --git a/lib/Github/Api/Miscellaneous/CodeOfConduct.php b/lib/Github/Api/Miscellaneous/CodeOfConduct.php index 64bfaa8b420..cc3f9f5e46b 100644 --- a/lib/Github/Api/Miscellaneous/CodeOfConduct.php +++ b/lib/Github/Api/Miscellaneous/CodeOfConduct.php @@ -9,6 +9,11 @@ class CodeOfConduct extends AbstractApi { use AcceptHeaderTrait; + /** + * Configure the accept header for the codes of conduct preview API. + * + * @return $this + */ public function configure() { $this->acceptHeaderValue = 'application/vnd.github.scarlet-witch-preview+json'; @@ -19,7 +24,7 @@ public function configure() /** * List all codes of conduct. * - * @link https://developer.github.com/v3/codes_of_conduct/#list-all-codes-of-conduct + * @link https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-all-codes-of-conduct * * @return array */ @@ -31,7 +36,7 @@ public function all() /** * Get an individual code of conduct. * - * @link https://developer.github.com/v3/codes_of_conduct/#get-an-individual-code-of-conduct + * @link https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-a-code-of-conduct * * @param string $key * diff --git a/lib/Github/Api/Miscellaneous/Emojis.php b/lib/Github/Api/Miscellaneous/Emojis.php index 2a940f6dfb7..524f8694450 100644 --- a/lib/Github/Api/Miscellaneous/Emojis.php +++ b/lib/Github/Api/Miscellaneous/Emojis.php @@ -9,7 +9,7 @@ class Emojis extends AbstractApi /** * Lists all the emojis available to use on GitHub. * - * @link https://developer.github.com/v3/emojis/ + * @link https://docs.github.com/rest/emojis/emojis#get-emojis * * @return array */ diff --git a/lib/Github/Api/Miscellaneous/Gitignore.php b/lib/Github/Api/Miscellaneous/Gitignore.php index c5f03e7e0e0..2636198d861 100644 --- a/lib/Github/Api/Miscellaneous/Gitignore.php +++ b/lib/Github/Api/Miscellaneous/Gitignore.php @@ -9,7 +9,7 @@ class Gitignore extends AbstractApi /** * List all templates available to pass as an option when creating a repository. * - * @link https://developer.github.com/v3/gitignore/#listing-available-templates + * @link https://docs.github.com/rest/gitignore/gitignore#get-all-gitignore-templates * * @return array */ @@ -21,7 +21,7 @@ public function all() /** * Get a single template. * - * @link https://developer.github.com/v3/gitignore/#get-a-single-template + * @link https://docs.github.com/rest/gitignore/gitignore#get-a-gitignore-template * * @param string $template * diff --git a/lib/Github/Api/Miscellaneous/Licenses.php b/lib/Github/Api/Miscellaneous/Licenses.php index f8e55782a89..319661179cb 100644 --- a/lib/Github/Api/Miscellaneous/Licenses.php +++ b/lib/Github/Api/Miscellaneous/Licenses.php @@ -9,7 +9,7 @@ class Licenses extends AbstractApi /** * Lists all the licenses available on GitHub. * - * @link https://developer.github.com/v3/licenses/ + * @link https://docs.github.com/rest/licenses/licenses#get-all-commonly-used-licenses * * @return array */ @@ -21,7 +21,7 @@ public function all() /** * Get an individual license by its license key. * - * @link https://developer.github.com/v3/licenses/#get-an-individual-license + * @link https://docs.github.com/rest/licenses/licenses#get-a-license * * @param string $license * diff --git a/lib/Github/Api/Notification.php b/lib/Github/Api/Notification.php index f720ad0c88c..cfe554ad8cf 100644 --- a/lib/Github/Api/Notification.php +++ b/lib/Github/Api/Notification.php @@ -9,7 +9,7 @@ * * Important! You have to be authenticated to perform these methods * - * @link https://developer.github.com/v3/activity/notifications/ + * @link https://docs.github.com/rest/activity/notifications * * @author Dennis de Greef */ @@ -18,7 +18,7 @@ class Notification extends AbstractApi /** * Get a listing of notifications. * - * @link https://developer.github.com/v3/activity/notifications/ + * @link https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user * * @param bool $includingRead * @param bool $participating @@ -50,7 +50,7 @@ public function all($includingRead = false, $participating = false, ?DateTime $s * * Optionally give DateTime to mark as read before that date. * - * @link https://developer.github.com/v3/activity/notifications/#mark-as-read + * @link https://docs.github.com/rest/activity/notifications#mark-notifications-as-read * * @param DateTime|null $since */ @@ -68,7 +68,7 @@ public function markRead(?DateTime $since = null) /** * Mark a single thread as read using its ID. * - * @link https://developer.github.com/v3/activity/notifications/#mark-a-thread-as-read + * @link https://docs.github.com/rest/activity/notifications#mark-a-thread-as-read * * @param int $id */ @@ -80,7 +80,7 @@ public function markThreadRead($id) /** * Gets a single thread using its ID. * - * @link https://developer.github.com/v3/activity/notifications/#view-a-single-thread + * @link https://docs.github.com/rest/activity/notifications#get-a-thread * * @param int $id */ diff --git a/lib/Github/Api/Organization.php b/lib/Github/Api/Organization.php index 0e1210c95b6..623ff168774 100644 --- a/lib/Github/Api/Organization.php +++ b/lib/Github/Api/Organization.php @@ -15,7 +15,7 @@ /** * Getting organization information and managing authenticated organization account information. * - * @link http://developer.github.com/v3/orgs/ + * @link https://docs.github.com/rest/orgs/orgs * * @author Antoine Berranger * @author Joseph Bielawski @@ -23,7 +23,9 @@ class Organization extends AbstractApi { /** - * @link https://developer.github.com/v3/orgs/#list-all-organizations + * List all organizations, in the order that they were created on GitHub. + * + * @link https://docs.github.com/rest/orgs/orgs#list-organizations * * @return array the organizations */ @@ -35,7 +37,7 @@ public function all($since = '') /** * Get extended information about an organization by its name. * - * @link http://developer.github.com/v3/orgs/#get + * @link https://docs.github.com/rest/orgs/orgs#get-an-organization * * @param string $organization the organization to show * @@ -46,6 +48,16 @@ public function show($organization) return $this->get('/orgs/'.rawurlencode($organization)); } + /** + * Update the profile and default preferences of an organization. + * + * @link https://docs.github.com/rest/orgs/orgs#update-an-organization + * + * @param string $organization the organization to update + * @param array $params the parameters to update (e.g. billing_email, company, name, description) + * + * @return array + */ public function update($organization, array $params) { return $this->patch('/orgs/'.rawurlencode($organization), $params); @@ -54,7 +66,7 @@ public function update($organization, array $params) /** * List all repositories across all the organizations that you can access. * - * @link http://developer.github.com/v3/repos/#list-organization-repositories + * @link https://docs.github.com/rest/repos/repos#list-organization-repositories * * @param string $organization the user name * @param string $type the type of repositories @@ -131,7 +143,9 @@ public function outsideCollaborators() } /** - * @link http://developer.github.com/v3/issues/#list-issues + * List issues in an organization assigned to the authenticated user. + * + * @link https://docs.github.com/rest/issues/issues#list-organization-issues-assigned-to-the-authenticated-user * * @param string $organization * @param array $params @@ -160,6 +174,9 @@ public function secretScanning(): SecretScanning return new SecretScanning($this->getClient()); } + /** + * @return OrganizationRoles + */ public function organizationRoles(): OrganizationRoles { return new OrganizationRoles($this->getClient()); diff --git a/lib/Github/Api/Organization/Actions/Secrets.php b/lib/Github/Api/Organization/Actions/Secrets.php index 819e2c46738..f8c87849249 100644 --- a/lib/Github/Api/Organization/Actions/Secrets.php +++ b/lib/Github/Api/Organization/Actions/Secrets.php @@ -5,12 +5,12 @@ use Github\Api\AbstractApi; /** - * @link https://docs.github.com/en/rest/reference/actions#secrets + * @link https://docs.github.com/rest/actions/secrets */ class Secrets extends AbstractApi { /** - * @link https://docs.github.com/en/rest/reference/actions#list-organization-secrets + * @link https://docs.github.com/rest/actions/secrets#list-organization-secrets * * @param string $organization * @@ -22,7 +22,7 @@ public function all(string $organization) } /** - * @link https://docs.github.com/en/rest/reference/actions#get-an-organization-secret + * @link https://docs.github.com/rest/actions/secrets#get-an-organization-secret * * @param string $organization * @param string $secretName @@ -35,7 +35,7 @@ public function show(string $organization, string $secretName) } /** - * @link https://docs.github.com/en/rest/reference/actions#create-or-update-an-organization-secret + * @link https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret * * @param string $organization * @param string $secretName @@ -49,7 +49,7 @@ public function create(string $organization, string $secretName, array $paramete } /** - * @link https://docs.github.com/en/rest/reference/actions#create-or-update-an-organization-secret + * @link https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret * * @param string $organization * @param string $secretName @@ -63,7 +63,7 @@ public function update(string $organization, string $secretName, array $paramete } /** - * @link https://docs.github.com/en/rest/reference/actions#delete-an-organization-secret + * @link https://docs.github.com/rest/actions/secrets#delete-an-organization-secret * * @param string $organization * @param string $secretName @@ -76,7 +76,7 @@ public function remove(string $organization, string $secretName) } /** - * @link https://docs.github.com/en/rest/reference/actions#list-selected-repositories-for-an-organization-secret + * @link https://docs.github.com/rest/actions/secrets#list-selected-repositories-for-an-organization-secret * * @param string $organization * @param string $secretName @@ -89,7 +89,7 @@ public function selectedRepositories(string $organization, string $secretName) } /** - * @link https://docs.github.com/en/rest/reference/actions#set-selected-repositories-for-an-organization-secret + * @link https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret * * @param string $organization * @param string $secretName @@ -103,7 +103,7 @@ public function setSelectedRepositories(string $organization, string $secretName } /** - * @link https://docs.github.com/en/rest/reference/actions#add-selected-repository-to-an-organization-secret + * @link https://docs.github.com/rest/actions/secrets#add-selected-repository-to-an-organization-secret * * @param string $organization * @param string $repositoryId @@ -117,7 +117,7 @@ public function addSecret(string $organization, string $repositoryId, string $se } /** - * @link https://docs.github.com/en/rest/reference/actions#remove-selected-repository-from-an-organization-secret + * @link https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret * * @param string $organization * @param string $repositoryId @@ -131,7 +131,7 @@ public function removeSecret(string $organization, string $repositoryId, string } /** - * @link https://docs.github.com/en/rest/reference/actions#get-an-organization-public-key + * @link https://docs.github.com/rest/actions/secrets#get-an-organization-public-key * * @param string $organization * diff --git a/lib/Github/Api/Organization/Actions/SelfHostedRunners.php b/lib/Github/Api/Organization/Actions/SelfHostedRunners.php index f0b989f5751..ead98c702dc 100644 --- a/lib/Github/Api/Organization/Actions/SelfHostedRunners.php +++ b/lib/Github/Api/Organization/Actions/SelfHostedRunners.php @@ -7,7 +7,7 @@ class SelfHostedRunners extends AbstractApi { /** - * @link https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-an-organization + * @link https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization * * @param string $organization * @param array $parameters @@ -20,7 +20,7 @@ public function all(string $organization, array $parameters = []) } /** - * @link https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#get-a-self-hosted-runner-for-an-organization + * @link https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-organization * * @param string $organization * @param int $runnerId @@ -33,7 +33,7 @@ public function show(string $organization, int $runnerId) } /** - * @link https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-organization + * @link https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-organization * * @param string $organization * @param int $runnerId @@ -46,7 +46,7 @@ public function remove(string $organization, int $runnerId) } /** - * @link https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-organization + * @link https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization * * @param string $organization * diff --git a/lib/Github/Api/Organization/Actions/Variables.php b/lib/Github/Api/Organization/Actions/Variables.php index 88c037238d3..5d8e75afe5c 100644 --- a/lib/Github/Api/Organization/Actions/Variables.php +++ b/lib/Github/Api/Organization/Actions/Variables.php @@ -5,12 +5,12 @@ use Github\Api\AbstractApi; /** - * @link https://docs.github.com/en/rest/reference/actions#variables + * @link https://docs.github.com/rest/actions/variables */ class Variables extends AbstractApi { /** - * @link https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#list-organization-variables + * @link https://docs.github.com/rest/actions/variables#list-organization-variables * * @param string $organization * @@ -22,7 +22,7 @@ public function all(string $organization) } /** - * @link https://docs.github.com/en/rest/reference/actions#get-an-organization-secret + * @link https://docs.github.com/rest/actions/variables#get-an-organization-variable * * @param string $organization * @param string $variableName @@ -35,7 +35,7 @@ public function show(string $organization, string $variableName) } /** - * @link https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#create-an-organization-variable + * @link https://docs.github.com/rest/actions/variables#create-an-organization-variable * * @param string $organization * @param array $parameters @@ -48,7 +48,7 @@ public function create(string $organization, array $parameters) } /** - * @link https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#update-an-organization-variable + * @link https://docs.github.com/rest/actions/variables#update-an-organization-variable * * @param string $organization * @param string $variableName @@ -62,7 +62,7 @@ public function update(string $organization, string $variableName, array $parame } /** - * @link https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#delete-an-organization-variable + * @link https://docs.github.com/rest/actions/variables#delete-an-organization-variable * * @param string $organization * @param string $variableName @@ -75,7 +75,7 @@ public function remove(string $organization, string $variableName) } /** - * @link https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#list-selected-repositories-for-an-organization-variable + * @link https://docs.github.com/rest/actions/variables#list-selected-repositories-for-an-organization-variable * * @param string $organization * @param string $variableName @@ -88,7 +88,7 @@ public function selectedRepositories(string $organization, string $variableName) } /** - * @link https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#set-selected-repositories-for-an-organization-variable + * @link https://docs.github.com/rest/actions/variables#set-selected-repositories-for-an-organization-variable * * @param string $organization * @param string $variableName @@ -102,7 +102,7 @@ public function setSelectedRepositories(string $organization, string $variableNa } /** - * @link https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#add-selected-repository-to-an-organization-variable + * @link https://docs.github.com/rest/actions/variables#add-selected-repository-to-an-organization-variable * * @param string $organization * @param int $repositoryId @@ -116,7 +116,7 @@ public function addRepository(string $organization, int $repositoryId, string $v } /** - * @link https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#remove-selected-repository-from-an-organization-variable + * @link https://docs.github.com/rest/actions/variables#remove-selected-repository-from-an-organization-variable * * @param string $organization * @param int $repositoryId diff --git a/lib/Github/Api/Organization/Hooks.php b/lib/Github/Api/Organization/Hooks.php index 945cabc8667..77e793c79d3 100644 --- a/lib/Github/Api/Organization/Hooks.php +++ b/lib/Github/Api/Organization/Hooks.php @@ -10,7 +10,7 @@ class Hooks extends AbstractApi /** * List hooks. * - * @link https://developer.github.com/v3/orgs/hooks/#list-hooks + * @link https://docs.github.com/rest/orgs/webhooks#list-organization-webhooks * * @param string $organization * @@ -24,7 +24,7 @@ public function all($organization) /** * Get a single hook. * - * @link https://developer.github.com/v3/orgs/hooks/#get-single-hook + * @link https://docs.github.com/rest/orgs/webhooks#get-an-organization-webhook * * @param string $organization * @param int $id @@ -39,7 +39,7 @@ public function show($organization, $id) /** * Create a hook. * - * @link https://developer.github.com/v3/orgs/hooks/#create-a-hook + * @link https://docs.github.com/rest/orgs/webhooks#create-an-organization-webhook * * @param string $organization * @param array $params @@ -60,7 +60,7 @@ public function create($organization, array $params) /** * Edit a hook. * - * @link https://developer.github.com/v3/orgs/hooks/#edit-a-hook + * @link https://docs.github.com/rest/orgs/webhooks#update-an-organization-webhook * * @param string $organization * @param int $id @@ -82,7 +82,7 @@ public function update($organization, $id, array $params) /** * Ping a hook. * - * @link https://developer.github.com/v3/orgs/hooks/#ping-a-hook + * @link https://docs.github.com/rest/orgs/webhooks#ping-an-organization-webhook * * @param string $organization * @param int $id @@ -97,7 +97,7 @@ public function ping($organization, $id) /** * Delete a hook. * - * @link https://developer.github.com/v3/orgs/hooks/#delete-a-hook + * @link https://docs.github.com/rest/orgs/webhooks#delete-an-organization-webhook * * @param string $organization * @param int $id diff --git a/lib/Github/Api/Organization/Members.php b/lib/Github/Api/Organization/Members.php index 023e3f8d545..4649fe6bdb9 100644 --- a/lib/Github/Api/Organization/Members.php +++ b/lib/Github/Api/Organization/Members.php @@ -5,12 +5,25 @@ use Github\Api\AbstractApi; /** - * @link http://developer.github.com/v3/orgs/members/ + * @link https://docs.github.com/rest/orgs/members * * @author Joseph Bielawski */ class Members extends AbstractApi { + /** + * List members of an organization, or its public members. + * + * @link https://docs.github.com/rest/orgs/members#list-organization-members + * @link https://docs.github.com/rest/orgs/members#list-public-organization-members + * + * @param string $organization the organization + * @param string|null $type if not null, list the public members instead + * @param string $filter filter members returned (2fa_disabled or all) + * @param string|null $role filter members returned by their role (all, admin or member) + * + * @return array list of members + */ public function all($organization, $type = null, $filter = 'all', $role = null) { $parameters = []; @@ -30,44 +43,122 @@ public function all($organization, $type = null, $filter = 'all', $role = null) return $this->get($path, $parameters); } + /** + * Check if a user is, publicly or privately, a member of the organization. + * + * @link https://docs.github.com/rest/orgs/members#check-organization-membership-for-a-user + * + * @param string $organization the organization + * @param string $username the user to check + * + * @return array|string + */ public function show($organization, $username) { return $this->get('/orgs/'.rawurlencode($organization).'/members/'.rawurlencode($username)); } + /** + * Get the organization membership (role and state) of a user. + * + * @link https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user + * + * @param string $organization the organization + * @param string $username the user to check + * + * @return array + */ public function member($organization, $username) { return $this->get('/orgs/'.rawurlencode($organization).'/memberships/'.rawurlencode($username)); } + /** + * Check if a user is a public member of the organization. + * + * @link https://docs.github.com/rest/orgs/members#check-public-organization-membership-for-a-user + * + * @param string $organization the organization + * @param string $username the user to check + * + * @return array|string + */ public function check($organization, $username) { return $this->get('/orgs/'.rawurlencode($organization).'/public_members/'.rawurlencode($username)); } + /** + * Publicize a user's membership of the organization. + * + * @link https://docs.github.com/rest/orgs/members#set-public-organization-membership-for-the-authenticated-user + * + * @param string $organization the organization + * @param string $username the user to publicize + * + * @return array|string + */ public function publicize($organization, $username) { return $this->put('/orgs/'.rawurlencode($organization).'/public_members/'.rawurlencode($username)); } + /** + * Conceal a user's membership of the organization. + * + * @link https://docs.github.com/rest/orgs/members#remove-public-organization-membership-for-the-authenticated-user + * + * @param string $organization the organization + * @param string $username the user to conceal + * + * @return array|string + */ public function conceal($organization, $username) { return $this->delete('/orgs/'.rawurlencode($organization).'/public_members/'.rawurlencode($username)); } - /* - * Add user to organization + /** + * Add a user to the organization, or update their existing membership. + * + * @link https://docs.github.com/rest/orgs/members#set-organization-membership-for-a-user + * + * @param string $organization the organization + * @param string $username the user to add + * @param array $params the parameters (e.g. role) + * + * @return array */ public function add($organization, $username, array $params = []) { return $this->put('/orgs/'.rawurlencode($organization).'/memberships/'.rawurlencode($username), $params); } + /** + * Add a user to the organization. + * + * @link https://docs.github.com/rest/orgs/members#set-organization-membership-for-a-user + * + * @param string $organization the organization + * @param string $username the user to add + * + * @return array + */ public function addMember($organization, $username) { return $this->add($organization, $username); } + /** + * Remove a member from the organization (also removes them from all teams). + * + * @link https://docs.github.com/rest/orgs/members#remove-an-organization-member + * + * @param string $organization the organization + * @param string $username the user to remove + * + * @return array|string + */ public function remove($organization, $username) { return $this->delete('/orgs/'.rawurlencode($organization).'/members/'.rawurlencode($username)); diff --git a/lib/Github/Api/Organization/OrganizationRoles.php b/lib/Github/Api/Organization/OrganizationRoles.php index dd44fceceaf..2dd1bd4704d 100644 --- a/lib/Github/Api/Organization/OrganizationRoles.php +++ b/lib/Github/Api/Organization/OrganizationRoles.php @@ -5,55 +5,146 @@ use Github\Api\AbstractApi; /** - * @link https://docs.github.com/en/rest/orgs/organization-roles + * @link https://docs.github.com/rest/orgs/organization-roles */ class OrganizationRoles extends AbstractApi { + /** + * List all the organization roles available in the organization. + * + * @link https://docs.github.com/rest/orgs/organization-roles#get-all-organization-roles-for-an-organization + * + * @param string $organization the organization + * + * @return array + */ public function all(string $organization) { return $this->get('/orgs/'.rawurlencode($organization).'/organization-roles'); } + /** + * Get an organization role by its ID. + * + * @link https://docs.github.com/rest/orgs/organization-roles#get-an-organization-role + * + * @param string $organization the organization + * @param int $roleId the ID of the role to get + * + * @return array + */ public function show(string $organization, int $roleId) { return $this->get('/orgs/'.rawurlencode($organization).'/organization-roles/'.$roleId); } + /** + * List the teams that are assigned to an organization role. + * + * @link https://docs.github.com/rest/orgs/organization-roles#list-teams-that-are-assigned-to-an-organization-role + * + * @param string $organization the organization + * @param int $roleId the ID of the role + * + * @return array + */ public function listTeamsWithRole(string $organization, int $roleId) { return $this->get('/orgs/'.rawurlencode($organization).'/organization-roles/'.$roleId.'/teams'); } + /** + * Assign an organization role to a team. + * + * @link https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-team + * + * @param string $organization the organization + * @param int $roleId the ID of the role to assign + * @param string $teamSlug the slug of the team + */ public function assignRoleToTeam(string $organization, int $roleId, string $teamSlug): void { $this->put('/orgs/'.rawurlencode($organization).'/organization-roles/teams/'.rawurlencode($teamSlug).'/'.$roleId); } + /** + * Remove an organization role from a team. + * + * @link https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-team + * + * @param string $organization the organization + * @param int $roleId the ID of the role to remove + * @param string $teamSlug the slug of the team + */ public function removeRoleFromTeam(string $organization, int $roleId, string $teamSlug): void { $this->delete('/orgs/'.rawurlencode($organization).'/organization-roles/teams/'.rawurlencode($teamSlug).'/'.$roleId); } + /** + * Remove all assigned organization roles from a team. + * + * @link https://docs.github.com/rest/orgs/organization-roles#remove-all-organization-roles-for-a-team + * + * @param string $organization the organization + * @param string $teamSlug the slug of the team + */ public function removeAllRolesFromTeam(string $organization, string $teamSlug): void { $this->delete('/orgs/'.rawurlencode($organization).'/organization-roles/teams/'.rawurlencode($teamSlug)); } + /** + * List the users that are assigned to an organization role. + * + * @link https://docs.github.com/rest/orgs/organization-roles#list-users-that-are-assigned-to-an-organization-role + * + * @param string $organization the organization + * @param int $roleId the ID of the role + * + * @return array + */ public function listUsersWithRole(string $organization, int $roleId): array { return $this->get('/orgs/'.rawurlencode($organization).'/organization-roles/'.$roleId.'/users'); } + /** + * Assign an organization role to a user. + * + * @link https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-user + * + * @param string $organization the organization + * @param int $roleId the ID of the role to assign + * @param string $username the username + */ public function assignRoleToUser(string $organization, int $roleId, string $username): void { $this->put('/orgs/'.rawurlencode($organization).'/organization-roles/users/'.rawurlencode($username).'/'.$roleId); } + /** + * Remove an organization role from a user. + * + * @link https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-user + * + * @param string $organization the organization + * @param int $roleId the ID of the role to remove + * @param string $username the username + */ public function removeRoleFromUser(string $organization, int $roleId, string $username): void { $this->delete('/orgs/'.rawurlencode($organization).'/organization-roles/users/'.rawurlencode($username).'/'.$roleId); } + /** + * Remove all assigned organization roles from a user. + * + * @link https://docs.github.com/rest/orgs/organization-roles#remove-all-organization-roles-for-a-user + * + * @param string $organization the organization + * @param string $username the username + */ public function removeAllRolesFromUser(string $organization, string $username): void { $this->delete('/orgs/'.rawurlencode($organization).'/organization-roles/users/'.rawurlencode($username)); diff --git a/lib/Github/Api/Organization/OutsideCollaborators.php b/lib/Github/Api/Organization/OutsideCollaborators.php index 958100a56ee..6425bf68293 100644 --- a/lib/Github/Api/Organization/OutsideCollaborators.php +++ b/lib/Github/Api/Organization/OutsideCollaborators.php @@ -5,14 +5,14 @@ use Github\Api\AbstractApi; /** - * @link https://developer.github.com/v3/orgs/outside_collaborators/ + * @link https://docs.github.com/rest/orgs/outside-collaborators * * @author Matthieu Calie */ class OutsideCollaborators extends AbstractApi { /** - * @link https://developer.github.com/v3/orgs/outside_collaborators/#list-outside-collaborators-for-an-organization + * @link https://docs.github.com/rest/orgs/outside-collaborators#list-outside-collaborators-for-an-organization * * @param string $organization the organization * @param array $params @@ -25,7 +25,7 @@ public function all($organization, array $params = []) } /** - * @link https://developer.github.com/v3/orgs/outside_collaborators/#convert-an-organization-member-to-outside-collaborator + * @link https://docs.github.com/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator * * @param string $organization the organization * @param string $username the github username @@ -38,7 +38,7 @@ public function convert($organization, $username) } /** - * @link https://developer.github.com/v3/orgs/outside_collaborators/#remove-outside-collaborator-from-an-organization + * @link https://docs.github.com/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization * * @param string $organization the organization * @param string $username the username diff --git a/lib/Github/Api/Organization/Projects.php b/lib/Github/Api/Organization/Projects.php index 2bb7196e95a..b7531721f8e 100644 --- a/lib/Github/Api/Organization/Projects.php +++ b/lib/Github/Api/Organization/Projects.php @@ -5,13 +5,38 @@ use Github\Api\Project\AbstractProjectApi; use Github\Exception\MissingArgumentException; +/** + * @link https://docs.github.com/enterprise-server@3.11/rest/projects/projects + */ class Projects extends AbstractProjectApi { + /** + * List the projects (classic) in an organization. + * + * @link https://docs.github.com/enterprise-server@3.11/rest/projects/projects#list-organization-projects + * + * @param string $organization the organization + * @param array $params a list of extra parameters + * + * @return array + */ public function all($organization, array $params = []) { return $this->get('/orgs/'.rawurlencode($organization).'/projects', array_merge(['page' => 1], $params)); } + /** + * Create an organization project (classic). + * + * @link https://docs.github.com/enterprise-server@3.11/rest/projects/projects#create-an-organization-project + * + * @param string $organization the organization + * @param array $params the parameters (name is required) + * + * @throws MissingArgumentException + * + * @return array + */ public function create($organization, array $params) { if (!isset($params['name'])) { diff --git a/lib/Github/Api/Organization/SecretScanning.php b/lib/Github/Api/Organization/SecretScanning.php index a323fd06fcc..ee43f1f7715 100644 --- a/lib/Github/Api/Organization/SecretScanning.php +++ b/lib/Github/Api/Organization/SecretScanning.php @@ -5,7 +5,7 @@ class SecretScanning extends \Github\Api\AbstractApi { /** - * @link https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-secret-scanning-alerts-for-an-organization + * @link https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-organization * * @param string $organization * @param array $params diff --git a/lib/Github/Api/Organization/Teams.php b/lib/Github/Api/Organization/Teams.php index 20bb2791a7a..355d5fda33e 100644 --- a/lib/Github/Api/Organization/Teams.php +++ b/lib/Github/Api/Organization/Teams.php @@ -6,17 +6,38 @@ use Github\Exception\MissingArgumentException; /** - * @link http://developer.github.com/v3/orgs/teams/ + * @link https://docs.github.com/rest/teams/teams * * @author Joseph Bielawski */ class Teams extends AbstractApi { + /** + * List all teams in an organization. + * + * @link https://docs.github.com/rest/teams/teams#list-teams + * + * @param string $organization the organization + * + * @return array + */ public function all($organization) { return $this->get('/orgs/'.rawurlencode($organization).'/teams'); } + /** + * Create a new team in an organization. + * + * @link https://docs.github.com/rest/teams/teams#create-a-team + * + * @param string $organization the organization + * @param array $params the parameters (name is required) + * + * @throws \Github\Exception\MissingArgumentException + * + * @return array + */ public function create($organization, array $params) { if (!isset($params['name'])) { @@ -33,7 +54,9 @@ public function create($organization, array $params) } /** - * @link https://developer.github.com/v3/teams/#list-teams + * Get a team using the team's slug. + * + * @link https://docs.github.com/rest/teams/teams#get-a-team-by-name */ public function show($team, $organization) { @@ -41,7 +64,9 @@ public function show($team, $organization) } /** - * @link https://developer.github.com/v3/teams/#edit-team + * Edit a team. + * + * @link https://docs.github.com/rest/teams/teams#update-a-team */ public function update($team, array $params, $organization) { @@ -56,7 +81,9 @@ public function update($team, array $params, $organization) } /** - * @link https://developer.github.com/v3/teams/#delete-team + * Delete a team. + * + * @link https://docs.github.com/rest/teams/teams#delete-a-team */ public function remove($team, $organization) { @@ -64,7 +91,9 @@ public function remove($team, $organization) } /** - * @link https://developer.github.com/v3/teams/members/#list-team-members + * List a team's members. + * + * @link https://docs.github.com/rest/teams/members#list-team-members */ public function members($team, $organization) { @@ -72,7 +101,9 @@ public function members($team, $organization) } /** - * @link https://developer.github.com/v3/teams/members/#get-team-membership + * Get team membership for a user. + * + * @link https://docs.github.com/rest/teams/members#get-team-membership-for-a-user */ public function check($team, $username, $organization) { @@ -80,7 +111,9 @@ public function check($team, $username, $organization) } /** - * @link https://developer.github.com/v3/teams/members/#add-or-update-team-membership + * Add or update team membership for a user. + * + * @link https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user */ public function addMember($team, $username, $organization) { @@ -88,7 +121,9 @@ public function addMember($team, $username, $organization) } /** - * @link https://developer.github.com/v3/teams/members/#remove-team-membership + * Remove team membership for a user. + * + * @link https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user */ public function removeMember($team, $username, $organization) { @@ -96,7 +131,7 @@ public function removeMember($team, $username, $organization) } /** - * @link https://docs.github.com/en/rest/teams/teams#list-team-repositories + * @link https://docs.github.com/rest/teams/teams#list-team-repositories */ public function repositories($team, $organization = '') { @@ -107,11 +142,21 @@ public function repositories($team, $organization = '') return $this->get('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team).'/repos'); } + /** + * Check team permissions for a repository. + * + * @link https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository + */ public function repository($team, $organization, $repository) { return $this->get('/teams/'.rawurlencode($team).'/repos/'.rawurlencode($organization).'/'.rawurlencode($repository)); } + /** + * Add or update team repository permissions. + * + * @link https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions + */ public function addRepository($team, $organization, $repository, $params = []) { if (isset($params['permission']) && !in_array($params['permission'], ['pull', 'push', 'admin', 'maintain', 'triage'])) { @@ -121,6 +166,11 @@ public function addRepository($team, $organization, $repository, $params = []) return $this->put('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team).'/repos/'.rawurlencode($organization).'/'.rawurlencode($repository), $params); } + /** + * Remove a repository from a team. + * + * @link https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team + */ public function removeRepository($team, $organization, $repository) { return $this->delete('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team).'/repos/'.rawurlencode($organization).'/'.rawurlencode($repository)); diff --git a/lib/Github/Api/Project/AbstractProjectApi.php b/lib/Github/Api/Project/AbstractProjectApi.php index 049d67562c0..170f7023ee2 100644 --- a/lib/Github/Api/Project/AbstractProjectApi.php +++ b/lib/Github/Api/Project/AbstractProjectApi.php @@ -5,14 +5,21 @@ use Github\Api\AbstractApi; use Github\Api\AcceptHeaderTrait; +/** + * Base class for the "Projects (classic)" boards API. + * + * @deprecated GitHub Projects (classic) was sunset on 2024-08-23 and this REST API is no longer part of the + * current documentation on docs.github.com (superseded by the Projects v2 GraphQL/REST API). + */ abstract class AbstractProjectApi extends AbstractApi { use AcceptHeaderTrait; /** - * Configure the accept header for Early Access to the projects api. + * Configure the accept header for Early Access to the projects (classic) api. * - * @see https://developer.github.com/v3/repos/projects/#projects + * @deprecated GitHub Projects (classic) was sunset by GitHub; this endpoint no longer has documentation + * on docs.github.com. * * @return $this */ @@ -23,21 +30,58 @@ public function configure() return $this; } + /** + * Get a classic project by id. + * + * @deprecated GitHub Projects (classic) was sunset by GitHub; this endpoint no longer has documentation + * on docs.github.com. + * + * @param int|string $id the id of the project + * @param array $params the parameters + * + * @return array + */ public function show($id, array $params = []) { return $this->get('/projects/'.rawurlencode($id), array_merge(['page' => 1], $params)); } + /** + * Update a classic project. + * + * @deprecated GitHub Projects (classic) was sunset by GitHub; this endpoint no longer has documentation + * on docs.github.com. + * + * @param int|string $id the id of the project to update + * @param array $params the parameters to update (name, body, state, organization_permission, private) + * + * @return array + */ public function update($id, array $params) { return $this->patch('/projects/'.rawurlencode($id), $params); } + /** + * Delete a classic project. + * + * @deprecated GitHub Projects (classic) was sunset by GitHub; this endpoint no longer has documentation + * on docs.github.com. + * + * @param int|string $id the id of the project + * + * @return array + */ public function deleteProject($id) { return $this->delete('/projects/'.rawurlencode($id)); } + /** + * @deprecated GitHub Projects (classic) was sunset by GitHub. + * + * @return Columns + */ public function columns() { return new Columns($this->getClient()); diff --git a/lib/Github/Api/Project/Cards.php b/lib/Github/Api/Project/Cards.php index 0d670f93863..09d7beccf1e 100644 --- a/lib/Github/Api/Project/Cards.php +++ b/lib/Github/Api/Project/Cards.php @@ -6,14 +6,21 @@ use Github\Api\AcceptHeaderTrait; use Github\Exception\MissingArgumentException; +/** + * "Project (classic)" cards API. + * + * @deprecated GitHub Projects (classic) was sunset on 2024-08-23 and this REST API is no longer part of the + * current documentation on docs.github.com (superseded by the Projects v2 GraphQL/REST API). + */ class Cards extends AbstractApi { use AcceptHeaderTrait; /** - * Configure the accept header for Early Access to the projects api. + * Configure the accept header for Early Access to the projects (classic) api. * - * @see https://developer.github.com/v3/repos/projects/#projects + * @deprecated GitHub Projects (classic) was sunset by GitHub; this endpoint no longer has documentation + * on docs.github.com. * * @return $this */ @@ -24,31 +31,97 @@ public function configure() return $this; } + /** + * List the cards of a classic project column. + * + * @deprecated GitHub Projects (classic) was sunset by GitHub; this endpoint no longer has documentation + * on docs.github.com. + * + * @param int|string $columnId the id of the column + * @param array $params the parameters (archived_state) + * + * @return array + */ public function all($columnId, array $params = []) { return $this->get('/projects/columns/'.rawurlencode($columnId).'/cards', array_merge(['page' => 1], $params)); } + /** + * Get a classic project card. + * + * @deprecated GitHub Projects (classic) was sunset by GitHub; this endpoint no longer has documentation + * on docs.github.com. + * + * @param int|string $id the id of the card + * + * @return array + */ public function show($id) { return $this->get('/projects/columns/cards/'.rawurlencode($id)); } + /** + * Create a classic project card. + * + * @deprecated GitHub Projects (classic) was sunset by GitHub; this endpoint no longer has documentation + * on docs.github.com. + * + * @param int|string $columnId the id of the column + * @param array $params the parameters (note, or content_id/content_type) + * + * @return array + */ public function create($columnId, array $params) { return $this->post('/projects/columns/'.rawurlencode($columnId).'/cards', $params); } + /** + * Update a classic project card. + * + * @deprecated GitHub Projects (classic) was sunset by GitHub; this endpoint no longer has documentation + * on docs.github.com. + * + * @param int|string $id the id of the card to update + * @param array $params the parameters to update (note, archived) + * + * @return array + */ public function update($id, array $params) { return $this->patch('/projects/columns/cards/'.rawurlencode($id), $params); } + /** + * Delete a classic project card. + * + * @deprecated GitHub Projects (classic) was sunset by GitHub; this endpoint no longer has documentation + * on docs.github.com. + * + * @param int|string $id the id of the card + * + * @return array + */ public function deleteCard($id) { return $this->delete('/projects/columns/cards/'.rawurlencode($id)); } + /** + * Move a classic project card. + * + * @deprecated GitHub Projects (classic) was sunset by GitHub; this endpoint no longer has documentation + * on docs.github.com. + * + * @param int|string $id the id of the card to move + * @param array $params the parameters (position, column_id) + * + * @throws MissingArgumentException + * + * @return array + */ public function move($id, array $params) { if (!isset($params['position'])) { diff --git a/lib/Github/Api/Project/Columns.php b/lib/Github/Api/Project/Columns.php index 5146ac223af..a03a1ea5edf 100644 --- a/lib/Github/Api/Project/Columns.php +++ b/lib/Github/Api/Project/Columns.php @@ -6,16 +6,23 @@ use Github\Api\AcceptHeaderTrait; use Github\Exception\MissingArgumentException; +/** + * "Project (classic)" columns API. + * + * @deprecated GitHub Projects (classic) was sunset on 2024-08-23 and this REST API is no longer part of the + * current documentation on docs.github.com (superseded by the Projects v2 GraphQL/REST API). + */ class Columns extends AbstractApi { use AcceptHeaderTrait; /** - * Configure the accept header for Early Access to the projects api. + * Configure the accept header for Early Access to the projects (classic) api. * - * @see https://developer.github.com/v3/repos/projects/#projects + * @deprecated GitHub Projects (classic) was sunset by GitHub; this endpoint no longer has documentation + * on docs.github.com. * - * return self + * @return $this */ public function configure() { @@ -24,16 +31,50 @@ public function configure() return $this; } + /** + * List the columns of a classic project. + * + * @deprecated GitHub Projects (classic) was sunset by GitHub; this endpoint no longer has documentation + * on docs.github.com. + * + * @param int|string $projectId the id of the project + * @param array $params the parameters + * + * @return array + */ public function all($projectId, array $params = []) { return $this->get('/projects/'.rawurlencode($projectId).'/columns', array_merge(['page' => 1], $params)); } + /** + * Get a classic project column. + * + * @deprecated GitHub Projects (classic) was sunset by GitHub; this endpoint no longer has documentation + * on docs.github.com. + * + * @param int|string $id the id of the column + * + * @return array + */ public function show($id) { return $this->get('/projects/columns/'.rawurlencode($id)); } + /** + * Create a classic project column. + * + * @deprecated GitHub Projects (classic) was sunset by GitHub; this endpoint no longer has documentation + * on docs.github.com. + * + * @param int|string $projectId the id of the project + * @param array $params the parameters (name) + * + * @throws MissingArgumentException + * + * @return array + */ public function create($projectId, array $params) { if (!isset($params['name'])) { @@ -43,6 +84,19 @@ public function create($projectId, array $params) return $this->post('/projects/'.rawurlencode($projectId).'/columns', $params); } + /** + * Update a classic project column. + * + * @deprecated GitHub Projects (classic) was sunset by GitHub; this endpoint no longer has documentation + * on docs.github.com. + * + * @param int|string $id the id of the column to update + * @param array $params the parameters to update (name) + * + * @throws MissingArgumentException + * + * @return array + */ public function update($id, array $params) { if (!isset($params['name'])) { @@ -52,11 +106,34 @@ public function update($id, array $params) return $this->patch('/projects/columns/'.rawurlencode($id), $params); } + /** + * Delete a classic project column. + * + * @deprecated GitHub Projects (classic) was sunset by GitHub; this endpoint no longer has documentation + * on docs.github.com. + * + * @param int|string $id the id of the column + * + * @return array + */ public function deleteColumn($id) { return $this->delete('/projects/columns/'.rawurlencode($id)); } + /** + * Move a classic project column. + * + * @deprecated GitHub Projects (classic) was sunset by GitHub; this endpoint no longer has documentation + * on docs.github.com. + * + * @param int|string $id the id of the column to move + * @param array $params the parameters (position) + * + * @throws MissingArgumentException + * + * @return array + */ public function move($id, array $params) { if (!isset($params['position'])) { @@ -66,6 +143,11 @@ public function move($id, array $params) return $this->post('/projects/columns/'.rawurlencode($id).'/moves', $params); } + /** + * @deprecated GitHub Projects (classic) was sunset by GitHub. + * + * @return Cards + */ public function cards() { return new Cards($this->getClient()); diff --git a/lib/Github/Api/PullRequest.php b/lib/Github/Api/PullRequest.php index 22922c1ee92..ca00f66521b 100644 --- a/lib/Github/Api/PullRequest.php +++ b/lib/Github/Api/PullRequest.php @@ -11,7 +11,7 @@ /** * API for accessing Pull Requests from your Git/Github repositories. * - * @see http://developer.github.com/v3/pulls/ + * @see https://docs.github.com/rest/pulls/pulls * * @author Joseph Bielawski */ @@ -22,7 +22,7 @@ class PullRequest extends AbstractApi /** * Configure the body type. * - * @link https://developer.github.com/v3/pulls/#custom-media-types + * @link https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types * * @param string|null $bodyType * @param string|null $apiVersion @@ -51,7 +51,7 @@ public function configure($bodyType = null, $apiVersion = null) /** * Get a listing of a project's pull requests by the username, repository and (optionally) state. * - * @link http://developer.github.com/v3/pulls/ + * @link https://docs.github.com/rest/pulls/pulls#list-pull-requests * * @param string $username the username * @param string $repository the repository @@ -67,7 +67,7 @@ public function all($username, $repository, array $parameters = []) /** * Show all details of a pull request, including the discussions. * - * @link http://developer.github.com/v3/pulls/ + * @link https://docs.github.com/rest/pulls/pulls#get-a-pull-request * * @param string $username the username * @param string $repository the repository @@ -80,11 +80,35 @@ public function show($username, $repository, $id) return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$id); } + /** + * List commits on a pull request. + * + * @link https://docs.github.com/rest/pulls/pulls#list-commits-on-a-pull-request + * + * @param string $username the username + * @param string $repository the repository + * @param int|string $id the ID of the pull request + * @param array $parameters a list of extra parameters. + * + * @return array array of commits for the pull request + */ public function commits($username, $repository, $id, array $parameters = []) { return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.rawurlencode($id).'/commits', $parameters); } + /** + * List the files on a pull request. + * + * @link https://docs.github.com/rest/pulls/pulls#list-pull-requests-files + * + * @param string $username the username + * @param string $repository the repository + * @param int|string $id the ID of the pull request + * @param array $parameters a list of extra parameters. + * + * @return array array of files for the pull request + */ public function files($username, $repository, $id, array $parameters = []) { return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.rawurlencode($id).'/files', $parameters); @@ -93,7 +117,7 @@ public function files($username, $repository, $id, array $parameters = []) /** * All statuses which are the statuses of its head branch. * - * @see http://developer.github.com/v3/pulls/ + * @see https://docs.github.com/rest/commits/statuses#list-commit-statuses-for-a-reference * * @param string $username the username * @param string $repository the repository @@ -135,7 +159,7 @@ public function reviewRequests() /** * Create a pull request. * - * @link http://developer.github.com/v3/pulls/ + * @link https://docs.github.com/rest/pulls/pulls#create-a-pull-request * * @param string $username the username * @param string $repository the repository @@ -168,6 +192,18 @@ public function create($username, $repository, array $params) return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls', $params); } + /** + * Update a pull request. + * + * @link https://docs.github.com/rest/pulls/pulls#update-a-pull-request + * + * @param string $username the username + * @param string $repository the repository + * @param int|string $id the ID of the pull request to update + * @param array $params the parameters to update (e.g. title, body, state, base) + * + * @return array + */ public function update($username, $repository, $id, array $params) { if (isset($params['state']) && !in_array($params['state'], ['open', 'closed'])) { @@ -177,11 +213,39 @@ public function update($username, $repository, $id, array $params) return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.rawurlencode($id), $params); } + /** + * Check if a pull request has been merged. + * + * @link https://docs.github.com/rest/pulls/pulls#check-if-a-pull-request-has-been-merged + * + * @param string $username the username + * @param string $repository the repository + * @param int|string $id the ID of the pull request + * + * @return array|string an empty response if the pull request has been merged (a 404 is raised otherwise) + */ public function merged($username, $repository, $id) { return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.rawurlencode($id).'/merge'); } + /** + * Merge a pull request. + * + * @link https://docs.github.com/rest/pulls/pulls#merge-a-pull-request + * + * @param string $username the username + * @param string $repository the repository + * @param int|string $id the ID of the pull request to merge + * @param string $message the commit message + * @param string $sha the SHA that pull request head must match to allow merge + * @param bool|string $mergeMethod the merge method to use (merge, squash or rebase) + * @param string|null $title the commit title + * + * @throws InvalidArgumentException + * + * @return array + */ public function merge($username, $repository, $id, $message, $sha, $mergeMethod = 'merge', $title = null) { if (is_bool($mergeMethod)) { diff --git a/lib/Github/Api/PullRequest/Comments.php b/lib/Github/Api/PullRequest/Comments.php index 3ded9456cf3..e1fd3fb94f6 100644 --- a/lib/Github/Api/PullRequest/Comments.php +++ b/lib/Github/Api/PullRequest/Comments.php @@ -7,7 +7,7 @@ use Github\Exception\MissingArgumentException; /** - * @link http://developer.github.com/v3/pulls/comments/ + * @link https://docs.github.com/rest/pulls/comments * * @author Joseph Bielawski */ @@ -18,7 +18,7 @@ class Comments extends AbstractApi /** * Configure the body type. * - * @link https://developer.github.com/v3/pulls/comments/#custom-media-types + * @link https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types * * @param string|null $bodyType * @param string|null $apiVersion @@ -44,8 +44,8 @@ public function configure($bodyType = null, $apiVersion = null) * Get a listing of a pull request's comments by the username, repository and pull request number * or all repository comments by the username and repository. * - * @link https://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request - * @link https://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository + * @link https://docs.github.com/rest/pulls/comments#list-review-comments-on-a-pull-request + * @link https://docs.github.com/rest/pulls/comments#list-review-comments-in-a-repository * * @param string $username the username * @param string $repository the repository @@ -71,7 +71,7 @@ public function all($username, $repository, $pullRequest = null, array $params = /** * Get a single pull request comment by the username, repository and comment id. * - * @link https://developer.github.com/v3/pulls/comments/#get-a-single-comment + * @link https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request * * @param string $username the username * @param string $repository the repository @@ -87,7 +87,7 @@ public function show($username, $repository, $comment) /** * Create a pull request comment by the username, repository and pull request number. * - * @link https://developer.github.com/v3/pulls/comments/#create-a-comment + * @link https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request * * @param string $username the username * @param string $repository the repository @@ -115,7 +115,7 @@ public function create($username, $repository, $pullRequest, array $params) /** * Update a pull request comment by the username, repository and comment id. * - * @link https://developer.github.com/v3/pulls/comments/#edit-a-comment + * @link https://docs.github.com/rest/pulls/comments#update-a-review-comment-for-a-pull-request * * @param string $username the username * @param string $repository the repository @@ -138,7 +138,7 @@ public function update($username, $repository, $comment, array $params) /** * Delete a pull request comment by the username, repository and comment id. * - * @link https://developer.github.com/v3/pulls/comments/#delete-a-comment + * @link https://docs.github.com/rest/pulls/comments#delete-a-review-comment-for-a-pull-request * * @param string $username the username * @param string $repository the repository diff --git a/lib/Github/Api/PullRequest/Review.php b/lib/Github/Api/PullRequest/Review.php index ed586ddf6fc..1546311b97d 100644 --- a/lib/Github/Api/PullRequest/Review.php +++ b/lib/Github/Api/PullRequest/Review.php @@ -10,7 +10,7 @@ /** * API for accessing Pull Request Reviews from your Git/Github repositories. * - * @link https://developer.github.com/v3/pulls/reviews/ + * @link https://docs.github.com/rest/pulls/reviews * * @author Christian Flothmann */ @@ -18,6 +18,11 @@ class Review extends AbstractApi { use AcceptHeaderTrait; + /** + * @deprecated since 3.2, will be removed in 4.0. + * + * @return $this + */ public function configure() { trigger_deprecation('KnpLabs/php-github-api', '3.2', 'The "%s" is deprecated and will be removed.', __METHOD__); @@ -28,7 +33,7 @@ public function configure() /** * Get a listing of a pull request's reviews by the username, repository and pull request number. * - * @link https://developer.github.com/v3/pulls/reviews/#list-reviews-on-a-pull-request + * @link https://docs.github.com/rest/pulls/reviews#list-reviews-for-a-pull-request * * @param string $username the username * @param string $repository the repository @@ -54,7 +59,7 @@ public function all($username, $repository, $pullRequest, array $params = []) /** * Get a single pull request review by the username, repository, pull request number and the review id. * - * @link https://developer.github.com/v3/pulls/reviews/#get-a-single-review + * @link https://docs.github.com/rest/pulls/reviews#get-a-review-for-a-pull-request * * @param string $username the username * @param string $repository the repository @@ -71,7 +76,7 @@ public function show($username, $repository, $pullRequest, $id) /** * Delete a single pull request review by the username, repository, pull request number and the review id. * - * @link https://developer.github.com/v3/pulls/reviews/#delete-a-pending-review + * @link https://docs.github.com/rest/pulls/reviews#delete-a-pending-review-for-a-pull-request * * @param string $username the username * @param string $repository the repository @@ -88,7 +93,7 @@ public function remove($username, $repository, $pullRequest, $id) /** * Get comments for a single pull request review. * - * @link https://developer.github.com/v3/pulls/reviews/#get-comments-for-a-single-review + * @link https://docs.github.com/rest/pulls/reviews#list-comments-for-a-pull-request-review * * @param string $username the username * @param string $repository the repository @@ -105,7 +110,7 @@ public function comments($username, $repository, $pullRequest, $id) /** * Create a pull request review by the username, repository and pull request number. * - * @link https://developer.github.com/v3/pulls/reviews/#create-a-pull-request-review + * @link https://docs.github.com/rest/pulls/reviews#create-a-review-for-a-pull-request * * @param string $username the username * @param string $repository the repository @@ -128,7 +133,7 @@ public function create($username, $repository, $pullRequest, array $params = []) /** * Submit a pull request review by the username, repository, pull request number and the review id. * - * @link https://developer.github.com/v3/pulls/reviews/#submit-a-pull-request-review + * @link https://docs.github.com/rest/pulls/reviews#submit-a-review-for-a-pull-request * * @param string $username the username * @param string $repository the repository @@ -156,7 +161,7 @@ public function submit($username, $repository, $pullRequest, $id, array $params /** * Dismiss a pull request review by the username, repository, pull request number and the review id. * - * @link https://developer.github.com/v3/pulls/reviews/#dismiss-a-pull-request-review + * @link https://docs.github.com/rest/pulls/reviews#dismiss-a-review-for-a-pull-request * * @param string $username the username * @param string $repository the repository @@ -184,7 +189,7 @@ public function dismiss($username, $repository, $pullRequest, $id, $message) /** * Update a pull request review by the username, repository, pull request number and the review id. * - * @link https://developer.github.com/v3/pulls/reviews/#update-a-pull-request-review + * @link https://docs.github.com/rest/pulls/reviews#update-a-review-for-a-pull-request * * @param string $username the username * @param string $repository the repository diff --git a/lib/Github/Api/PullRequest/ReviewRequest.php b/lib/Github/Api/PullRequest/ReviewRequest.php index e9b9280a119..4db027c6009 100644 --- a/lib/Github/Api/PullRequest/ReviewRequest.php +++ b/lib/Github/Api/PullRequest/ReviewRequest.php @@ -6,12 +6,17 @@ use Github\Api\AcceptHeaderTrait; /** - * @link https://developer.github.com/v3/pulls/review_requests/ + * @link https://docs.github.com/rest/pulls/review-requests */ class ReviewRequest extends AbstractApi { use AcceptHeaderTrait; + /** + * @deprecated since 3.2, will be removed in 4.0. + * + * @return $this + */ public function configure() { trigger_deprecation('KnpLabs/php-github-api', '3.2', 'The "%s" is deprecated and will be removed.', __METHOD__); @@ -20,7 +25,7 @@ public function configure() } /** - * @link https://developer.github.com/v3/pulls/review_requests/#list-review-requests + * @link https://docs.github.com/rest/pulls/review-requests#get-all-requested-reviewers-for-a-pull-request * * @param string $username * @param string $repository @@ -39,7 +44,7 @@ public function all($username, $repository, $pullRequest, array $params = []) } /** - * @link https://docs.github.com/en/rest/reference/pulls#request-reviewers-for-a-pull-request + * @link https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request * * @param string $username * @param string $repository @@ -55,7 +60,7 @@ public function create($username, $repository, $pullRequest, array $reviewers = } /** - * @link https://developer.github.com/v3/pulls/review_requests/#delete-a-review-request + * @link https://docs.github.com/rest/pulls/review-requests#remove-requested-reviewers-from-a-pull-request * * @param string $username * @param string $repository diff --git a/lib/Github/Api/RateLimit.php b/lib/Github/Api/RateLimit.php index 10b8b5b3288..fb348ec3c42 100644 --- a/lib/Github/Api/RateLimit.php +++ b/lib/Github/Api/RateLimit.php @@ -7,7 +7,7 @@ /** * Get rate limits. * - * @link https://developer.github.com/v3/rate_limit/ + * @link https://docs.github.com/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user * * @author Jeff Finley */ @@ -54,6 +54,8 @@ public function getResource($name) /** * Returns the data directly from the GitHub API endpoint. * + * @link https://docs.github.com/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user + * * @return array */ protected function fetchLimits() diff --git a/lib/Github/Api/RateLimit/RateLimitResource.php b/lib/Github/Api/RateLimit/RateLimitResource.php index 661a4e5287c..beb2ae61d2a 100644 --- a/lib/Github/Api/RateLimit/RateLimitResource.php +++ b/lib/Github/Api/RateLimit/RateLimitResource.php @@ -4,6 +4,8 @@ /** * Represents the data block for a GitHub rate limit response, grouped by a name. + * + * @link https://docs.github.com/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user */ class RateLimitResource { diff --git a/lib/Github/Api/Repo.php b/lib/Github/Api/Repo.php index 5653ae4c152..912baddd3fc 100644 --- a/lib/Github/Api/Repo.php +++ b/lib/Github/Api/Repo.php @@ -33,7 +33,7 @@ * Searching repositories, getting repository information * and managing repository information for authenticated users. * - * @link http://developer.github.com/v3/repos/ + * @link https://docs.github.com/rest/repos/repos * * @author Joseph Bielawski * @author Thibault Duplessis @@ -45,7 +45,7 @@ class Repo extends AbstractApi /** * List all public repositories. * - * @link https://developer.github.com/v3/repos/#list-all-public-repositories + * @link https://docs.github.com/rest/repos/repos#list-public-repositories * * @param int|null $id The integer ID of the last Repository that you’ve seen. * @@ -63,7 +63,7 @@ public function all($id = null) /** * Get the last year of commit activity for a repository grouped by week. * - * @link http://developer.github.com/v3/repos/statistics/#commit-activity + * @link https://docs.github.com/rest/metrics/statistics#get-the-last-year-of-commit-activity * * @param string $username the user who owns the repository * @param string $repository the name of the repository @@ -78,7 +78,7 @@ public function activity($username, $repository) /** * Get contributor commit statistics for a repository. * - * @link http://developer.github.com/v3/repos/statistics/#contributors + * @link https://docs.github.com/rest/metrics/statistics#get-all-contributor-commit-activity * * @param string $username the user who owns the repository * @param string $repository the name of the repository @@ -93,7 +93,7 @@ public function statistics($username, $repository) /** * Get a weekly aggregate of the number of additions and deletions pushed to a repository. * - * @link http://developer.github.com/v3/repos/statistics/#code-frequency + * @link https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-activity * * @param string $username the user who owns the repository * @param string $repository the name of the repository @@ -108,7 +108,7 @@ public function frequency($username, $repository) /** * Get the weekly commit count for the repository owner and everyone else. * - * @link http://developer.github.com/v3/repos/statistics/#participation + * @link https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-count * * @param string $username the user who owns the repository * @param string $repository the name of the repository @@ -123,7 +123,7 @@ public function participation($username, $repository) /** * List all repositories for an organization. * - * @link http://developer.github.com/v3/repos/#list-organization-repositories + * @link https://docs.github.com/rest/repos/repos#list-organization-repositories * * @param string $organization the name of the organization * @param array $params @@ -138,7 +138,7 @@ public function org($organization, array $params = []) /** * Get extended information about a repository by its username and repository name. * - * @link http://developer.github.com/v3/repos/ + * @link https://docs.github.com/rest/repos/repos#get-a-repository * * @param string $username the user who owns the repository * @param string $repository the name of the repository @@ -154,7 +154,6 @@ public function show($username, $repository) * Get extended information about a repository by its id. * Note: at time of writing this is an undocumented feature but GitHub support have advised that it can be relied on. * - * @link http://developer.github.com/v3/repos/ * @link https://github.com/piotrmurach/github/issues/283 * @link https://github.com/piotrmurach/github/issues/282 * @@ -170,7 +169,8 @@ public function showById($id) /** * Create repository. * - * @link http://developer.github.com/v3/repos/ + * @link https://docs.github.com/rest/repos/repos#create-a-repository-for-the-authenticated-user + * @link https://docs.github.com/rest/repos/repos#create-an-organization-repository * * @param string $name name of the repository * @param string $description repository description @@ -229,7 +229,7 @@ public function create( /** * Set information of a repository. * - * @link http://developer.github.com/v3/repos/ + * @link https://docs.github.com/rest/repos/repos#update-a-repository * * @param string $username the user who owns the repository * @param string $repository the name of the repository @@ -245,7 +245,7 @@ public function update($username, $repository, array $values) /** * Delete a repository. * - * @link http://developer.github.com/v3/repos/ + * @link https://docs.github.com/rest/repos/repos#delete-a-repository * * @param string $username the user who owns the repository * @param string $repository the name of the repository @@ -260,7 +260,7 @@ public function remove($username, $repository) /** * Get the readme content for a repository by its username and repository name. * - * @link http://developer.github.com/v3/repos/contents/#get-the-readme + * @link https://docs.github.com/rest/repos/contents#get-a-repository-readme * * @param string $username the user who owns the repository * @param string $repository the name of the repository @@ -286,7 +286,7 @@ public function readme($username, $repository, $format = 'raw', $dir = null, $pa /** * Create a repository dispatch event. * - * @link https://developer.github.com/v3/repos/#create-a-repository-dispatch-event + * @link https://docs.github.com/rest/repos/repos#create-a-repository-dispatch-event * * @param string $username the user who owns the repository * @param string $repository the name of the repository @@ -310,7 +310,7 @@ public function dispatch($username, $repository, $eventType, $clientPayload) /** * Manage the collaborators of a repository. * - * @link http://developer.github.com/v3/repos/collaborators/ + * @link https://docs.github.com/rest/collaborators/collaborators * * @return Collaborators */ @@ -322,7 +322,7 @@ public function collaborators() /** * Manage the comments of a repository. * - * @link http://developer.github.com/v3/repos/comments/ + * @link https://docs.github.com/rest/commits/comments * * @return Comments */ @@ -334,7 +334,7 @@ public function comments() /** * Manage the commits of a repository. * - * @link http://developer.github.com/v3/repos/commits/ + * @link https://docs.github.com/rest/commits/commits * * @return Commits */ @@ -344,7 +344,7 @@ public function commits() } /** - * @link https://docs.github.com/en/rest/reference/checks#check-runs + * @link https://docs.github.com/rest/checks/runs */ public function checkRuns(): CheckRuns { @@ -352,7 +352,7 @@ public function checkRuns(): CheckRuns } /** - * @link https://docs.github.com/en/rest/reference/checks#check-suites + * @link https://docs.github.com/rest/checks/suites */ public function checkSuites(): CheckSuites { @@ -360,7 +360,7 @@ public function checkSuites(): CheckSuites } /** - * @link https://developer.github.com/v3/actions/artifacts/#artifacts + * @link https://docs.github.com/rest/actions/artifacts */ public function artifacts(): Artifacts { @@ -368,7 +368,7 @@ public function artifacts(): Artifacts } /** - * @link https://docs.github.com/en/rest/reference/actions#workflows + * @link https://docs.github.com/rest/actions/workflows */ public function workflows(): Workflows { @@ -376,7 +376,7 @@ public function workflows(): Workflows } /** - * @link https://docs.github.com/en/rest/reference/actions#workflow-runs + * @link https://docs.github.com/rest/actions/workflow-runs */ public function workflowRuns(): WorkflowRuns { @@ -384,7 +384,7 @@ public function workflowRuns(): WorkflowRuns } /** - * @link https://docs.github.com/en/rest/reference/actions#workflow-jobs + * @link https://docs.github.com/rest/actions/workflow-jobs */ public function workflowJobs(): WorkflowJobs { @@ -392,7 +392,7 @@ public function workflowJobs(): WorkflowJobs } /** - * @link https://docs.github.com/en/rest/reference/actions#self-hosted-runners + * @link https://docs.github.com/rest/actions/self-hosted-runners */ public function selfHostedRunners(): SelfHostedRunners { @@ -400,7 +400,7 @@ public function selfHostedRunners(): SelfHostedRunners } /** - * @link https://docs.github.com/en/rest/reference/actions#secrets + * @link https://docs.github.com/rest/actions/secrets */ public function secrets(): Secrets { @@ -408,7 +408,7 @@ public function secrets(): Secrets } /** - * @link https://docs.github.com/en/rest/reference/actions#secrets + * @link https://docs.github.com/rest/actions/variables */ public function variables(): Variables { @@ -418,7 +418,7 @@ public function variables(): Variables /** * Manage the content of a repository. * - * @link http://developer.github.com/v3/repos/contents/ + * @link https://docs.github.com/rest/repos/contents * * @return Contents */ @@ -430,7 +430,8 @@ public function contents() /** * Manage the content of a repository. * - * @link http://developer.github.com/v3/repos/downloads/ + * Note: the Downloads API has been removed by GitHub; there is no current + * docs.github.com endpoint backing this sub-API. * * @return Downloads */ @@ -440,9 +441,9 @@ public function downloads() } /** - * Manage the releases of a repository (Currently Undocumented). + * Manage the releases of a repository. * - * @link http://developer.github.com/v3/repos/ + * @link https://docs.github.com/rest/releases/releases * * @return Releases */ @@ -454,7 +455,7 @@ public function releases() /** * Manage the deploy keys of a repository. * - * @link http://developer.github.com/v3/repos/keys/ + * @link https://docs.github.com/rest/deploy-keys/deploy-keys * * @return DeployKeys */ @@ -466,7 +467,7 @@ public function keys() /** * Manage the forks of a repository. * - * @link http://developer.github.com/v3/repos/forks/ + * @link https://docs.github.com/rest/repos/forks * * @return Forks */ @@ -478,7 +479,7 @@ public function forks() /** * Manage the stargazers of a repository. * - * @link https://developer.github.com/v3/activity/starring/#list-stargazers + * @link https://docs.github.com/rest/activity/starring#list-stargazers * * @return Stargazers */ @@ -490,7 +491,7 @@ public function stargazers() /** * Manage the hooks of a repository. * - * @link http://developer.github.com/v3/issues/jooks/ + * @link https://docs.github.com/rest/webhooks/repos * * @return Hooks */ @@ -502,7 +503,7 @@ public function hooks() /** * Manage the labels of a repository. * - * @link http://developer.github.com/v3/issues/labels/ + * @link https://docs.github.com/rest/issues/labels * * @return Labels */ @@ -514,8 +515,6 @@ public function labels() /** * Manage the statuses of a repository. * - * @link http://developer.github.com/v3/repos/statuses/ - * * @return Statuses */ public function statuses() @@ -526,7 +525,7 @@ public function statuses() /** * Get the branch(es) of a repository. * - * @link http://developer.github.com/v3/repos/ + * @link https://docs.github.com/rest/branches/branches * * @param string $username the username * @param string $repository the name of the repository @@ -548,7 +547,7 @@ public function branches($username, $repository, $branch = null, array $paramete /** * Sync a fork branch with the upstream repository. * - * @link https://docs.github.com/en/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository + * @link https://docs.github.com/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository * * @return array|string */ @@ -563,8 +562,6 @@ public function mergeUpstream(string $username, string $repository, string $bran /** * Manage the protection of a repository branch. * - * @link https://developer.github.com/v3/repos/branches/#get-branch-protection - * * @return Protection */ public function protection() @@ -575,7 +572,7 @@ public function protection() /** * Get the contributors of a repository. * - * @link http://developer.github.com/v3/repos/ + * @link https://docs.github.com/rest/repos/repos#list-repository-contributors * * @param string $username the user who owns the repository * @param string $repository the name of the repository @@ -594,7 +591,7 @@ public function contributors($username, $repository, $includingAnonymous = false /** * Get the language breakdown of a repository. * - * @link http://developer.github.com/v3/repos/ + * @link https://docs.github.com/rest/repos/repos#list-repository-languages * * @param string $username the user who owns the repository * @param string $repository the name of the repository @@ -609,7 +606,7 @@ public function languages($username, $repository) /** * Get the tags of a repository. * - * @link http://developer.github.com/v3/repos/ + * @link https://docs.github.com/rest/repos/repos#list-repository-tags * * @param string $username the user who owns the repository * @param string $repository the name of the repository @@ -625,7 +622,7 @@ public function tags($username, $repository, array $params = []) /** * Get the teams of a repository. * - * @link http://developer.github.com/v3/repos/ + * @link https://docs.github.com/rest/repos/repos#list-repository-teams * * @param string $username the user who owns the repo * @param string $repository the name of the repo @@ -638,6 +635,10 @@ public function teams($username, $repository) } /** + * List the watchers of a repository. + * + * @link https://docs.github.com/rest/activity/watching#list-watchers + * * @param string $username * @param string $repository * @param int $page @@ -654,7 +655,7 @@ public function subscribers($username, $repository, $page = 1) /** * Perform a merge. * - * @link http://developer.github.com/v3/repos/merging/ + * @link https://docs.github.com/rest/branches/branches#merge-a-branch * * @param string $username * @param string $repository @@ -679,6 +680,10 @@ public function merge($username, $repository, $base, $head, $message = null) } /** + * List milestones for a repository. + * + * @link https://docs.github.com/rest/issues/milestones#list-milestones + * * @param string $username * @param string $repository * @param array $parameters @@ -691,7 +696,7 @@ public function milestones($username, $repository, array $parameters = []) } /** - * @link https://docs.github.com/en/rest/reference/repos#enable-automated-security-fixes + * @link https://docs.github.com/rest/repos/repos#enable-dependabot-security-updates * * @param string $username * @param string $repository @@ -706,7 +711,7 @@ public function enableAutomatedSecurityFixes(string $username, string $repositor } /** - * @link https://docs.github.com/en/rest/reference/repos#disable-automated-security-fixes + * @link https://docs.github.com/rest/repos/repos#disable-dependabot-security-updates * * @param string $username * @param string $repository @@ -720,16 +725,37 @@ public function disableAutomatedSecurityFixes(string $username, string $reposito return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/automated-security-fixes'); } + /** + * Manage the (classic) projects of a repository. + * + * @link https://docs.github.com/rest/projects/projects + * + * @return Projects + */ public function projects() { return new Projects($this->getClient()); } + /** + * Get the traffic metrics of a repository. + * + * @link https://docs.github.com/rest/metrics/traffic + * + * @return Traffic + */ public function traffic() { return new Traffic($this->getClient()); } + /** + * Manage GitHub Pages for a repository. + * + * @link https://docs.github.com/rest/pages/pages + * + * @return Pages + */ public function pages() { return new Pages($this->getClient()); @@ -742,7 +768,7 @@ public function pages() * * @return array|string * - * @see https://developer.github.com/v3/activity/events/#list-repository-events + * @see https://docs.github.com/rest/activity/events#list-repository-events */ public function events($username, $repository, $page = 1) { @@ -752,7 +778,7 @@ public function events($username, $repository, $page = 1) /** * Get the community profile metrics for a repository. * - * @link https://developer.github.com/v3/repos/community/#retrieve-community-profile-metrics + * @link https://docs.github.com/rest/metrics/community#get-community-profile-metrics * * @param string $username * @param string $repository @@ -770,7 +796,7 @@ public function communityProfile($username, $repository) /** * Get the contents of a repository's code of conduct. * - * @link https://developer.github.com/v3/codes_of_conduct/#get-the-contents-of-a-repositorys-code-of-conduct + * @link https://docs.github.com/rest/codes-of-conduct/codes-of-conduct * * @param string $username * @param string $repository @@ -788,7 +814,7 @@ public function codeOfConduct($username, $repository) /** * List all topics for a repository. * - * @link https://developer.github.com/v3/repos/#list-all-topics-for-a-repository + * @link https://docs.github.com/rest/repos/repos#get-all-repository-topics * * @param string $username * @param string $repository @@ -806,7 +832,7 @@ public function topics($username, $repository) /** * Replace all topics for a repository. * - * @link https://developer.github.com/v3/repos/#replace-all-topics-for-a-repository + * @link https://docs.github.com/rest/repos/repos#replace-all-repository-topics * * @param string $username * @param string $repository @@ -825,7 +851,7 @@ public function replaceTopics($username, $repository, array $topics) /** * Transfer a repository. * - * @link https://developer.github.com/v3/repos/#transfer-a-repository + * @link https://docs.github.com/rest/repos/repos#transfer-a-repository * * @param string $username * @param string $repository @@ -842,7 +868,7 @@ public function transfer($username, $repository, $newOwner, $teamId = []) /** * Create a repository using a template. * - * @link https://developer.github.com/v3/repos/#create-a-repository-using-a-template + * @link https://docs.github.com/rest/repos/repos#create-a-repository-using-a-template * * @return array */ @@ -857,7 +883,7 @@ public function createFromTemplate(string $templateOwner, string $templateRepo, /** * Check if vulnerability alerts are enabled for a repository. * - * @link https://developer.github.com/v3/repos/#check-if-vulnerability-alerts-are-enabled-for-a-repository + * @link https://docs.github.com/rest/repos/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository * * @param string $username the username * @param string $repository the repository @@ -872,7 +898,7 @@ public function isVulnerabilityAlertsEnabled(string $username, string $repositor /** * Enable vulnerability alerts for a repository. * - * @link https://developer.github.com/v3/repos/#enable-vulnerability-alerts + * @link https://docs.github.com/rest/repos/repos#enable-vulnerability-alerts * * @param string $username the username * @param string $repository the repository @@ -887,7 +913,7 @@ public function enableVulnerabilityAlerts(string $username, string $repository) /** * Disable vulnerability alerts for a repository. * - * @link https://developer.github.com/v3/repos/#disable-vulnerability-alerts + * @link https://docs.github.com/rest/repos/repos#disable-vulnerability-alerts * * @param string $username the username * @param string $repository the repository @@ -900,6 +926,10 @@ public function disableVulnerabilityAlerts(string $username, string $repository) } /** + * Manage secret scanning alerts for a repository. + * + * @link https://docs.github.com/rest/secret-scanning/secret-scanning + * * @return SecretScanning */ public function secretScanning(): SecretScanning diff --git a/lib/Github/Api/Repository/Actions/Artifacts.php b/lib/Github/Api/Repository/Actions/Artifacts.php index 84f3b0604af..d2ffe7f5d7f 100644 --- a/lib/Github/Api/Repository/Actions/Artifacts.php +++ b/lib/Github/Api/Repository/Actions/Artifacts.php @@ -5,12 +5,12 @@ use Github\Api\AbstractApi; /** - * @link https://docs.github.com/en/rest/reference/actions#artifacts + * @link https://docs.github.com/rest/actions/artifacts */ class Artifacts extends AbstractApi { /** - * @link https://docs.github.com/en/rest/reference/actions#list-artifacts-for-a-repository + * @link https://docs.github.com/rest/actions/artifacts#list-artifacts-for-a-repository * * @param string $username * @param string $repository @@ -24,7 +24,7 @@ public function all(string $username, string $repository, array $parameters = [] } /** - * @link https://docs.github.com/en/rest/reference/actions#list-workflow-run-artifacts + * @link https://docs.github.com/rest/actions/artifacts#list-workflow-run-artifacts * * @param string $username * @param string $repository @@ -38,7 +38,7 @@ public function runArtifacts(string $username, string $repository, int $runId) } /** - * @link https://docs.github.com/en/rest/reference/actions#get-an-artifact + * @link https://docs.github.com/rest/actions/artifacts#get-an-artifact * * @param string $username * @param string $repository @@ -52,7 +52,7 @@ public function show(string $username, string $repository, int $artifactId) } /** - * @link https://docs.github.com/en/rest/reference/actions#delete-an-artifact + * @link https://docs.github.com/rest/actions/artifacts#delete-an-artifact * * @param string $username * @param string $repository @@ -66,7 +66,7 @@ public function remove(string $username, string $repository, int $artifactId) } /** - * @link https://docs.github.com/en/rest/reference/actions#download-an-artifact + * @link https://docs.github.com/rest/actions/artifacts#download-an-artifact * * @param string $username * @param string $repository diff --git a/lib/Github/Api/Repository/Actions/Secrets.php b/lib/Github/Api/Repository/Actions/Secrets.php index 2085a133f7a..bd9a30c4b2e 100644 --- a/lib/Github/Api/Repository/Actions/Secrets.php +++ b/lib/Github/Api/Repository/Actions/Secrets.php @@ -5,12 +5,12 @@ use Github\Api\AbstractApi; /** - * @link https://docs.github.com/en/rest/reference/actions#secrets + * @link https://docs.github.com/rest/actions/secrets */ class Secrets extends AbstractApi { /** - * @link https://docs.github.com/en/rest/reference/actions#list-repository-secrets + * @link https://docs.github.com/rest/actions/secrets#list-repository-secrets * * @param string $username * @param string $repository @@ -23,7 +23,7 @@ public function all(string $username, string $repository) } /** - * @link https://docs.github.com/en/rest/reference/actions#get-a-repository-secret + * @link https://docs.github.com/rest/actions/secrets#get-a-repository-secret * * @param string $username * @param string $repository @@ -37,7 +37,7 @@ public function show(string $username, string $repository, string $secretName) } /** - * @link https://docs.github.com/en/rest/reference/actions#create-or-update-a-repository-secret + * @link https://docs.github.com/rest/actions/secrets#create-or-update-a-repository-secret * * @param string $username * @param string $repository @@ -52,7 +52,7 @@ public function create(string $username, string $repository, string $secretName, } /** - * @link https://docs.github.com/en/rest/reference/actions#create-or-update-a-repository-secret + * @link https://docs.github.com/rest/actions/secrets#create-or-update-a-repository-secret * * @param string $username * @param string $repository @@ -67,7 +67,7 @@ public function update(string $username, string $repository, string $secretName, } /** - * @link https://docs.github.com/en/rest/reference/actions#delete-a-repository-secret + * @link https://docs.github.com/rest/actions/secrets#delete-a-repository-secret * * @param string $username * @param string $repository @@ -81,7 +81,7 @@ public function remove(string $username, string $repository, string $secretName) } /** - * @link https://docs.github.com/en/rest/reference/actions#get-a-repository-public-key + * @link https://docs.github.com/rest/actions/secrets#get-a-repository-public-key * * @param string $username * @param string $repository diff --git a/lib/Github/Api/Repository/Actions/SelfHostedRunners.php b/lib/Github/Api/Repository/Actions/SelfHostedRunners.php index 7eb1a9d4e39..b24cfb17e2b 100644 --- a/lib/Github/Api/Repository/Actions/SelfHostedRunners.php +++ b/lib/Github/Api/Repository/Actions/SelfHostedRunners.php @@ -5,12 +5,12 @@ use Github\Api\AbstractApi; /** - * @link https://docs.github.com/en/rest/reference/actions#self-hosted-runners + * @link https://docs.github.com/rest/actions/self-hosted-runners */ class SelfHostedRunners extends AbstractApi { /** - * @link https://docs.github.com/en/rest/reference/actions#list-self-hosted-runners-for-a-repository + * @link https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository * * @param string $username * @param string $repository @@ -23,7 +23,7 @@ public function all(string $username, string $repository) } /** - * @link https://docs.github.com/en/rest/reference/actions#get-a-self-hosted-runner-for-a-repository + * @link https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-a-repository * * @param string $username * @param string $repository @@ -37,7 +37,7 @@ public function show(string $username, string $repository, int $runnerId) } /** - * @link https://docs.github.com/en/rest/reference/actions#delete-a-self-hosted-runner-from-a-repository + * @link https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-a-repository * * @param string $username * @param string $repository @@ -51,7 +51,7 @@ public function remove(string $username, string $repository, int $runnerId) } /** - * @link https://docs.github.com/en/rest/reference/actions#list-runner-applications-for-a-repository + * @link https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-a-repository * * @param string $username * @param string $repository diff --git a/lib/Github/Api/Repository/Actions/Variables.php b/lib/Github/Api/Repository/Actions/Variables.php index 7414e82810b..c75bb9838f6 100644 --- a/lib/Github/Api/Repository/Actions/Variables.php +++ b/lib/Github/Api/Repository/Actions/Variables.php @@ -5,12 +5,12 @@ use Github\Api\AbstractApi; /** - * @link https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#about-variables-in-github-actions + * @link https://docs.github.com/rest/actions/variables */ class Variables extends AbstractApi { /** - * @link https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#list-repository-variables + * @link https://docs.github.com/rest/actions/variables#list-repository-variables * * @param string $username * @param string $repository @@ -23,7 +23,7 @@ public function all(string $username, string $repository) } /** - * @link https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#get-a-repository-variable + * @link https://docs.github.com/rest/actions/variables#get-a-repository-variable * * @param string $username * @param string $repository @@ -37,7 +37,7 @@ public function show(string $username, string $repository, string $variableName) } /** - * @link https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#create-a-repository-variable + * @link https://docs.github.com/rest/actions/variables#create-a-repository-variable * * @param string $username * @param string $repository @@ -51,7 +51,7 @@ public function create(string $username, string $repository, array $parameters = } /** - * @link https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#update-a-repository-variable + * @link https://docs.github.com/rest/actions/variables#update-a-repository-variable * * @param string $username * @param string $repository @@ -66,7 +66,7 @@ public function update(string $username, string $repository, string $variableNam } /** - * @link https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#delete-a-repository-variable + * @link https://docs.github.com/rest/actions/variables#delete-a-repository-variable * * @param string $username * @param string $repository diff --git a/lib/Github/Api/Repository/Actions/WorkflowJobs.php b/lib/Github/Api/Repository/Actions/WorkflowJobs.php index 3167d3dbf81..f27e6fd077a 100644 --- a/lib/Github/Api/Repository/Actions/WorkflowJobs.php +++ b/lib/Github/Api/Repository/Actions/WorkflowJobs.php @@ -5,12 +5,12 @@ use Github\Api\AbstractApi; /** - * @link https://docs.github.com/en/rest/reference/actions#workflow-jobs + * @link https://docs.github.com/rest/actions/workflow-jobs */ class WorkflowJobs extends AbstractApi { /** - * @link https://docs.github.com/en/rest/reference/actions#list-jobs-for-a-workflow-run + * @link https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run * * @param string $username * @param string $repository @@ -25,7 +25,7 @@ public function all(string $username, string $repository, int $runId, array $par } /** - * @link https://docs.github.com/en/rest/reference/actions#get-a-job-for-a-workflow-run + * @link https://docs.github.com/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run * * @param string $username * @param string $repository @@ -39,7 +39,7 @@ public function show(string $username, string $repository, int $jobId) } /** - * @link https://docs.github.com/en/rest/reference/actions#download-job-logs-for-a-workflow-run + * @link https://docs.github.com/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run * * @param string $username * @param string $repository diff --git a/lib/Github/Api/Repository/Actions/WorkflowRuns.php b/lib/Github/Api/Repository/Actions/WorkflowRuns.php index d6f95f1ed94..5007471bc32 100644 --- a/lib/Github/Api/Repository/Actions/WorkflowRuns.php +++ b/lib/Github/Api/Repository/Actions/WorkflowRuns.php @@ -5,12 +5,12 @@ use Github\Api\AbstractApi; /** - * @link https://docs.github.com/en/rest/reference/actions#workflow-runs + * @link https://docs.github.com/rest/actions/workflow-runs */ class WorkflowRuns extends AbstractApi { /** - * @link https://docs.github.com/en/rest/reference/actions#list-workflow-runs-for-a-repository + * @link https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-repository * * @param string $username * @param string $repository @@ -24,7 +24,7 @@ public function all(string $username, string $repository, array $parameters = [] } /** - * @link https://docs.github.com/en/rest/reference/actions#list-workflow-runs + * @link https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow * * @param string $username * @param string $repository @@ -39,7 +39,7 @@ public function listRuns(string $username, string $repository, string $workflow, } /** - * @link https://docs.github.com/en/rest/reference/actions#get-a-workflow-run + * @link https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run * * @param string $username * @param string $repository @@ -54,7 +54,7 @@ public function show(string $username, string $repository, int $runId, array $pa } /** - * @link https://docs.github.com/en/rest/reference/actions#delete-a-workflow-run + * @link https://docs.github.com/rest/actions/workflow-runs#delete-a-workflow-run * * @param string $username * @param string $repository @@ -68,7 +68,7 @@ public function remove(string $username, string $repository, int $runId) } /** - * @link https://docs.github.com/en/rest/reference/actions#re-run-a-workflow + * @link https://docs.github.com/rest/actions/workflow-runs#re-run-a-workflow * * @param string $username * @param string $repository @@ -82,7 +82,7 @@ public function rerun(string $username, string $repository, int $runId) } /** - * @link https://docs.github.com/en/rest/reference/actions#cancel-a-workflow-run + * @link https://docs.github.com/rest/actions/workflow-runs#cancel-a-workflow-run * * @param string $username * @param string $repository @@ -96,7 +96,7 @@ public function cancel(string $username, string $repository, int $runId) } /** - * @link https://docs.github.com/en/rest/reference/actions#get-workflow-run-usage + * @link https://docs.github.com/rest/actions/workflow-runs#get-workflow-run-usage * * @param string $username * @param string $repository @@ -110,7 +110,7 @@ public function usage(string $username, string $repository, int $runId) } /** - * @link https://docs.github.com/en/rest/reference/actions#download-workflow-run-logs + * @link https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-logs * * @param string $username * @param string $repository @@ -124,7 +124,7 @@ public function downloadLogs(string $username, string $repository, int $runId) } /** - * @link https://docs.github.com/en/rest/reference/actions#delete-workflow-run-logs + * @link https://docs.github.com/rest/actions/workflow-runs#delete-workflow-run-logs * * @param string $username * @param string $repository @@ -138,7 +138,7 @@ public function deleteLogs(string $username, string $repository, int $runId) } /** - * @link https://docs.github.com/en/rest/reference/actions#approve-a-workflow-run-for-a-fork-pull-request + * @link https://docs.github.com/rest/actions/workflow-runs#approve-a-workflow-run-for-a-fork-pull-request * * @param string $username * @param string $repository diff --git a/lib/Github/Api/Repository/Actions/Workflows.php b/lib/Github/Api/Repository/Actions/Workflows.php index 9a1c9e31c7b..441c0be9fa3 100644 --- a/lib/Github/Api/Repository/Actions/Workflows.php +++ b/lib/Github/Api/Repository/Actions/Workflows.php @@ -5,12 +5,12 @@ use Github\Api\AbstractApi; /** - * @link https://docs.github.com/en/rest/reference/actions#workflows + * @link https://docs.github.com/rest/actions/workflows */ class Workflows extends AbstractApi { /** - * @link https://docs.github.com/en/rest/reference/actions#list-repository-workflows + * @link https://docs.github.com/rest/actions/workflows#list-repository-workflows * * @param string $username * @param string $repository @@ -24,7 +24,7 @@ public function all(string $username, string $repository, array $parameters = [] } /** - * @link https://docs.github.com/en/rest/reference/actions#get-a-workflow + * @link https://docs.github.com/rest/actions/workflows#get-a-workflow * * @param string $username * @param string $repository @@ -42,7 +42,7 @@ public function show(string $username, string $repository, $workflow) } /** - * @link https://docs.github.com/en/rest/reference/actions#get-workflow-usage + * @link https://docs.github.com/rest/actions/workflows#get-workflow-usage * * @param string $username * @param string $repository @@ -60,7 +60,7 @@ public function usage(string $username, string $repository, $workflow) } /** - * @link https://docs.github.com/en/rest/reference/actions#create-a-workflow-dispatch-event + * @link https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event * * @param string $username * @param string $repository diff --git a/lib/Github/Api/Repository/Assets.php b/lib/Github/Api/Repository/Assets.php index 043016e7801..06d8d35538b 100644 --- a/lib/Github/Api/Repository/Assets.php +++ b/lib/Github/Api/Repository/Assets.php @@ -8,7 +8,7 @@ use Github\Exception\MissingArgumentException; /** - * @link http://developer.github.com/v3/repos/releases/ + * @link https://docs.github.com/rest/releases/assets * * @author Evgeniy Guseletov */ @@ -20,6 +20,8 @@ class Assets extends AbstractApi * Get all release's assets in selected repository * GET /repos/:owner/:repo/releases/:id/assets. * + * @link https://docs.github.com/rest/releases/assets#list-release-assets + * * @param string $username the user who owns the repo * @param string $repository the name of the repo * @param int $id the id of the release @@ -35,6 +37,8 @@ public function all($username, $repository, $id) * Get an asset in selected repository's release * GET /repos/:owner/:repo/releases/assets/:id. * + * @link https://docs.github.com/rest/releases/assets#get-a-release-asset + * * @param string $username the user who owns the repo * @param string $repository the name of the repo * @param int $id the id of the asset @@ -57,7 +61,7 @@ public function show($username, $repository, $id, bool $returnBinaryContent = fa * Creating an asset requires support for server name indentification (SNI) * so this must be supported by your PHP version. * - * @see http://developer.github.com/v3/repos/releases/#upload-a-release-asset + * @see https://docs.github.com/rest/releases/assets#upload-a-release-asset * @see http://php.net/manual/en/openssl.constsni.php * * @param string $username the user who owns the repo @@ -88,6 +92,8 @@ public function create($username, $repository, $id, $name, $contentType, $conten * Edit an asset in selected repository's release * PATCH /repos/:owner/:repo/releases/assets/:id. * + * @link https://docs.github.com/rest/releases/assets#update-a-release-asset + * * @param string $username the user who owns the repo * @param string $repository the name of the repo * @param int $id the id of the asset @@ -110,6 +116,8 @@ public function edit($username, $repository, $id, array $params) * Delete an asset in selected repository's release * DELETE /repos/:owner/:repo/releases/assets/:id. * + * @link https://docs.github.com/rest/releases/assets#delete-a-release-asset + * * @param string $username the user who owns the repo * @param string $repository the name of the repo * @param int $id the id of the asset diff --git a/lib/Github/Api/Repository/Checks/CheckRuns.php b/lib/Github/Api/Repository/Checks/CheckRuns.php index 1ddee3770c8..1fd0b834238 100644 --- a/lib/Github/Api/Repository/Checks/CheckRuns.php +++ b/lib/Github/Api/Repository/Checks/CheckRuns.php @@ -6,14 +6,14 @@ use Github\Api\AcceptHeaderTrait; /** - * @link https://docs.github.com/en/rest/reference/checks + * @link https://docs.github.com/rest/checks/runs */ class CheckRuns extends AbstractApi { use AcceptHeaderTrait; /** - * @link https://docs.github.com/en/rest/reference/checks#create-a-check-run + * @link https://docs.github.com/rest/checks/runs#create-a-check-run * * @return array */ @@ -25,7 +25,7 @@ public function create(string $username, string $repository, array $params = []) } /** - * @link https://docs.github.com/en/rest/reference/checks#get-a-check-run + * @link https://docs.github.com/rest/checks/runs#get-a-check-run * * @return array */ @@ -37,7 +37,7 @@ public function show(string $username, string $repository, int $checkRunId) } /** - * @link https://docs.github.com/en/rest/reference/checks#update-a-check-run + * @link https://docs.github.com/rest/checks/runs#update-a-check-run * * @return array */ @@ -49,7 +49,7 @@ public function update(string $username, string $repository, int $checkRunId, ar } /** - * @link https://docs.github.com/en/rest/reference/checks#list-check-run-annotations + * @link https://docs.github.com/rest/checks/runs#list-check-run-annotations * * @return array */ @@ -61,7 +61,7 @@ public function annotations(string $username, string $repository, int $checkRunI } /** - * @link https://docs.github.com/en/rest/reference/checks#list-check-runs-in-a-check-suite + * @link https://docs.github.com/rest/checks/runs#list-check-runs-in-a-check-suite * * @return array */ @@ -73,7 +73,7 @@ public function allForCheckSuite(string $username, string $repository, int $chec } /** - * @link https://docs.github.com/en/rest/reference/checks#list-check-runs-for-a-git-reference + * @link https://docs.github.com/rest/checks/runs#list-check-runs-for-a-git-reference * * @return array */ @@ -85,7 +85,7 @@ public function allForReference(string $username, string $repository, string $re } /** - * @link https://docs.github.com/en/rest/reference/checks#rerequest-a-check-run + * @link https://docs.github.com/rest/checks/runs#rerequest-a-check-run * * @return array */ diff --git a/lib/Github/Api/Repository/Checks/CheckSuites.php b/lib/Github/Api/Repository/Checks/CheckSuites.php index 40c83a566c1..47fd0cd2be3 100644 --- a/lib/Github/Api/Repository/Checks/CheckSuites.php +++ b/lib/Github/Api/Repository/Checks/CheckSuites.php @@ -6,14 +6,14 @@ use Github\Api\AcceptHeaderTrait; /** - * @link https://docs.github.com/en/rest/reference/checks + * @link https://docs.github.com/rest/checks/suites */ class CheckSuites extends AbstractApi { use AcceptHeaderTrait; /** - * @link https://docs.github.com/en/rest/reference/checks#create-a-check-suite + * @link https://docs.github.com/rest/checks/suites#create-a-check-suite * * @return array */ @@ -25,7 +25,7 @@ public function create(string $username, string $repository, array $params = []) } /** - * @link https://docs.github.com/en/rest/reference/checks#update-repository-preferences-for-check-suites + * @link https://docs.github.com/rest/checks/suites#update-repository-preferences-for-check-suites * * @return array */ @@ -37,7 +37,7 @@ public function updatePreferences(string $username, string $repository, array $p } /** - * @link https://docs.github.com/en/rest/reference/checks#get-a-check-suite + * @link https://docs.github.com/rest/checks/suites#get-a-check-suite * * @return array */ @@ -49,7 +49,7 @@ public function getCheckSuite(string $username, string $repository, int $checkSu } /** - * @link https://docs.github.com/en/rest/reference/checks#rerequest-a-check-suite + * @link https://docs.github.com/rest/checks/suites#rerequest-a-check-suite * * @return array */ @@ -61,7 +61,7 @@ public function rerequest(string $username, string $repository, int $checkSuiteI } /** - * @link https://docs.github.com/en/rest/reference/checks#list-check-suites-for-a-git-reference + * @link https://docs.github.com/rest/checks/suites#list-check-suites-for-a-git-reference * * @return array */ diff --git a/lib/Github/Api/Repository/Collaborators.php b/lib/Github/Api/Repository/Collaborators.php index 5c61b9bfee3..95bf541be99 100644 --- a/lib/Github/Api/Repository/Collaborators.php +++ b/lib/Github/Api/Repository/Collaborators.php @@ -5,14 +5,14 @@ use Github\Api\AbstractApi; /** - * @link http://developer.github.com/v3/repos/collaborators/ + * @link https://docs.github.com/rest/collaborators/collaborators * * @author Joseph Bielawski */ class Collaborators extends AbstractApi { /** - * @link https://developer.github.com/v3/repos/collaborators/#list-collaborators + * @link https://docs.github.com/rest/collaborators/collaborators#list-repository-collaborators * * @param string $username * @param string $repository @@ -26,7 +26,7 @@ public function all($username, $repository, array $params = []) } /** - * @link https://developer.github.com/v3/repos/collaborators/#check-if-a-user-is-a-collaborator + * @link https://docs.github.com/rest/collaborators/collaborators#check-if-a-user-is-a-repository-collaborator * * @param string $username * @param string $repository @@ -40,7 +40,7 @@ public function check($username, $repository, $collaborator) } /** - * @link https://developer.github.com/v3/repos/collaborators/#add-user-as-a-collaborator + * @link https://docs.github.com/rest/collaborators/collaborators#add-a-repository-collaborator * * @param string $username * @param string $repository @@ -55,7 +55,7 @@ public function add($username, $repository, $collaborator, array $params = []) } /** - * @link https://developer.github.com/v3/repos/collaborators/#remove-user-as-a-collaborator + * @link https://docs.github.com/rest/collaborators/collaborators#remove-a-repository-collaborator * * @param string $username * @param string $repository @@ -69,7 +69,7 @@ public function remove($username, $repository, $collaborator) } /** - * @link https://developer.github.com/v3/repos/collaborators/#review-a-users-permission-level + * @link https://docs.github.com/rest/collaborators/collaborators#get-repository-permissions-for-a-user * * @param string $username * @param string $repository diff --git a/lib/Github/Api/Repository/Comments.php b/lib/Github/Api/Repository/Comments.php index 40eb2b53388..0458ef1e968 100644 --- a/lib/Github/Api/Repository/Comments.php +++ b/lib/Github/Api/Repository/Comments.php @@ -7,7 +7,7 @@ use Github\Exception\MissingArgumentException; /** - * @link http://developer.github.com/v3/repos/comments/ + * @link https://docs.github.com/rest/commits/comments * * @author Joseph Bielawski * @author Tobias Nyholm @@ -19,7 +19,7 @@ class Comments extends AbstractApi /** * Configure the body type. * - * @link https://developer.github.com/v3/repos/comments/#custom-media-types + * @link https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types * * @param string|null $bodyType * @@ -36,6 +36,17 @@ public function configure($bodyType = null) return $this; } + /** + * List commit comments for a repository, or list comments for a single commit when $sha is given. + * + * @link https://docs.github.com/rest/commits/comments#list-commit-comments-for-a-repository + * + * @param string $username the username + * @param string $repository the repository + * @param string|null $sha the SHA of the commit to list comments for + * + * @return array + */ public function all($username, $repository, $sha = null) { if (null === $sha) { @@ -45,11 +56,36 @@ public function all($username, $repository, $sha = null) return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($sha).'/comments'); } + /** + * Get a commit comment. + * + * @link https://docs.github.com/rest/commits/comments#get-a-commit-comment + * + * @param string $username the username + * @param string $repository the repository + * @param int|string $comment the ID of the comment + * + * @return array + */ public function show($username, $repository, $comment) { return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/comments/'.rawurlencode($comment)); } + /** + * Create a commit comment. + * + * @link https://docs.github.com/rest/commits/comments#create-a-commit-comment + * + * @param string $username the username + * @param string $repository the repository + * @param string $sha the SHA of the commit to comment on + * @param array $params the parameters (e.g. body, path, position, line) + * + * @throws MissingArgumentException + * + * @return array + */ public function create($username, $repository, $sha, array $params) { if (!isset($params['body'])) { @@ -59,6 +95,20 @@ public function create($username, $repository, $sha, array $params) return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($sha).'/comments', $params); } + /** + * Update a commit comment. + * + * @link https://docs.github.com/rest/commits/comments#update-a-commit-comment + * + * @param string $username the username + * @param string $repository the repository + * @param int|string $comment the ID of the comment to update + * @param array $params the parameters to update (e.g. body) + * + * @throws MissingArgumentException + * + * @return array + */ public function update($username, $repository, $comment, array $params) { if (!isset($params['body'])) { @@ -68,6 +118,17 @@ public function update($username, $repository, $comment, array $params) return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/comments/'.rawurlencode($comment), $params); } + /** + * Delete a commit comment. + * + * @link https://docs.github.com/rest/commits/comments#delete-a-commit-comment + * + * @param string $username the username + * @param string $repository the repository + * @param int|string $comment the ID of the comment to delete + * + * @return array + */ public function remove($username, $repository, $comment) { return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/comments/'.rawurlencode($comment)); diff --git a/lib/Github/Api/Repository/Commits.php b/lib/Github/Api/Repository/Commits.php index 0bc5598cbff..f1e5b03b4bb 100644 --- a/lib/Github/Api/Repository/Commits.php +++ b/lib/Github/Api/Repository/Commits.php @@ -5,17 +5,42 @@ use Github\Api\AbstractApi; /** - * @link http://developer.github.com/v3/repos/commits/ + * @link https://docs.github.com/rest/commits/commits * * @author Joseph Bielawski */ class Commits extends AbstractApi { + /** + * List commits. + * + * @link https://docs.github.com/rest/commits/commits#list-commits + * + * @param string $username the username + * @param string $repository the repository + * @param array $params a list of extra parameters + * + * @return array + */ public function all($username, $repository, array $params) { return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits', $params); } + /** + * Compare two commits. + * + * @link https://docs.github.com/rest/commits/commits#compare-two-commits + * + * @param string $username the username + * @param string $repository the repository + * @param string $base the base branch or commit SHA + * @param string $head the head branch or commit SHA + * @param string|null $mediaType the Accept header media type to use + * @param array $params a list of extra parameters + * + * @return array + */ public function compare($username, $repository, $base, $head, $mediaType = null, array $params = []) { $headers = []; @@ -26,11 +51,34 @@ public function compare($username, $repository, $base, $head, $mediaType = null, return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/compare/'.rawurlencode($base).'...'.rawurlencode($head), $params, $headers); } + /** + * Get a commit. + * + * @link https://docs.github.com/rest/commits/commits#get-a-commit + * + * @param string $username the username + * @param string $repository the repository + * @param string $sha the SHA of the commit + * + * @return array + */ public function show($username, $repository, $sha) { return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($sha)); } + /** + * List pull requests associated with a commit. + * + * @link https://docs.github.com/rest/commits/commits#list-pull-requests-associated-with-a-commit + * + * @param string $username the username + * @param string $repository the repository + * @param string $sha the SHA of the commit + * @param array $params a list of extra parameters + * + * @return array + */ public function pulls($username, $repository, $sha, array $params = []) { return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($sha).'/pulls', $params); diff --git a/lib/Github/Api/Repository/Contents.php b/lib/Github/Api/Repository/Contents.php index a3cc1a3ea0e..96352129109 100644 --- a/lib/Github/Api/Repository/Contents.php +++ b/lib/Github/Api/Repository/Contents.php @@ -10,7 +10,7 @@ use Github\Exception\TwoFactorAuthenticationRequiredException; /** - * @link http://developer.github.com/v3/repos/contents/ + * @link https://docs.github.com/rest/repos/contents * * @author Joseph Bielawski */ @@ -21,7 +21,7 @@ class Contents extends AbstractApi /** * Configure the body type. * - * @link https://developer.github.com/v3/repo/contents/#custom-media-types + * @link https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types * * @param string|null $bodyType * @@ -41,7 +41,7 @@ public function configure($bodyType = null) /** * Get content of README file in a repository. * - * @link http://developer.github.com/v3/repos/contents/ + * @link https://docs.github.com/rest/repos/contents#get-a-repository-readme * * @param string $username the user who owns the repository * @param string $repository the name of the repository @@ -59,7 +59,7 @@ public function readme($username, $repository, $reference = null) /** * Get contents of any file or directory in a repository. * - * @link http://developer.github.com/v3/repos/contents/ + * @link https://docs.github.com/rest/repos/contents#get-repository-content * * @param string $username the user who owns the repository * @param string $repository the name of the repository @@ -84,7 +84,7 @@ public function show($username, $repository, $path = null, $reference = null, $r /** * Creates a new file in a repository. * - * @link http://developer.github.com/v3/repos/contents/#create-a-file + * @link https://docs.github.com/rest/repos/contents#create-or-update-file-contents * * @param string $username the user who owns the repository * @param string $repository the name of the repository @@ -159,7 +159,7 @@ public function exists($username, $repository, $path, $reference = null) /** * Updates the contents of a file in a repository. * - * @link http://developer.github.com/v3/repos/contents/#update-a-file + * @link https://docs.github.com/rest/repos/contents#create-or-update-file-contents * * @param string $username the user who owns the repository * @param string $repository the name of the repository @@ -201,7 +201,7 @@ public function update($username, $repository, $path, $content, $message, $sha, /** * Deletes a file from a repository. * - * @link http://developer.github.com/v3/repos/contents/#delete-a-file + * @link https://docs.github.com/rest/repos/contents#delete-a-file * * @param string $username the user who owns the repository * @param string $repository the name of the repository @@ -241,7 +241,7 @@ public function rm($username, $repository, $path, $message, $sha, $branch = null /** * Get content of archives in a repository. * - * @link http://developer.github.com/v3/repos/contents/ + * @link https://docs.github.com/rest/repos/contents#download-a-repository-archive-tar * * @param string $username the user who owns the repository * @param string $repository the name of the repository @@ -301,7 +301,7 @@ public function download($username, $repository, $path, $reference = null) * * Use this method instead of the download method if your file is bigger than 1MB * - * @see https://docs.github.com/en/rest/repos/contents + * @see https://docs.github.com/rest/repos/contents#get-repository-content * * @param string $username the user who owns the repository * @param string $repository the name of the repository diff --git a/lib/Github/Api/Repository/DeployKeys.php b/lib/Github/Api/Repository/DeployKeys.php index 0e45ccb626a..5ea9bd88c7e 100644 --- a/lib/Github/Api/Repository/DeployKeys.php +++ b/lib/Github/Api/Repository/DeployKeys.php @@ -6,22 +6,56 @@ use Github\Exception\MissingArgumentException; /** - * @link http://developer.github.com/v3/repos/keys/ + * @link https://docs.github.com/rest/deploy-keys/deploy-keys * * @author Joseph Bielawski */ class DeployKeys extends AbstractApi { + /** + * List the deploy keys of a repository. + * + * @link https://docs.github.com/rest/deploy-keys/deploy-keys#list-deploy-keys + * + * @param string $username the username + * @param string $repository the repository + * + * @return array + */ public function all($username, $repository) { return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/keys'); } + /** + * Get a single deploy key of a repository. + * + * @link https://docs.github.com/rest/deploy-keys/deploy-keys#get-a-deploy-key + * + * @param string $username the username + * @param string $repository the repository + * @param int|string $id the id of the deploy key + * + * @return array + */ public function show($username, $repository, $id) { return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/keys/'.rawurlencode($id)); } + /** + * Create a deploy key for a repository. + * + * @link https://docs.github.com/rest/deploy-keys/deploy-keys#create-a-deploy-key + * + * @param string $username the username + * @param string $repository the repository + * @param array $params the parameters (title, key, read_only) + * + * @throws MissingArgumentException + * + * @return array + */ public function create($username, $repository, array $params) { if (!isset($params['title'], $params['key'])) { @@ -31,6 +65,23 @@ public function create($username, $repository, array $params) return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/keys', $params); } + /** + * "Update" a deploy key of a repository. + * + * The GitHub Deploy Keys API has no update endpoint: this deletes the + * existing key and recreates it with the given parameters. + * + * @link https://docs.github.com/rest/deploy-keys/deploy-keys + * + * @param string $username the username + * @param string $repository the repository + * @param int $id the id of the deploy key to replace + * @param array $params the parameters (title, key, read_only) + * + * @throws MissingArgumentException + * + * @return array + */ public function update($username, $repository, $id, array $params) { if (!isset($params['title'], $params['key'])) { @@ -42,6 +93,17 @@ public function update($username, $repository, $id, array $params) return $this->create($username, $repository, $params); } + /** + * Delete a deploy key from a repository. + * + * @link https://docs.github.com/rest/deploy-keys/deploy-keys#delete-a-deploy-key + * + * @param string $username the username + * @param string $repository the repository + * @param int|string $id the id of the deploy key + * + * @return array + */ public function remove($username, $repository, $id) { return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/keys/'.rawurlencode($id)); diff --git a/lib/Github/Api/Repository/Downloads.php b/lib/Github/Api/Repository/Downloads.php index c959c61545e..fededeb4a7b 100644 --- a/lib/Github/Api/Repository/Downloads.php +++ b/lib/Github/Api/Repository/Downloads.php @@ -5,7 +5,11 @@ use Github\Api\AbstractApi; /** - * @link http://developer.github.com/v3/repos/downloads/ + * The "Downloads" API has been removed by GitHub; use the Releases API to upload and manage release assets instead. + * + * @deprecated This API was retired by GitHub years ago (uploading files as repository "downloads" is no longer + * supported) and no longer has any documentation on docs.github.com. Use the Releases API + * (@see \Github\Api\Repository\Releases and its Assets sub-API) to upload assets instead. * * @author Joseph Bielawski */ @@ -14,7 +18,7 @@ class Downloads extends AbstractApi /** * List downloads in selected repository. * - * @link http://developer.github.com/v3/repos/downloads/#list-downloads-for-a-repository + * @deprecated The GitHub Downloads API no longer exists; it was replaced by uploading assets on Releases. * * @param string $username the user who owns the repo * @param string $repository the name of the repo @@ -29,7 +33,7 @@ public function all($username, $repository) /** * Get a download in selected repository. * - * @link http://developer.github.com/v3/repos/downloads/#get-a-single-download + * @deprecated The GitHub Downloads API no longer exists; it was replaced by uploading assets on Releases. * * @param string $username the user who owns the repo * @param string $repository the name of the repo @@ -45,7 +49,7 @@ public function show($username, $repository, $id) /** * Delete a download in selected repository. * - * @link http://developer.github.com/v3/repos/downloads/#delete-a-download + * @deprecated The GitHub Downloads API no longer exists; it was replaced by uploading assets on Releases. * * @param string $username the user who owns the repo * @param string $repository the name of the repo diff --git a/lib/Github/Api/Repository/Forks.php b/lib/Github/Api/Repository/Forks.php index 961dc64944a..d19d8c83276 100644 --- a/lib/Github/Api/Repository/Forks.php +++ b/lib/Github/Api/Repository/Forks.php @@ -5,12 +5,23 @@ use Github\Api\AbstractApi; /** - * @link http://developer.github.com/v3/repos/forks/ + * @link https://docs.github.com/rest/repos/forks * * @author Joseph Bielawski */ class Forks extends AbstractApi { + /** + * List forks of a repository. + * + * @link https://docs.github.com/rest/repos/forks#list-forks + * + * @param string $username the username + * @param string $repository the repository + * @param array $params the parameters (e.g. sort) + * + * @return array + */ public function all($username, $repository, array $params = []) { if (isset($params['sort']) && !in_array($params['sort'], ['newest', 'oldest', 'watchers'])) { @@ -20,6 +31,17 @@ public function all($username, $repository, array $params = []) return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/forks', array_merge(['page' => 1], $params)); } + /** + * Create a fork of a repository. + * + * @link https://docs.github.com/rest/repos/forks#create-a-fork + * + * @param string $username the username + * @param string $repository the repository + * @param array $params the parameters (e.g. organization, name, default_branch_only) + * + * @return array + */ public function create($username, $repository, array $params = []) { return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/forks', $params); diff --git a/lib/Github/Api/Repository/Hooks.php b/lib/Github/Api/Repository/Hooks.php index be87e0146b6..5654e3e98f0 100644 --- a/lib/Github/Api/Repository/Hooks.php +++ b/lib/Github/Api/Repository/Hooks.php @@ -6,22 +6,56 @@ use Github\Exception\MissingArgumentException; /** - * @link http://developer.github.com/v3/repos/hooks/ + * @link https://docs.github.com/rest/repos/webhooks * * @author Joseph Bielawski */ class Hooks extends AbstractApi { + /** + * List webhooks for a repository. + * + * @link https://docs.github.com/rest/repos/webhooks#list-repository-webhooks + * + * @param string $username the username + * @param string $repository the repository + * + * @return array + */ public function all($username, $repository) { return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/hooks'); } + /** + * Get a single webhook for a repository. + * + * @link https://docs.github.com/rest/repos/webhooks#get-a-repository-webhook + * + * @param string $username the username + * @param string $repository the repository + * @param int|string $id the id of the webhook + * + * @return array + */ public function show($username, $repository, $id) { return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/hooks/'.rawurlencode($id)); } + /** + * Create a webhook for a repository. + * + * @link https://docs.github.com/rest/repos/webhooks#create-a-repository-webhook + * + * @param string $username the username + * @param string $repository the repository + * @param array $params the parameters (name, config, events, active) + * + * @throws MissingArgumentException + * + * @return array + */ public function create($username, $repository, array $params) { if (!isset($params['name'], $params['config'])) { @@ -31,6 +65,20 @@ public function create($username, $repository, array $params) return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/hooks', $params); } + /** + * Update a webhook for a repository. + * + * @link https://docs.github.com/rest/repos/webhooks#update-a-repository-webhook + * + * @param string $username the username + * @param string $repository the repository + * @param int|string $id the id of the webhook + * @param array $params the parameters to update (config, events, add_events, remove_events, active) + * + * @throws MissingArgumentException + * + * @return array + */ public function update($username, $repository, $id, array $params) { if (!isset($params['config'])) { @@ -40,16 +88,49 @@ public function update($username, $repository, $id, array $params) return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/hooks/'.rawurlencode($id), $params); } + /** + * Ping a webhook for a repository. + * + * @link https://docs.github.com/rest/repos/webhooks#ping-a-repository-webhook + * + * @param string $username the username + * @param string $repository the repository + * @param int|string $id the id of the webhook + * + * @return array + */ public function ping($username, $repository, $id) { return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/hooks/'.rawurlencode($id).'/pings'); } + /** + * Trigger a test push event for a webhook for a repository. + * + * @link https://docs.github.com/rest/repos/webhooks#test-the-push-repository-webhook + * + * @param string $username the username + * @param string $repository the repository + * @param int|string $id the id of the webhook + * + * @return array + */ public function test($username, $repository, $id) { return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/hooks/'.rawurlencode($id).'/tests'); } + /** + * Delete a webhook for a repository. + * + * @link https://docs.github.com/rest/repos/webhooks#delete-a-repository-webhook + * + * @param string $username the username + * @param string $repository the repository + * @param int|string $id the id of the webhook + * + * @return array + */ public function remove($username, $repository, $id) { return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/hooks/'.rawurlencode($id)); diff --git a/lib/Github/Api/Repository/Labels.php b/lib/Github/Api/Repository/Labels.php index 28ca4d53c0f..2fe0778dda7 100644 --- a/lib/Github/Api/Repository/Labels.php +++ b/lib/Github/Api/Repository/Labels.php @@ -6,22 +6,56 @@ use Github\Exception\MissingArgumentException; /** - * @link http://developer.github.com/v3/issues/labels/ + * @link https://docs.github.com/rest/issues/labels * * @author Joseph Bielawski */ class Labels extends AbstractApi { + /** + * List labels for a repository. + * + * @link https://docs.github.com/rest/issues/labels#list-labels-for-a-repository + * + * @param string $username the username + * @param string $repository the repository + * + * @return array + */ public function all($username, $repository) { return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels'); } + /** + * Get a single label of a repository. + * + * @link https://docs.github.com/rest/issues/labels#get-a-label + * + * @param string $username the username + * @param string $repository the repository + * @param string $label the name of the label + * + * @return array + */ public function show($username, $repository, $label) { return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels/'.rawurlencode($label)); } + /** + * Create a label for a repository. + * + * @link https://docs.github.com/rest/issues/labels#create-a-label + * + * @param string $username the username + * @param string $repository the repository + * @param array $params the parameters (name, color, description) + * + * @throws MissingArgumentException + * + * @return array + */ public function create($username, $repository, array $params) { if (!isset($params['name'], $params['color'])) { @@ -31,11 +65,34 @@ public function create($username, $repository, array $params) return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels', $params); } + /** + * Update a label of a repository. + * + * @link https://docs.github.com/rest/issues/labels#update-a-label + * + * @param string $username the username + * @param string $repository the repository + * @param string $label the name of the label to update + * @param array $params the parameters to update (new_name, color, description) + * + * @return array + */ public function update($username, $repository, $label, array $params) { return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels/'.rawurlencode($label), $params); } + /** + * Delete a label from a repository. + * + * @link https://docs.github.com/rest/issues/labels#delete-a-label + * + * @param string $username the username + * @param string $repository the repository + * @param string $label the name of the label + * + * @return array + */ public function remove($username, $repository, $label) { return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels/'.rawurlencode($label)); diff --git a/lib/Github/Api/Repository/Pages.php b/lib/Github/Api/Repository/Pages.php index b641cb957c0..a66fcfc2adc 100644 --- a/lib/Github/Api/Repository/Pages.php +++ b/lib/Github/Api/Repository/Pages.php @@ -6,7 +6,7 @@ use Github\Api\AcceptHeaderTrait; /** - * @link https://developer.github.com/v3/repos/pages/ + * @link https://docs.github.com/rest/pages/pages * * @author yunwuxin */ @@ -14,11 +14,32 @@ class Pages extends AbstractApi { use AcceptHeaderTrait; + /** + * Get a GitHub Pages site for a repository. + * + * @link https://docs.github.com/rest/pages/pages#get-a-github-pages-site + * + * @param string $username the username + * @param string $repository the repository + * + * @return array + */ public function show($username, $repository) { return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages'); } + /** + * Create a GitHub Pages site for a repository. + * + * @link https://docs.github.com/rest/pages/pages#create-a-github-pages-site + * + * @param string $username the username + * @param string $repository the repository + * @param array $params the parameters (build_type, source) + * + * @return array + */ public function enable($username, $repository, array $params = []) { $this->acceptHeaderValue = 'application/vnd.github.switcheroo-preview+json'; @@ -26,6 +47,16 @@ public function enable($username, $repository, array $params = []) return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages', $params); } + /** + * Delete a GitHub Pages site for a repository. + * + * @link https://docs.github.com/rest/pages/pages#delete-a-github-pages-site + * + * @param string $username the username + * @param string $repository the repository + * + * @return array + */ public function disable($username, $repository) { $this->acceptHeaderValue = 'application/vnd.github.switcheroo-preview+json'; @@ -33,26 +64,78 @@ public function disable($username, $repository) return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages'); } + /** + * Update information about a GitHub Pages site for a repository. + * + * @link https://docs.github.com/rest/pages/pages#update-information-about-a-github-pages-site + * + * @param string $username the username + * @param string $repository the repository + * @param array $params the parameters to update (build_type, source, cname, https_enforced, public) + * + * @return array + */ public function update($username, $repository, array $params = []) { return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages', $params); } + /** + * Request a GitHub Pages build for a repository. + * + * @link https://docs.github.com/rest/pages/pages#request-a-github-pages-build + * + * @param string $username the username + * @param string $repository the repository + * + * @return array + */ public function requestBuild($username, $repository) { return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages/builds'); } + /** + * List GitHub Pages builds for a repository. + * + * @link https://docs.github.com/rest/pages/pages#list-github-pages-builds + * + * @param string $username the username + * @param string $repository the repository + * + * @return array + */ public function builds($username, $repository) { return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages/builds'); } + /** + * Get the latest GitHub Pages build for a repository. + * + * @link https://docs.github.com/rest/pages/pages#get-latest-pages-build + * + * @param string $username the username + * @param string $repository the repository + * + * @return array + */ public function showLatestBuild($username, $repository) { return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages/builds/latest'); } + /** + * Get a GitHub Pages build for a repository. + * + * @link https://docs.github.com/rest/pages/pages#get-github-pages-build + * + * @param string $username the username + * @param string $repository the repository + * @param int|string $id the id of the pages build + * + * @return array + */ public function showBuild($username, $repository, $id) { return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages/builds/'.rawurlencode($id)); diff --git a/lib/Github/Api/Repository/Projects.php b/lib/Github/Api/Repository/Projects.php index 9db29f5578d..849d55d153b 100644 --- a/lib/Github/Api/Repository/Projects.php +++ b/lib/Github/Api/Repository/Projects.php @@ -5,13 +5,45 @@ use Github\Api\Project\AbstractProjectApi; use Github\Exception\MissingArgumentException; +/** + * Repository-scoped "Projects (classic)" boards. + * + * @deprecated GitHub Projects (classic) was sunset on 2024-08-23 and this REST API is no longer part of the + * current documentation on docs.github.com (superseded by the Projects v2 GraphQL/REST API). + */ class Projects extends AbstractProjectApi { + /** + * List the classic projects of a repository. + * + * @deprecated GitHub Projects (classic) was sunset by GitHub; this endpoint no longer has documentation + * on docs.github.com. + * + * @param string $username the username + * @param string $repository the repository + * @param array $params the parameters (state) + * + * @return array + */ public function all($username, $repository, array $params = []) { return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/projects', array_merge(['page' => 1], $params)); } + /** + * Create a classic project for a repository. + * + * @deprecated GitHub Projects (classic) was sunset by GitHub; this endpoint no longer has documentation + * on docs.github.com. + * + * @param string $username the username + * @param string $repository the repository + * @param array $params the parameters (name, body) + * + * @throws MissingArgumentException + * + * @return array + */ public function create($username, $repository, array $params) { if (!isset($params['name'])) { diff --git a/lib/Github/Api/Repository/Protection.php b/lib/Github/Api/Repository/Protection.php index b559557a944..24a65e5fd1c 100644 --- a/lib/Github/Api/Repository/Protection.php +++ b/lib/Github/Api/Repository/Protection.php @@ -6,7 +6,7 @@ use Github\Api\AcceptHeaderTrait; /** - * @link https://developer.github.com/v3/repos/branches/ + * @link https://docs.github.com/rest/branches/branch-protection * * @author Brandon Bloodgood */ @@ -17,7 +17,7 @@ class Protection extends AbstractApi /** * Retrieves configured protection for the provided branch. * - * @link https://developer.github.com/v3/repos/branches/#get-branch-protection + * @link https://docs.github.com/rest/branches/branch-protection#get-branch-protection * * @param string $username The user who owns the repository * @param string $repository The name of the repo @@ -36,7 +36,7 @@ public function show($username, $repository, $branch) /** * Updates the repo's branch protection. * - * @link https://developer.github.com/v3/repos/branches/#update-branch-protection + * @link https://docs.github.com/rest/branches/branch-protection#update-branch-protection * * @param string $username The user who owns the repository * @param string $repository The name of the repo @@ -56,7 +56,7 @@ public function update($username, $repository, $branch, array $params = []) /** * Remove the repo's branch protection. * - * @link https://developer.github.com/v3/repos/branches/#remove-branch-protection + * @link https://docs.github.com/rest/branches/branch-protection#delete-branch-protection * * @param string $username The user who owns the repository * @param string $repository The name of the repo @@ -70,7 +70,7 @@ public function remove($username, $repository, $branch) /** * Get required status checks of protected branch. * - * @link https://developer.github.com/v3/repos/branches/#get-required-status-checks-of-protected-branch + * @link https://docs.github.com/rest/branches/branch-protection#get-status-checks-protection * * @param string $username The user who owns the repository * @param string $repository The name of the repo @@ -86,7 +86,7 @@ public function showStatusChecks($username, $repository, $branch) /** * Update required status checks of protected branch. * - * @link https://developer.github.com/v3/repos/branches/#update-required-status-checks-of-protected-branch + * @link https://docs.github.com/rest/branches/branch-protection#update-status-check-protection * * @param string $username The user who owns the repository * @param string $repository The name of the repo @@ -103,7 +103,7 @@ public function updateStatusChecks($username, $repository, $branch, array $param /** * Remove required status checks of protected branch. * - * @link https://developer.github.com/v3/repos/branches/#remove-required-status-checks-of-protected-branch + * @link https://docs.github.com/rest/branches/branch-protection#remove-status-check-protection * * @param string $username The user who owns the repository * @param string $repository The name of the repo @@ -117,7 +117,7 @@ public function removeStatusChecks($username, $repository, $branch) /** * List required status checks contexts of protected branch. * - * @link https://developer.github.com/v3/repos/branches/#list-required-status-checks-contexts-of-protected-branch + * @link https://docs.github.com/rest/branches/branch-protection#get-all-status-check-contexts * * @param string $username The user who owns the repository * @param string $repository The name of the repo @@ -133,7 +133,7 @@ public function showStatusChecksContexts($username, $repository, $branch) /** * Replace required status checks contexts of protected branch. * - * @link https://developer.github.com/v3/repos/branches/#replace-required-status-checks-contexts-of-protected-branch + * @link https://docs.github.com/rest/branches/branch-protection#set-status-check-contexts * * @param string $username The user who owns the repository * @param string $repository The name of the repo @@ -150,7 +150,7 @@ public function replaceStatusChecksContexts($username, $repository, $branch, arr /** * Add required status checks contexts of protected branch. * - * @link https://developer.github.com/v3/repos/branches/#add-required-status-checks-contexts-of-protected-branch + * @link https://docs.github.com/rest/branches/branch-protection#add-status-check-contexts * * @param string $username The user who owns the repository * @param string $repository The name of the repo @@ -167,7 +167,7 @@ public function addStatusChecksContexts($username, $repository, $branch, array $ /** * Remove required status checks contexts of protected branch. * - * @link https://developer.github.com/v3/repos/branches/#remove-required-status-checks-contexts-of-protected-branch + * @link https://docs.github.com/rest/branches/branch-protection#remove-status-check-contexts * * @param string $username The user who owns the repository * @param string $repository The name of the repo @@ -184,7 +184,7 @@ public function removeStatusChecksContexts($username, $repository, $branch, arra /** * Get pull request review enforcement of protected branch. * - * @link https://developer.github.com/v3/repos/branches/#get-pull-request-review-enforcement-of-protected-branch + * @link https://docs.github.com/rest/branches/branch-protection#get-pull-request-review-protection * * @param string $username The user who owns the repository * @param string $repository The name of the repo @@ -200,7 +200,7 @@ public function showPullRequestReviewEnforcement($username, $repository, $branch /** * Update pull request review enforcement of protected branch. * - * @link https://developer.github.com/v3/repos/branches/#update-pull-request-review-enforcement-of-protected-branch + * @link https://docs.github.com/rest/branches/branch-protection#update-pull-request-review-protection * * @param string $username The user who owns the repository * @param string $repository The name of the repo @@ -217,7 +217,7 @@ public function updatePullRequestReviewEnforcement($username, $repository, $bran /** * Remove pull request review enforcement of protected branch. * - * @link https://developer.github.com/v3/repos/branches/#remove-pull-request-review-enforcement-of-protected-branch + * @link https://docs.github.com/rest/branches/branch-protection#delete-pull-request-review-protection * * @param string $username The user who owns the repository * @param string $repository The name of the repo @@ -231,7 +231,7 @@ public function removePullRequestReviewEnforcement($username, $repository, $bran /** * Get admin enforcement of protected branch. * - * @link https://developer.github.com/v3/repos/branches/#get-admin-enforcement-of-protected-branch + * @link https://docs.github.com/rest/branches/branch-protection#get-admin-branch-protection * * @param string $username The user who owns the repository * @param string $repository The name of the repo @@ -247,7 +247,7 @@ public function showAdminEnforcement($username, $repository, $branch) /** * Add admin enforcement of protected branch. * - * @link https://developer.github.com/v3/repos/branches/#add-admin-enforcement-of-protected-branch + * @link https://docs.github.com/rest/branches/branch-protection#set-admin-branch-protection * * @param string $username The user who owns the repository * @param string $repository The name of the repo @@ -263,7 +263,7 @@ public function addAdminEnforcement($username, $repository, $branch) /** * Remove admin enforcement of protected branch. * - * @link https://developer.github.com/v3/repos/branches/#remove-admin-enforcement-of-protected-branch + * @link https://docs.github.com/rest/branches/branch-protection#delete-admin-branch-protection * * @param string $username The user who owns the repository * @param string $repository The name of the repo @@ -277,7 +277,7 @@ public function removeAdminEnforcement($username, $repository, $branch) /** * Get restrictions of protected branch. * - * @link https://developer.github.com/v3/repos/branches/#get-restrictions-of-protected-branch + * @link https://docs.github.com/rest/branches/branch-protection#get-access-restrictions * * @param string $username The user who owns the repository * @param string $repository The name of the repo @@ -293,7 +293,7 @@ public function showRestrictions($username, $repository, $branch) /** * Remove restrictions of protected branch. * - * @link https://developer.github.com/v3/repos/branches/#remove-restrictions-of-protected-branch + * @link https://docs.github.com/rest/branches/branch-protection#delete-access-restrictions * * @param string $username The user who owns the repository * @param string $repository The name of the repo @@ -307,7 +307,7 @@ public function removeRestrictions($username, $repository, $branch) /** * List team restrictions of protected branch. * - * @link https://developer.github.com/v3/repos/branches/#list-team-restrictions-of-protected-branch + * @link https://docs.github.com/rest/branches/branch-protection#get-teams-with-access-to-the-protected-branch * * @param string $username The user who owns the repository * @param string $repository The name of the repo @@ -323,7 +323,7 @@ public function showTeamRestrictions($username, $repository, $branch) /** * Replace team restrictions of protected branch. * - * @link https://developer.github.com/v3/repos/branches/#replace-team-restrictions-of-protected-branch + * @link https://docs.github.com/rest/branches/branch-protection#set-team-access-restrictions * * @param string $username The user who owns the repository * @param string $repository The name of the repo @@ -340,7 +340,7 @@ public function replaceTeamRestrictions($username, $repository, $branch, array $ /** * Add team restrictions of protected branch. * - * @link https://developer.github.com/v3/repos/branches/#add-team-restrictions-of-protected-branch + * @link https://docs.github.com/rest/branches/branch-protection#add-team-access-restrictions * * @param string $username The user who owns the repository * @param string $repository The name of the repo @@ -357,7 +357,7 @@ public function addTeamRestrictions($username, $repository, $branch, array $para /** * Remove team restrictions of protected branch. * - * @link https://developer.github.com/v3/repos/branches/#remove-team-restrictions-of-protected-branch + * @link https://docs.github.com/rest/branches/branch-protection#remove-team-access-restrictions * * @param string $username The user who owns the repository * @param string $repository The name of the repo @@ -374,7 +374,7 @@ public function removeTeamRestrictions($username, $repository, $branch, array $p /** * List user restrictions of protected branch. * - * @link https://developer.github.com/v3/repos/branches/#list-user-restrictions-of-protected-branch + * @link https://docs.github.com/rest/branches/branch-protection#get-users-with-access-to-the-protected-branch * * @param string $username The user who owns the repository * @param string $repository The name of the repo @@ -390,7 +390,7 @@ public function showUserRestrictions($username, $repository, $branch) /** * Replace user restrictions of protected branch. * - * @link https://developer.github.com/v3/repos/branches/#replace-user-restrictions-of-protected-branch + * @link https://docs.github.com/rest/branches/branch-protection#set-user-access-restrictions * * @param string $username The user who owns the repository * @param string $repository The name of the repo @@ -407,7 +407,7 @@ public function replaceUserRestrictions($username, $repository, $branch, array $ /** * Add user restrictions of protected branch. * - * @link https://developer.github.com/v3/repos/branches/#add-user-restrictions-of-protected-branch + * @link https://docs.github.com/rest/branches/branch-protection#add-user-access-restrictions * * @param string $username The user who owns the repository * @param string $repository The name of the repo @@ -424,7 +424,7 @@ public function addUserRestrictions($username, $repository, $branch, array $para /** * Remove user restrictions of protected branch. * - * @link https://developer.github.com/v3/repos/branches/#remove-user-restrictions-of-protected-branch + * @link https://docs.github.com/rest/branches/branch-protection#remove-user-access-restrictions * * @param string $username The user who owns the repository * @param string $repository The name of the repo diff --git a/lib/Github/Api/Repository/Releases.php b/lib/Github/Api/Repository/Releases.php index 6cd7fda4f0a..ca8a90f7269 100644 --- a/lib/Github/Api/Repository/Releases.php +++ b/lib/Github/Api/Repository/Releases.php @@ -6,7 +6,7 @@ use Github\Exception\MissingArgumentException; /** - * @link http://developer.github.com/v3/repos/releases/ + * @link https://docs.github.com/rest/releases/releases * * @author Matthew Simo * @author Evgeniy Guseletov @@ -16,6 +16,8 @@ class Releases extends AbstractApi /** * Get the latest release. * + * @link https://docs.github.com/rest/releases/releases#get-the-latest-release + * * @param string $username * @param string $repository * @@ -27,7 +29,9 @@ public function latest($username, $repository) } /** - * List releases for a tag. + * Get a release by tag name. + * + * @link https://docs.github.com/rest/releases/releases#get-a-release-by-tag-name * * @param string $username * @param string $repository @@ -43,6 +47,8 @@ public function tag($username, $repository, $tag) /** * List releases in selected repository. * + * @link https://docs.github.com/rest/releases/releases#list-releases + * * @param string $username the user who owns the repo * @param string $repository the name of the repo * @param array $params the additional parameters like milestone, assignees, labels, sort, direction @@ -57,6 +63,8 @@ public function all($username, $repository, array $params = []) /** * Get a release in selected repository. * + * @link https://docs.github.com/rest/releases/releases#get-a-release + * * @param string $username the user who owns the repo * @param string $repository the name of the repo * @param int $id the id of the release @@ -71,6 +79,8 @@ public function show($username, $repository, $id) /** * Generate release notes content for a release. * + * @link https://docs.github.com/rest/releases/releases#generate-release-notes-content-for-a-release + * * @param string $username * @param string $repository * @param array $params @@ -85,6 +95,8 @@ public function generateNotes($username, $repository, array $params) /** * Create new release in selected repository. * + * @link https://docs.github.com/rest/releases/releases#create-a-release + * * @param string $username * @param string $repository * @param array $params @@ -105,6 +117,8 @@ public function create($username, $repository, array $params) /** * Edit release in selected repository. * + * @link https://docs.github.com/rest/releases/releases#update-a-release + * * @param string $username * @param string $repository * @param int $id @@ -120,6 +134,8 @@ public function edit($username, $repository, $id, array $params) /** * Delete a release in selected repository (Not thoroughly tested!). * + * @link https://docs.github.com/rest/releases/releases#delete-a-release + * * @param string $username the user who owns the repo * @param string $repository the name of the repo * @param int $id the id of the release diff --git a/lib/Github/Api/Repository/SecretScanning.php b/lib/Github/Api/Repository/SecretScanning.php index 968d352c3ec..071337d5070 100644 --- a/lib/Github/Api/Repository/SecretScanning.php +++ b/lib/Github/Api/Repository/SecretScanning.php @@ -5,7 +5,7 @@ class SecretScanning extends \Github\Api\AbstractApi { /** - * @link https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-secret-scanning-alerts-for-a-repository + * @link https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-a-repository * * @param string $username * @param string $repository @@ -19,7 +19,7 @@ public function alerts(string $username, string $repository, array $params = []) } /** - * @link https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#get-a-secret-scanning-alert + * @link https://docs.github.com/rest/secret-scanning/secret-scanning#get-a-secret-scanning-alert * * @param string $username * @param string $repository @@ -33,7 +33,7 @@ public function getAlert(string $username, string $repository, int $alertNumber) } /** - * @link https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#update-a-secret-scanning-alert + * @link https://docs.github.com/rest/secret-scanning/secret-scanning#update-a-secret-scanning-alert * * @param string $username * @param string $repository @@ -48,7 +48,7 @@ public function updateAlert(string $username, string $repository, int $alertNumb } /** - * @link https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-locations-for-a-secret-scanning-alert + * @link https://docs.github.com/rest/secret-scanning/secret-scanning#list-locations-for-a-secret-scanning-alert * * @param string $username * @param string $repository diff --git a/lib/Github/Api/Repository/Stargazers.php b/lib/Github/Api/Repository/Stargazers.php index bef73b9a6bd..be8f8831d70 100644 --- a/lib/Github/Api/Repository/Stargazers.php +++ b/lib/Github/Api/Repository/Stargazers.php @@ -6,7 +6,7 @@ use Github\Api\AcceptHeaderTrait; /** - * @link https://developer.github.com/v3/activity/starring/#list-stargazers + * @link https://docs.github.com/rest/activity/starring#list-stargazers * * @author Nicolas Dupont * @author Tobias Nyholm @@ -16,9 +16,9 @@ class Stargazers extends AbstractApi use AcceptHeaderTrait; /** - * Configure the body type. + * Configure the body type to include star creation timestamps in the response. * - * @see https://developer.github.com/v3/activity/starring/#alternative-response-with-star-creation-timestamps + * @see https://docs.github.com/rest/activity/starring#list-stargazers * * @param string $bodyType * @@ -33,6 +33,16 @@ public function configure($bodyType = null) return $this; } + /** + * List the people that have starred a repository. + * + * @link https://docs.github.com/rest/activity/starring#list-stargazers + * + * @param string $username the username + * @param string $repository the repository + * + * @return array + */ public function all($username, $repository) { return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/stargazers'); diff --git a/lib/Github/Api/Repository/Statuses.php b/lib/Github/Api/Repository/Statuses.php index c62f4edd8b6..9c20249aac4 100644 --- a/lib/Github/Api/Repository/Statuses.php +++ b/lib/Github/Api/Repository/Statuses.php @@ -6,14 +6,14 @@ use Github\Exception\MissingArgumentException; /** - * @link http://developer.github.com/v3/repos/statuses/ + * @link https://docs.github.com/rest/commits/statuses * * @author Joseph Bielawski */ class Statuses extends AbstractApi { /** - * @link http://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-sha + * @link https://docs.github.com/rest/commits/statuses#list-commit-statuses-for-a-reference * * @param string $username * @param string $repository @@ -27,7 +27,7 @@ public function show($username, $repository, $sha) } /** - * @link https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref + * @link https://docs.github.com/rest/commits/statuses#get-the-combined-status-for-a-specific-reference * * @param string $username * @param string $repository @@ -41,7 +41,7 @@ public function combined($username, $repository, $sha) } /** - * @link http://developer.github.com/v3/repos/statuses/#create-a-status + * @link https://docs.github.com/rest/commits/statuses#create-a-commit-status * * @param string $username * @param string $repository diff --git a/lib/Github/Api/Repository/Traffic.php b/lib/Github/Api/Repository/Traffic.php index d5b550c8521..7bdd091e8db 100644 --- a/lib/Github/Api/Repository/Traffic.php +++ b/lib/Github/Api/Repository/Traffic.php @@ -5,14 +5,14 @@ use Github\Api\AbstractApi; /** - * @link https://developer.github.com/v3/repos/traffic/ + * @link https://docs.github.com/rest/metrics/traffic * * @author Miguel Piedrafita */ class Traffic extends AbstractApi { /** - * @link https://developer.github.com/v3/repos/traffic/#list-referrers + * @link https://docs.github.com/rest/metrics/traffic#get-top-referral-sources * * @param string $owner * @param string $repository @@ -25,7 +25,7 @@ public function referers($owner, $repository) } /** - * @link https://developer.github.com/v3/repos/traffic/#list-paths + * @link https://docs.github.com/rest/metrics/traffic#get-top-referral-paths * * @param string $owner * @param string $repository @@ -38,7 +38,7 @@ public function paths($owner, $repository) } /** - * @link https://developer.github.com/v3/repos/traffic/#views + * @link https://docs.github.com/rest/metrics/traffic#get-page-views * * @param string $owner * @param string $repository @@ -52,7 +52,7 @@ public function views($owner, $repository, $per = 'day') } /** - * @link https://developer.github.com/v3/repos/traffic/#clones + * @link https://docs.github.com/rest/metrics/traffic#get-repository-clones * * @param string $owner * @param string $repository diff --git a/lib/Github/Api/Search.php b/lib/Github/Api/Search.php index 96a51ea6a46..a961e223c99 100644 --- a/lib/Github/Api/Search.php +++ b/lib/Github/Api/Search.php @@ -5,7 +5,7 @@ /** * Implement the Search API. * - * @link https://developer.github.com/v3/search/ + * @link https://docs.github.com/rest/search/search * * @author Greg Payne */ @@ -16,7 +16,7 @@ class Search extends AbstractApi /** * Search repositories by filter (q). * - * @link https://developer.github.com/v3/search/#search-repositories + * @link https://docs.github.com/rest/search/search#search-repositories * * @param string $q the filter * @param string $sort the sort field @@ -32,7 +32,7 @@ public function repositories($q, $sort = 'updated', $order = 'desc') /** * Search issues by filter (q). * - * @link https://developer.github.com/v3/search/#search-issues + * @link https://docs.github.com/rest/search/search#search-issues-and-pull-requests * * @param string $q the filter * @param string $sort the sort field @@ -48,7 +48,7 @@ public function issues($q, $sort = 'updated', $order = 'desc') /** * Search code by filter (q). * - * @link https://developer.github.com/v3/search/#search-code + * @link https://docs.github.com/rest/search/search#search-code * * @param string $q the filter * @param string $sort the sort field @@ -65,7 +65,7 @@ public function code($q, $sort = 'updated', $order = 'desc') * Search code by filter (q), but will return additional data to highlight * the matched results. * - * @link https://docs.github.com/en/rest/reference/search#text-match-metadata + * @link https://docs.github.com/rest/search/search#text-match-metadata * * @return array list of code found */ @@ -79,7 +79,7 @@ public function codeWithMatch(string $q, string $sort = 'updated', string $order /** * Search users by filter (q). * - * @link https://developer.github.com/v3/search/#search-users + * @link https://docs.github.com/rest/search/search#search-users * * @param string $q the filter * @param string $sort the sort field @@ -95,7 +95,7 @@ public function users($q, $sort = 'updated', $order = 'desc') /** * Search commits by filter (q). * - * @link https://developer.github.com/v3/search/#search-commits + * @link https://docs.github.com/rest/search/search#search-commits * * @param string $q the filter * @param string $sort the sort field @@ -114,7 +114,7 @@ public function commits($q, $sort = null, $order = 'desc') /** * Search topics by filter (q). * - * @link https://developer.github.com/v3/search/#search-topics + * @link https://docs.github.com/rest/search/search#search-topics * * @param string $q the filter * diff --git a/lib/Github/Api/User.php b/lib/Github/Api/User.php index d436a2b835e..7cd28f59c74 100644 --- a/lib/Github/Api/User.php +++ b/lib/Github/Api/User.php @@ -7,7 +7,7 @@ /** * Searching users, getting user information. * - * @link http://developer.github.com/v3/users/ + * @link https://docs.github.com/rest/users/users * * @author Joseph Bielawski * @author Thibault Duplessis @@ -17,7 +17,7 @@ class User extends AbstractApi /** * Request all users. * - * @link https://developer.github.com/v3/users/#get-all-users + * @link https://docs.github.com/rest/users/users#list-users * * @param int|null $id ID of the last user that you've seen * @@ -35,7 +35,7 @@ public function all($id = null) /** * Get extended information about a user by its username. * - * @link http://developer.github.com/v3/users/ + * @link https://docs.github.com/rest/users/users#get-a-user * * @param string $username the username to show * @@ -50,7 +50,7 @@ public function show($username) * Get extended information about a user by its id. * Note: at time of writing this is an undocumented feature but GitHub support have advised that it can be relied on. * - * @link http://developer.github.com/v3/users/ + * @link https://docs.github.com/rest/users/users#get-a-user-using-their-id * * @param int $id the id of the user to show * @@ -64,7 +64,7 @@ public function showById($id) /** * Get extended information about a user by its username. * - * @link https://developer.github.com/v3/orgs/ + * @link https://docs.github.com/rest/orgs/orgs#list-organizations-for-a-user * * @param string $username the username to show * @@ -78,7 +78,7 @@ public function organizations($username) /** * Get user organizations. * - * @link https://developer.github.com/v3/orgs/#list-your-organizations + * @link https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user * * @return array information about organizations that authenticated user belongs to */ @@ -90,7 +90,7 @@ public function orgs() /** * Request the users that a specific user is following. * - * @link http://developer.github.com/v3/users/followers/ + * @link https://docs.github.com/rest/users/followers#list-the-people-a-user-follows * * @param string $username the username * @param array $parameters parameters for the query string @@ -106,7 +106,7 @@ public function following($username, array $parameters = [], array $requestHeade /** * Request the users following a specific user. * - * @link http://developer.github.com/v3/users/followers/ + * @link https://docs.github.com/rest/users/followers#list-followers-of-a-user * * @param string $username the username * @param array $parameters parameters for the query string @@ -122,7 +122,7 @@ public function followers($username, array $parameters = [], array $requestHeade /** * Request starred repositories that a specific user has starred. * - * @link http://developer.github.com/v3/activity/starring/ + * @link https://docs.github.com/rest/activity/starring#list-repositories-starred-by-a-user * * @param string $username the username * @param int $page the page number of the paginated result set @@ -145,7 +145,7 @@ public function starred($username, $page = 1, $perPage = 30, $sort = 'created', /** * Request the repository that a specific user is watching. * - * @link http://developer.github.com/v3/activity/watching/ + * @link https://docs.github.com/rest/activity/watching#list-repositories-watched-by-a-user * * @param string $username the username * @@ -159,7 +159,7 @@ public function subscriptions($username) /** * List public repositories for the specified user. * - * @link https://developer.github.com/v3/repos/#list-user-repositories + * @link https://docs.github.com/rest/repos/repos#list-repositories-for-a-user * * @param string $username the username * @param string $type role in the repository @@ -184,7 +184,7 @@ public function repositories($username, $type = 'owner', $sort = 'full_name', $d /** * List repositories that are accessible to the authenticated user. * - * @link https://developer.github.com/v3/repos/#list-your-repositories + * @link https://docs.github.com/rest/repos/repos#list-repositories-for-the-authenticated-user * * @param array $params visibility, affiliation, type, sort, direction * @@ -198,7 +198,7 @@ public function myRepositories(array $params = []) /** * Get the public gists for a user. * - * @link http://developer.github.com/v3/gists/ + * @link https://docs.github.com/rest/gists/gists#list-gists-for-a-user * * @param string $username the username * @@ -212,7 +212,7 @@ public function gists($username) /** * Get the public keys for a user. * - * @link http://developer.github.com/v3/users/keys/#list-public-keys-for-a-user + * @link https://docs.github.com/rest/users/keys#list-public-keys-for-a-user * * @param string $username the username * @@ -226,7 +226,7 @@ public function keys($username) /** * List events performed by a user. * - * @link http://developer.github.com/v3/activity/events/#list-public-events-performed-by-a-user + * @link https://docs.github.com/rest/activity/events#list-public-events-for-a-user * * @param string $username * @@ -240,7 +240,7 @@ public function publicEvents($username) /** * List events performed by an authenticated user. * - * @link https://docs.github.com/en/rest/reference/activity#list-events-for-the-authenticated-user + * @link https://docs.github.com/rest/activity/events#list-events-for-the-authenticated-user * * @return array */ diff --git a/lib/Github/Api/User/Migration.php b/lib/Github/Api/User/Migration.php index 4e1b61ca244..94287e12e95 100644 --- a/lib/Github/Api/User/Migration.php +++ b/lib/Github/Api/User/Migration.php @@ -7,7 +7,7 @@ class Migration extends AbstractApi { /** - * @link https://docs.github.com/en/rest/migrations/users?apiVersion=2022-11-28#list-user-migrations + * @link https://docs.github.com/rest/migrations/users#list-user-migrations * * @param array $params * @@ -19,7 +19,7 @@ public function list(array $params = []) } /** - * @link https://docs.github.com/en/rest/migrations/users?apiVersion=2022-11-28#start-a-user-migration + * @link https://docs.github.com/rest/migrations/users#start-a-user-migration * * @param array $params * @@ -31,7 +31,7 @@ public function start(array $params) } /** - * @link https://docs.github.com/en/rest/migrations/users?apiVersion=2022-11-28#get-a-user-migration-status + * @link https://docs.github.com/rest/migrations/users#get-a-user-migration-status * * @param int $migrationId * @param array $params @@ -44,7 +44,7 @@ public function status(int $migrationId, array $params = []) } /** - * @link https://docs.github.com/en/rest/migrations/users?apiVersion=2022-11-28#delete-a-user-migration-archive + * @link https://docs.github.com/rest/migrations/users#delete-a-user-migration-archive * * @param int $migrationId * @@ -56,7 +56,7 @@ public function deleteArchive(int $migrationId) } /** - * @link https://docs.github.com/en/rest/migrations/users?apiVersion=2022-11-28#unlock-a-user-repository + * @link https://docs.github.com/rest/migrations/users#unlock-a-user-repository * * @param int $migrationId * @param string $repository @@ -69,7 +69,7 @@ public function unlockRepo(int $migrationId, string $repository) } /** - * @link https://docs.github.com/en/rest/migrations/users?apiVersion=2022-11-28#list-repositories-for-a-user-migration + * @link https://docs.github.com/rest/migrations/users#list-repositories-for-a-user-migration * * @param int $migrationId * @param array $params diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 9e84171f2c5..3eb8c1138bf 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -13,3 +13,7 @@ parameters: - message: '#Method (.*) has no return typehint specified\.#' path: lib/Github/Api + + - + message: '#(extends|Instantiation of|typehint with) deprecated class Github\\Api\\#' + path: lib/Github/Api