PHP Class Milo\Github\Api

See also: https://developer.github.com/v3/
Author: Miloslav Hůla (https://github.com/milo)
Inheritance: extends Milo\Github\Sanity
Afficher le fichier Open project: milo/github-api Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( Milo\Github\Http\IClient $client = NULL )
createRequest ( $method, $urlPath, array $parameters = [], array $headers = [], $content = NULL ) : Milo\Github\Http\Request
decode ( Milo\Github\Http\Response $response, array $okCodes = NULL ) : mixed
delete ( $urlPath, array $parameters = [], array $headers = [] ) : Milo\Github\Http\Response
get ( $urlPath, array $parameters = [], array $headers = [] ) : Milo\Github\Http\Response
getClient ( ) : Milo\Github\Http\IClient
getDefaultParameters ( ) : array
getToken ( ) : Milo\Github\OAuth\Token | null
getUrl ( ) : string
head ( $urlPath, array $parameters = [], array $headers = [] ) : Milo\Github\Http\Response
paginator ( $urlPath, array $parameters = [], array $headers = [] ) : Milo\Github\Paginator Creates paginator for HTTP GET requests.
patch ( $urlPath, $content, array $parameters = [], array $headers = [] ) : Milo\Github\Http\Response
post ( $urlPath, $content, array $parameters = [], array $headers = [] ) : Milo\Github\Http\Response
put ( $urlPath, $content = NULL, array $parameters = [], array $headers = [] ) : Milo\Github\Http\Response
request ( Milo\Github\Http\Request $request ) : Milo\Github\Http\Response
setDefaultParameters ( array $defaults = NULL ) : self
setToken ( Milo\Github\OAuth\Token $token = NULL ) : self
setUrl ( $url ) : self
withUrl ( $url ) : Api

Méthodes protégées

Méthode Description
expandColonParameters ( $url, array $parameters, array $defaultParameters ) : string
expandUriTemplate ( $url, array $parameters, array $defaultParameters ) : string Expands URI template (RFC 6570).

Private Methods

Méthode Description
errorMessage ( $content ) : string
escape ( array $flags, $value, $maxLength = NULL ) : string
prefix ( array $flags, $name, $value ) : string
walk ( array $array, $cb )

Method Details

__construct() public méthode

public __construct ( Milo\Github\Http\IClient $client = NULL )
$client Milo\Github\Http\IClient

createRequest() public méthode

public createRequest ( $method, $urlPath, array $parameters = [], array $headers = [], $content = NULL ) : Milo\Github\Http\Request
$parameters array
$headers array
Résultat Milo\Github\Http\Request

decode() public méthode

public decode ( Milo\Github\Http\Response $response, array $okCodes = NULL ) : mixed
$response Milo\Github\Http\Response
$okCodes array
Résultat mixed

delete() public méthode

See also: createRequest()
See also: request()
public delete ( $urlPath, array $parameters = [], array $headers = [] ) : Milo\Github\Http\Response
$parameters array
$headers array
Résultat Milo\Github\Http\Response

expandColonParameters() protected méthode

protected expandColonParameters ( $url, array $parameters, array $defaultParameters ) : string
$parameters array
$defaultParameters array
Résultat string

expandUriTemplate() protected méthode

Expands URI template (RFC 6570).
See also: http://tools.ietf.org/html/rfc6570
protected expandUriTemplate ( $url, array $parameters, array $defaultParameters ) : string
$parameters array
$defaultParameters array
Résultat string

get() public méthode

See also: createRequest()
See also: request()
public get ( $urlPath, array $parameters = [], array $headers = [] ) : Milo\Github\Http\Response
$parameters array
$headers array
Résultat Milo\Github\Http\Response

getClient() public méthode

public getClient ( ) : Milo\Github\Http\IClient
Résultat Milo\Github\Http\IClient

getDefaultParameters() public méthode

public getDefaultParameters ( ) : array
Résultat array

getToken() public méthode

public getToken ( ) : Milo\Github\OAuth\Token | null
Résultat Milo\Github\OAuth\Token | null

getUrl() public méthode

public getUrl ( ) : string
Résultat string

head() public méthode

See also: createRequest()
See also: request()
public head ( $urlPath, array $parameters = [], array $headers = [] ) : Milo\Github\Http\Response
$parameters array
$headers array
Résultat Milo\Github\Http\Response

paginator() public méthode

Creates paginator for HTTP GET requests.
See also: get()
public paginator ( $urlPath, array $parameters = [], array $headers = [] ) : Milo\Github\Paginator
$parameters array
$headers array
Résultat Milo\Github\Paginator

patch() public méthode

See also: createRequest()
See also: request()
public patch ( $urlPath, $content, array $parameters = [], array $headers = [] ) : Milo\Github\Http\Response
$parameters array
$headers array
Résultat Milo\Github\Http\Response

post() public méthode

See also: createRequest()
See also: request()
public post ( $urlPath, $content, array $parameters = [], array $headers = [] ) : Milo\Github\Http\Response
$parameters array
$headers array
Résultat Milo\Github\Http\Response

put() public méthode

See also: createRequest()
See also: request()
public put ( $urlPath, $content = NULL, array $parameters = [], array $headers = [] ) : Milo\Github\Http\Response
$parameters array
$headers array
Résultat Milo\Github\Http\Response

request() public méthode

public request ( Milo\Github\Http\Request $request ) : Milo\Github\Http\Response
$request Milo\Github\Http\Request
Résultat Milo\Github\Http\Response

setDefaultParameters() public méthode

public setDefaultParameters ( array $defaults = NULL ) : self
$defaults array
Résultat self

setToken() public méthode

public setToken ( Milo\Github\OAuth\Token $token = NULL ) : self
$token Milo\Github\OAuth\Token
Résultat self

setUrl() public méthode

public setUrl ( $url ) : self
Résultat self

withUrl() public méthode

public withUrl ( $url ) : Api
Résultat Api