PHP 인터페이스 Gush\Adapter\Adapter

Note that each adapter instance can be only used for one repository.
파일 보기 프로젝트 열기: gushphp/gush 0 사용 예제들

공개 메소드들

메소드 설명
authenticate ( ) : boolean Authenticates the Adapter.
closePullRequest ( integer $id ) Close a pull-request by id.
createComment ( integer $id, string $message ) : string | null Creates a new a comment on an issue/pull-request.
createFork ( string $org ) : array Creates a fork from upstream and returns an array with the forked url.
createRelease ( string $name, array $parameters = [] ) : array Creates a new release.
createReleaseAssets ( integer $id, string $name, string $contentType, string $content ) : integer Creates a new release asset.
createRepo ( string $name, string $description, string $homepage, boolean $public = true, null $organization = null, boolean $hasIssues = true, boolean $hasWiki = false, boolean $hasDownloads = false, integer $teamId, boolean $autoInit = true ) : array
getComments ( integer $id ) : array[] Gets comments of a pull-request.
getLabels ( ) : string[] Gets the supported labels.
getMilestones ( array $parameters = [] ) : string[] Gets the supported milestones.
getPullRequest ( integer $id ) : array Gets the information of a pull-request by id.
getPullRequestCommits ( integer $id ) : array[] Gets the version-commits of a pull-request.
getPullRequestStates ( ) : string[] Gets the supported pull-request states.
getPullRequests ( string $state = null, integer $limit = 30 ) : array[] Gets the pull-requests.
getReleaseAssets ( integer $id ) : array[] Gets all available release assets of an release.
getReleases ( ) : array[] Gets all available created-releases.
getRepositoryInfo ( string $org, string $repository ) : array Gets the information from the requested repository.
isAuthenticated ( ) : boolean Returns true if the adapter is authenticated, false otherwise.
openPullRequest ( string $base, string $head, string $subject, string $body, array $parameters = [] ) : array Opens a new pull-request.
removeRelease ( integer $id ) Deletes a release.
supportsRepository ( string $remoteUrl ) : boolean Returns whether the repository is supported by this adapter.
switchPullRequestBase ( integer $prNumber, string $newBase, string $newHead, boolean $forceNewPr = false ) : array Switches the pull-request base.
updatePullRequest ( integer $id, array $parameters ) Updates the state of a pull-request by id.

메소드 상세

authenticate() 공개 메소드

Authenticates the Adapter.
public authenticate ( ) : boolean
리턴 boolean

closePullRequest() 공개 메소드

Close a pull-request by id.
public closePullRequest ( integer $id )
$id integer

createComment() 공개 메소드

Creates a new a comment on an issue/pull-request.
public createComment ( integer $id, string $message ) : string | null
$id integer
$message string
리턴 string | null URL to the comment ex. "https://github.com/octocat/Hello-World/pull/1347#issuecomment-1

createFork() 공개 메소드

Creates a fork from upstream and returns an array with the forked url.
public createFork ( string $org ) : array
$org string Organisation name
리턴 array An array the with following keys: git_url, html_url

createRelease() 공개 메소드

For clarity, a release is a tagged version with additional information like a changelog.
public createRelease ( string $name, array $parameters = [] ) : array
$name string
$parameters array
리턴 array Returns an array with url and id of the created release

createReleaseAssets() 공개 메소드

An asset can be eg documentation or a full download (library package with vendors). Not every Hub provider supports this however, so implementation is optional.
public createReleaseAssets ( integer $id, string $name, string $contentType, string $content ) : integer
$id integer Id of the release (must exist)
$name string Name of the asset (including file extension)
$contentType string Mime-type of the asset
$content string Actual asset (in raw-binary form without conversion)
리턴 integer returns the id of the asset

createRepo() 공개 메소드

public createRepo ( string $name, string $description, string $homepage, boolean $public = true, null $organization = null, boolean $hasIssues = true, boolean $hasWiki = false, boolean $hasDownloads = false, integer $teamId, boolean $autoInit = true ) : array
$name string
$description string
$homepage string
$public boolean
$organization null
$hasIssues boolean
$hasWiki boolean
$hasDownloads boolean
$teamId integer
$autoInit boolean
리턴 array

getComments() 공개 메소드

. Returned value must be an array with the following data per entry (values are by example). If a value is not supported null must be used instead. "id": 1 "url": "https://github.com/octocat/Hello-World/pull/1347#issuecomment-1" "body": "Me too" "user": "username" "created_at": "DateTime Object" "updated_at": "DateTime Object"
public getComments ( integer $id ) : array[]
$id integer
리턴 array[] [['id' => 1, ...]]

getLabels() 공개 메소드

When the issue tracker does not support labels, this will return an empty array.
public getLabels ( ) : string[]
리턴 string[]

getMilestones() 공개 메소드

Gets the supported milestones.
public getMilestones ( array $parameters = [] ) : string[]
$parameters array
리턴 string[]

