33
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2024-11-10 15:21:01 +00:00
patchtester/administrator/components/com_patchtester/helpers/github/repos.php

54 lines
1.2 KiB
PHP
Raw Normal View History

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
}