You are here

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

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

Namesort descending Modifiers Type Description Overrides
Github_Api::$client private property The client
Github_Api::get protected function Call any path, GET method Ex: $api->get('repos/show/my-username/my-repo')
Github_Api::post protected function Call any path, POST method Ex: $api->post('repos/show/my-username', array('email' => 'my-new-email@provider.org'))
Github_Api::__construct public function