getPullRequest() 공개 메소드

Returned value must be an array with the following data (values are by example). If a value is not supported null must be used instead. "url": "https://github.com/octocat/Hello-World/pull/1" "number": 1 "state": "open" "title": "new-feature" "body": "Please pull these awesome changes" "labels": ["bug"] "milestone": "v1.0" "created_at": "DateTime Object" "updated_at": "DateTime Object" "user": "username" "assignee": "username" "merged": false "merged_by": "username" "head": [ "ref": "new-topic" "sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e" "user": "username" "repo": "Hello-World" ] "base": [ "label": "master" "ref": "master" "sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e" "user": "username" "repo": "Hello-World" ]
public getPullRequest ( integer $id ) : array
$id integer
리턴 array

getPullRequestCommits() 공개 메소드

Returned value must be an array with the following data per entry (values are by example). If a value is not supported null must be used instead. 'sha': '6dcb09b5b57875f334f61aebed695e2e4193db5e' 'message': 'Fix all the bugs' 'user': 'username'
public getPullRequestCommits ( integer $id ) : array[]
$id integer
리턴 array[] [['sha1' => 'dcb09b5b57875f334f61aebed695e2e4193db5e', ...]]

getPullRequestStates() 공개 메소드

Gets the supported pull-request states.
public getPullRequestStates ( ) : string[]
리턴 string[]

getPullRequests() 공개 메소드

Gets the pull-requests.
public getPullRequests ( string $state = null, integer $limit = 30 ) : array[]
$state string Only get pull-requests with this state (use getPullRequestStates() for supported states)
$limit integer
리턴 array[] An array where each entry has the same structure as described in getPullRequest()

getReleaseAssets() 공개 메소드

Returned value must be an array with the following data per entry (values are by example). If a value is not supported null must be used instead. Note. Size is in bytes, url contains a link to the asset. but may not necessarily download the actual asset. State can be: "uploaded", "empty", or "uploading". "url": "https://api.github.com/repos/octocat/Hello-World/releases/assets/1" "id": 1 "name": "example.zip" "label": "short description" "state": "uploaded" "content_type": "application/zip" "size": 1024 "created_at": "DateTime Object" "updated_at": "DateTime Object" "uploader": "username"
public getReleaseAssets ( integer $id ) : array[]
$id integer Id of the release (must exist)
리턴 array[] [['id' => 1, ...]]

getReleases() 공개 메소드

Returned value must be an array with the following data per entry (values are by example). If a value is not supported null must be used instead. "url": "https://github.com/octocat/Hello-World/releases/v1.0.0" "id": 1 "name": "v1.0.0" "tag_name": "v1.0.0" "body": "Description of the release" "draft": false "prerelease": false "created_at": "DateTime Object" "published_at": "DateTime Object" "user": "username"
public getReleases ( ) : array[]
리턴 array[] [['id' => 1, ...]]

getRepositoryInfo() 공개 메소드

Returned value must be an array with the following data (values are by example). If a value is not supported null must be used instead, or false in case of a boolean. "owner": "username" "html_url": "https://github.com/octocat/Hello-World" "fetch_url": "https://github.com/octocat/Hello-World.git" "push_url": "[email protected]:octocat/Hello-World.git" "is_fork": false "is_private": false "fork_origin": [ "org": null "repo": null ] fork_origin is used to find the original organization and repository. When this repository is the head-parent, "fork_origin" may be null.
public getRepositoryInfo ( string $org, string $repository ) : array
$org string
$repository string
리턴 array

isAuthenticated() 공개 메소드

Returns true if the adapter is authenticated, false otherwise.
public isAuthenticated ( ) : boolean
리턴 boolean

openPullRequest() 공개 메소드

Opens a new pull-request.
public openPullRequest ( string $base, string $head, string $subject, string $body, array $parameters = [] ) : array
$base string
$head string
$subject string
$body string
$parameters array
리턴 array An array the with following keys: html_url, number

removeRelease() 공개 메소드

Deletes a release.
public removeRelease ( integer $id )
$id integer

supportsRepository() 공개 메소드

Returns whether the repository is supported by this adapter.
public supportsRepository ( string $remoteUrl ) : boolean
$remoteUrl string
리턴 boolean

switchPullRequestBase() 공개 메소드

When the adapter does not support changing the base-branch, a new PR should be opened with same subject, body and labels. And the old PR should be closed.
public switchPullRequestBase ( integer $prNumber, string $newBase, string $newHead, boolean $forceNewPr = false ) : array
$prNumber integer
$newBase string New base for the PR
$newHead string org:branch
$forceNewPr boolean Open new PR (even when switching is supported)
리턴 array An array with the following keys: html_url, number (either the current or the new PR)

updatePullRequest() 공개 메소드

Updates the state of a pull-request by id.
public updatePullRequest ( integer $id, array $parameters )
$id integer
$parameters array