abstract class Github_Api in Bibliography Module 7.2
Abstract class for Github_Api classes
@author Thibault Duplessis <thibault.duplessis at gmail dot com> @license MIT License
Hierarchy
- class \Github_Api implements Github_ApiInterface
Expanded class hierarchy of Github_Api
File
- modules/
CiteProc/ Github/ Api.php, line 9
View source
abstract class Github_Api implements Github_ApiInterface {
/**
* The client
* @var Github_Client
*/
private $client;
public function __construct(Github_Client $client) {
$this->client = $client;
}
/**
* Call any path, GET method
* Ex: $api->get('repos/show/my-username/my-repo')
*
* @param string $path the GitHub path
* @param array $parameters GET parameters
* @param array $requestOptions reconfigure the request
* @return array data returned
*/
protected function get($path, array $parameters = array(), $requestOptions = array()) {
return $this->client
->get($path, $parameters, $requestOptions);
}
/**
* Call any path, POST method
* Ex: $api->post('repos/show/my-username', array('email' => 'my-new-email@provider.org'))
*
* @param string $path the GitHub path
* @param array $parameters POST parameters
* @param array $requestOptions reconfigure the request
* @return array data returned
*/
protected function post($path, array $parameters = array(), $requestOptions = array()) {
return $this->client
->post($path, $parameters, $requestOptions);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Github_Api:: |
private | property | The client | |
Github_Api:: |
protected | function | Call any path, GET method Ex: $api->get('repos/show/my-username/my-repo') | |
Github_Api:: |
protected | function | Call any path, POST method Ex: $api->post('repos/show/my-username', array('email' => 'my-new-email@provider.org')) | |
Github_Api:: |
public | function |