\duncan3dc\GitHubOrganization

Summary

Methods
Properties
Constants
request()
post()
put()
delete()
get()
getAll()
__construct()
getName()
getRepositories()
getRepository()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
response()
getToken()
$data
$api
$client
$token
$tokenExpires
N/A

Properties

$data

$data : \stdClass

Type

\stdClass — This organization's data returned from the API.

$client

$client : \GuzzleHttp\ClientInterface

Type

\GuzzleHttp\ClientInterface — The HTTP client to communicate via.

$token

$token : string

Type

string — The current installation access token.

$tokenExpires

$tokenExpires : integer

Type

integer — When the current installation access token expires.

Methods

request()

request(\duncan3dc\GitHub\string  $method, \duncan3dc\GitHub\string  $url, array  $data = array()) 

Parameters

\duncan3dc\GitHub\string $method
\duncan3dc\GitHub\string $url
array $data

post()

post(string  $url, array  $data = array()) : \stdClass

Send a POST request and return the response.

Parameters

string $url

The url to issue the request to

array $data

The parameters to send with the request

Returns

\stdClass

put()

put(string  $url, array  $data = array()) : \stdClass

Send a PUT request and return the response.

Parameters

string $url

The url to issue the request to

array $data

The parameters to send with the request

Returns

\stdClass

delete()

delete(string  $url, array  $data = array()) : \stdClass

Send a DELETE request and return the response.

Parameters

string $url

The url to issue the request to

array $data

The parameters to send with the request

Returns

\stdClass

get()

get(string  $url, array  $data = array()) : \stdClass

Send a GET request and return the response.

Parameters

string $url

The url to issue the request to

array $data

The parameters to send with the request

Returns

\stdClass

getAll()

getAll(string  $url, array  $data = array(), callable  $callback = null) : \Traversable|array<mixed,\stdClass>

Send a GET request and return the response.

This method will loop through all the pages until one returns no results

Parameters

string $url

The url to issue the request to

array $data

The parameters to send with the request

callable $callback

An optional handler to yield items via

Returns

\Traversable|array<mixed,\stdClass>

__construct()

__construct(\stdClass  $data, \duncan3dc\GitHub\ApiInterface  $api, \GuzzleHttp\ClientInterface  $client) 

Create a new instance.

Parameters

\stdClass $data
\duncan3dc\GitHub\ApiInterface $api

The GitHub app this installation is for

\GuzzleHttp\ClientInterface $client

The HTTP client to communicate via

getName()

getName() : string

Get the name of this organization.

Returns

string

getRepositories()

getRepositories() : array<mixed,\duncan3dc\GitHub\RepositoryInterface>

Get all of the repositories for this installation.

Returns

array<mixed,\duncan3dc\GitHub\RepositoryInterface>

getRepository()

getRepository(string  $name) : \duncan3dc\GitHub\RepositoryInterface

Get a repository instance.

Parameters

string $name

The name of the repository

Returns

\duncan3dc\GitHub\RepositoryInterface

response()

response(\Psr\Http\Message\ResponseInterface  $response) : \stdClass

Convert a response into a simple object.

Parameters

\Psr\Http\Message\ResponseInterface $response

The response to convert

Returns

\stdClass

getToken()

getToken() : string

Get the installation access token.

Returns

string