2012-09-09 01:53:44 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2013-07-13 02:26:21 +00:00
|
|
|
* @package PatchTester
|
|
|
|
*
|
|
|
|
* @copyright Copyright (C) 2011 - 2012 Ian MacLennan, Copyright (C) 2013 Open Source Matters, Inc. All rights reserved.
|
|
|
|
* @license GNU General Public License version 2 or later
|
2012-09-09 01:53:44 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2013-07-13 02:26:21 +00:00
|
|
|
* GitHub API Repos class.
|
|
|
|
*
|
|
|
|
* @package PatchTester
|
|
|
|
* @since 2.0
|
2012-09-09 01:53:44 +00:00
|
|
|
*/
|
2013-07-12 01:49:58 +00:00
|
|
|
class PTGithubRepos extends JGithubObject
|
2012-09-09 01:53:44 +00:00
|
|
|
{
|
2013-07-13 02:26:21 +00:00
|
|
|
/**
|
|
|
|
* Retrieve information about the specified repository
|
|
|
|
*
|
|
|
|
* @param string $user The username or organization name of the repository owner
|
|
|
|
* @param string $repo The repository to retrieve
|
|
|
|
*
|
|
|
|
* @return object
|
|
|
|
*
|
|
|
|
* @since 2.0
|
|
|
|
* @throws DomainException
|
|
|
|
*/
|
|
|
|
public function get($user, $repo)
|
|
|
|
{
|
|
|
|
$path = '/repos/' . $user . '/' . $repo;
|
|
|
|
|
|
|
|
// Send the request.
|
|
|
|
return $this->processResponse($this->client->get($this->fetchUrl($path)));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* List public repositories for the specified user.
|
|
|
|
*
|
|
|
|
* @param string $user The username to retrieve repositories for
|
|
|
|
*
|
|
|
|
* @return object
|
|
|
|
*
|
|
|
|
* @since 2.0
|
|
|
|
* @throws DomainException
|
|
|
|
*/
|
|
|
|
public function getPublicRepos($user)
|
|
|
|
{
|
|
|
|
$path = '/users/' . $user . '/repos';
|
|
|
|
|
|
|
|
// Send the request.
|
|
|
|
return $this->processResponse($this->client->get($this->fetchUrl($path)));
|
|
|
|
}
|
2012-09-09 01:53:44 +00:00
|
|
|
}
|