Class Github\Api\Repo

InheritanceGithub\Api\Repo » Github\Api\AbstractApi
ImplementsGithub\Api\ApiInterface

Searching repositories, getting repository information and managing repository information for authenticated users.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Github\Api\AbstractApi
activity() Get the last year of commit activity for a repository grouped by week. Github\Api\Repo
all() List all public repositories. Github\Api\Repo
branches() Get the branch(es) of a repository. Github\Api\Repo
collaborators() Manage the collaborators of a repository. Github\Api\Repo
comments() Manage the comments of a repository. Github\Api\Repo
commits() Manage the commits of a repository. Github\Api\Repo
configure() Github\Api\AbstractApi
contents() Manage the content of a repository. Github\Api\Repo
contributors() Get the contributors of a repository. Github\Api\Repo
create() Create repository. Github\Api\Repo
downloads() Manage the content of a repository. Github\Api\Repo
find() Search repositories by keyword. Github\Api\Repo
forks() Manage the forks of a repository. Github\Api\Repo
getPerPage() Github\Api\AbstractApi
hooks() Manage the hooks of a repository. Github\Api\Repo
keys() Manage the deploy keys of a repository. Github\Api\Repo
labels() Manage the labels of a repository. Github\Api\Repo
languages() Get the language breakdown of a repository. Github\Api\Repo
merge() Perform a merge. Github\Api\Repo
milestones() Github\Api\Repo
org() List all repositories for an organization. Github\Api\Repo
readme() Get the readme content for a repository by its username and repository name. Github\Api\Repo
releases() Manage the releases of a repository (Currently Undocumented). Github\Api\Repo
remove() Delete a repository. Github\Api\Repo
setPerPage() Github\Api\AbstractApi
show() Get extended information about a repository by its username and repository name. Github\Api\Repo
statistics() Get contributor commit statistics for a repository. Github\Api\Repo
statuses() Manage the statuses of a repository. Github\Api\Repo
subscribers() Github\Api\Repo
tags() Get the tags of a repository. Github\Api\Repo
teams() Get the teams of a repository. Github\Api\Repo
update() Set information of a repository. Github\Api\Repo
watchers() Github\Api\Repo

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
createJsonBody() Create a JSON encoded version of an array of parameters. Github\Api\AbstractApi
delete() Send a DELETE request with JSON-encoded parameters. Github\Api\AbstractApi
get() Send a GET request with query parameters. Github\Api\AbstractApi
head() Send a HEAD request with query parameters. Github\Api\AbstractApi
patch() Send a PATCH request with JSON-encoded parameters. Github\Api\AbstractApi
post() Send a POST request with JSON-encoded parameters. Github\Api\AbstractApi
postRaw() Send a POST request with raw data. Github\Api\AbstractApi
put() Send a PUT request with JSON-encoded parameters. Github\Api\AbstractApi

Method Details

activity() public method

Get the last year of commit activity for a repository grouped by week.

public array activity ( $username, $repository )
$username string

The user who owns the repository

$repository string

The name of the repository

return array

Commit activity grouped by week

all() public method

List all public repositories.

public array all ( $id null )
$id int|null

The integer ID of the last Repository that you’ve seen.

return array

List of users found

branches() public method

Get the branch(es) of a repository.

public array branches ( $username, $repository, $branch null )
$username string

The username

$repository string

The name of the repository

$branch string

The name of the branch

return array

List of the repository branches

collaborators() public method

Manage the collaborators of a repository.

public Github\Api\Repository\Collaborators collaborators ( )
comments() public method

Manage the comments of a repository.

public Github\Api\Repository\Comments comments ( )
commits() public method

Manage the commits of a repository.

public Github\Api\Repository\Commits commits ( )
contents() public method

Manage the content of a repository.

public Github\Api\Repository\Contents contents ( )
contributors() public method

Get the contributors of a repository.

public array contributors ( $username, $repository, $includingAnonymous false )
$username string

The user who owns the repository

$repository string

The name of the repository

