33
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2025-01-25 16:18:26 +00:00

51 lines
1020 B
PHP
Raw Normal View History

2012-09-08 20:53:44 -05:00
<?php
/**
2013-07-12 21:26:21 -05: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
*/
defined('_JEXEC') or die;
/**
* Extended JGithub class allowing additional JGithubObject instances to be used
2012-09-08 20:53:44 -05:00
*
2013-07-11 20:49:58 -05:00
* @property-read PTGithubRepos $repos GitHub API object for repos.
2013-07-12 21:26:21 -05:00
*
* @package PatchTester
* @since 2.0
2012-09-08 20:53:44 -05:00
*/
2013-07-11 20:49:58 -05:00
class PTGithub extends JGithub
2012-09-08 20:53:44 -05:00
{
2013-07-12 21:26:21 -05:00
/**
* @var PTGithubRepos
* @since 2.0
*/
protected $repos;
2012-09-08 20:53:44 -05:00
2013-07-12 21:26:21 -05: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-08 20:53:44 -05:00
2013-07-12 21:26:21 -05:00
return $this->repos;
}
2012-09-08 20:53:44 -05:00
2013-07-12 21:26:21 -05:00
return parent::__get($name);
}
2012-09-08 20:53:44 -05:00
}