\Composer\UtilGitHub

Summary

Methods
Properties
Constants
__construct()
authorizeOAuth()
authorizeOAuthInteractively()
getRateLimit()
isRateLimited()
No public properties found
No constants found
No protected methods found
$io
$config
$process
$remoteFilesystem
N/A
No private methods found
No private properties found
N/A

Properties

$io

$io : 

Type

$config

$config : 

Type

$process

$process : 

Type

$remoteFilesystem

$remoteFilesystem : 

Type

Methods

authorizeOAuth()

authorizeOAuth(string  $originUrl) : boolean

Attempts to authorize a GitHub domain via OAuth

Parameters

string $originUrl

The host this GitHub instance is located at

Returns

boolean —

true on success

authorizeOAuthInteractively()

authorizeOAuthInteractively(string  $originUrl, string  $message = null) : boolean

Authorizes a GitHub domain interactively via OAuth

Parameters

string $originUrl

The host this GitHub instance is located at

string $message

The reason this authorization is required

Throws

\RuntimeException
\Composer\Downloader\TransportException|\Exception

Returns

boolean —

true on success

getRateLimit()

getRateLimit(array  $headers) : array

Extract ratelimit from response.

Parameters

array $headers

Headers from Composer\Downloader\TransportException.

Returns

array —

Associative array with the keys limit and reset.

isRateLimited()

isRateLimited(array  $headers) : boolean

Finds whether a request failed due to rate limiting

Parameters

array $headers

Headers from Composer\Downloader\TransportException.

Returns

boolean