$includingAnonymous bool

By default, the list only shows GitHub users.

                              You can include non-users too by setting this to true
return array

List of the repo contributors

create() public method

Create repository.

public array create ( $name, $description '', $homepage '', $public true, $organization null, $hasIssues false, $hasWiki false, $hasDownloads false, $teamId null, $autoInit false )
$name string

Name of the repository

$description string

Repository description

$homepage string

Homepage url

$public bool

true for public, false for private

$organization null|string

Username of organization if applicable

$hasIssues bool

true to enable issues for this repository, false to disable them

$hasWiki bool

true to enable the wiki for this repository, false to disable it

$hasDownloads bool

true to enable downloads for this repository, false to disable them

$teamId int

The id of the team that will be granted access to this repository. This is only valid when creating a repo in an organization.

$autoInit bool

true to create an initial commit with empty README, false for no initial commit

return array

Returns repository data

downloads() public method

Manage the content of a repository.

public Github\Api\Repository\Downloads downloads ( )
find() public method

Search repositories by keyword.

public array find ( $keyword, array $params = [] )
$keyword string

The search query

$params array
return array

List of found repositories

forks() public method

Manage the forks of a repository.

public Github\Api\Repository\Forks forks ( )
hooks() public method

Manage the hooks of a repository.

public Github\Api\Repository\Hooks hooks ( )
keys() public method

Manage the deploy keys of a repository.

public Github\Api\Repository\DeployKeys keys ( )
labels() public method

Manage the labels of a repository.

public Github\Api\Repository\Labels labels ( )
languages() public method

Get the language breakdown of a repository.

public array languages ( $username, $repository )
$username string

The user who owns the repository

$repository string

The name of the repository

return array

List of the languages

merge() public method

Perform a merge.

public array|null merge ( $username, $repository, $base, $head, $message null )
$username string
$repository string
$base string

The name of the base branch that the head will be merged into.

$head string

The head to merge. This can be a branch name or a commit SHA1.

$message string

Commit message to use for the merge commit. If omitted, a default message will be used.

milestones() public method

public array milestones ( $username, $repository )
$username string
$repository string
org() public method

List all repositories for an organization.

public array org ( $organization, array $params = [] )
$organization string

The name of the organization

$params array
return array

List of organization repositories

readme() public method

Get the readme content for a repository by its username and repository name.

public array readme ( $username, $repository )
$username string

The user who owns the repository

$repository string

The name of the repository

return array

The readme content

releases() public method

Manage the releases of a repository (Currently Undocumented).

public Github\Api\Repository\Releases releases ( )
remove() public method

Delete a repository.

public mixed remove ( $username, $repository )
$username string

The user who owns the repository

$repository string

The name of the repository

return mixed

Null on success, array on error with 'message'

show() public method

Get extended information about a repository by its username and repository name.

public array show ( $username, $repository )
$username string

The user who owns the repository

$repository string

The name of the repository

return array

Informations about the repository

statistics() public method

Get contributor commit statistics for a repository.

public array statistics ( $username, $repository )
$username string

The user who owns the repository

$repository string

The name of the repository

return array

List of contributors and their commit statistics

statuses() public method

Manage the statuses of a repository.

public Github\Api\Repository\Statuses statuses ( )
subscribers() public method

public array subscribers ( $username, $repository, $page 1 )
$username string
$repository string
$page int
tags() public method

Get the tags of a repository.

public array tags ( $username, $repository )
$username string

The user who owns the repository

$repository string

The name of the repository

return array

List of the repository tags

teams() public method

Get the teams of a repository.

public array teams ( $username, $repository )
$username string

The user who owns the repo

$repository string

The name of the repo

return array

List of the languages

update() public method

Set information of a repository.

public array update ( $username, $repository, array $values )
$username string

The user who owns the repository

$repository string

The name of the repository

$values array

The key => value pairs to post

return array

Informations about the repository

watchers() public method

public array watchers ( $username, $repository, $page 1 )
$username string
$repository string
$page int