33
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2024-11-14 09:14:11 +00:00
patchtester/administrator/components/com_patchtester/helpers/github/github.php

51 lines
1.0 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
*
2014-01-03 02:48:28 +00:00
* @copyright Copyright (C) 2011 - 2012 Ian MacLennan, Copyright (C) 2013 - 2014 Open Source Matters, Inc. All rights reserved.
2013-07-13 02:26:21 +00:00
* @license GNU General Public License version 2 or later
*/
defined('_JEXEC') or die;
/**
* Extended JGithub class allowing additional JGithubObject instances to be used
2012-09-09 01:53:44 +00:00
*
2013-07-12 01:49:58 +00:00
* @property-read PTGithubRepos $repos GitHub API object for repos.
2013-07-13 02:26:21 +00:00
*
* @package PatchTester
* @since 2.0
2012-09-09 01:53:44 +00:00
*/
2013-07-12 01:49:58 +00:00
class PTGithub extends JGithub
2012-09-09 01:53:44 +00:00
{
2013-07-13 02:26:21 +00:00
/**
* @var PTGithubRepos
* @since 2.0
*/
protected $repos;
2012-09-09 01:53:44 +00:00
2013-07-13 02:26:21 +00:00
/**
* Magic method to lazily create API objects
*
* @param string $name Name of property to retrieve
*
* @return JGithubObject GitHub API object (gists, issues, pulls, etc).
*
* @since 2.0
*/
public function __get($name)
{
if ($name == 'repos')
{
if ($this->repos == null)
{
$this->repos = new PTGithubRepos($this->options, $this->client);
}
2012-09-09 01:53:44 +00:00
2013-07-13 02:26:21 +00:00
return $this->repos;
}
2012-09-09 01:53:44 +00:00
2013-07-13 02:26:21 +00:00
return parent::__get($name);
}
2012-09-09 01:53:44 +00:00
}