PHP Class Acacha\Llum\Github\GithubAPI

Show file Open project: acacha/llum Class Usage Examples

Protected Properties

Property Type Description
$api_url string Github API URL.
$authorizations_uri string Authorization URI in github API.
$client GuzzleHttp\Client Guzzle http client.
$filesystem Acacha\Llum\Filesystem\Filesystem Acacha Llum Filesystem.
$repos_uri string Authorization URI in github API.
$tokenName Token name;

Public Methods

Method Description
__construct ( Filesystem $filesystem ) GithubAPI constructor.
createRepo ( $repo_name, $repo_description ) : mixed Create repo in github.
getPersonalToken ( $username, $password ) : mixed Obtain personal token.
setCredentials ( array $credentials ) Set github credentials.
tokenName ( ) : mixed

Protected Methods

Method Description
authorization_url ( ) : string Authorization URL.
authorizationsRequestJson ( ) : array
compile ( $template, $data ) : mixed Compile the template using the given data.
compileStub ( $repo_name, $repo_description ) : mixed Compile stub.
create_repo_url ( ) : string Create repo URL.
credentials ( ) : mixed Get github credentials.
repo_json_stub ( ) : string Path to repo.json stub

Method Details

__construct() public method

GithubAPI constructor.
public __construct ( Filesystem $filesystem )
$filesystem Acacha\Llum\Filesystem\Filesystem

authorization_url() protected method

Authorization URL.
protected authorization_url ( ) : string
return string

authorizationsRequestJson() protected method

protected authorizationsRequestJson ( ) : array
return array

compile() protected method

Compile the template using the given data.
protected compile ( $template, $data ) : mixed
$template
$data
return mixed

compileStub() protected method

Compile stub.
protected compileStub ( $repo_name, $repo_description ) : mixed
$repo_name
$repo_description
return mixed

createRepo() public method

Create repo in github.
public createRepo ( $repo_name, $repo_description ) : mixed
$repo_name
$repo_description
return mixed

create_repo_url() protected method

Create repo URL.
protected create_repo_url ( ) : string
return string

credentials() protected method

Get github credentials.
protected credentials ( ) : mixed
return mixed

getPersonalToken() public method

Obtain personal token.
public getPersonalToken ( $username, $password ) : mixed
$username
$password
return mixed

repo_json_stub() protected method

Path to repo.json stub
protected repo_json_stub ( ) : string
return string

setCredentials() public method

Set github credentials.
public setCredentials ( array $credentials )
$credentials array

tokenName() public method

public tokenName ( ) : mixed
return mixed

Property Details

$api_url protected property

Github API URL.
protected string $api_url
return string

$authorizations_uri protected property

Authorization URI in github API.
protected string $authorizations_uri
return string

$client protected property

Guzzle http client.
protected Client,GuzzleHttp $client
return GuzzleHttp\Client

$filesystem protected property

Acacha Llum Filesystem.
protected Filesystem,Acacha\Llum\Filesystem $filesystem
return Acacha\Llum\Filesystem\Filesystem

$repos_uri protected property

Authorization URI in github API.
protected string $repos_uri
return string

$tokenName protected property

Token name;
protected $tokenName