Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

CodeSniffer

  • Loading branch information...
commit 1d30a60d22beaa248216ee7af475ba26f408db51 1 parent 58322e0
Michael Babker authored
Showing with 32 additions and 27 deletions.
  1. +1 −0  .gitignore
  2. +15 −8 helper.php
  3. +9 −13 mod_github.php
  4. +7 −6 tmpl/default.php
1  .gitignore
View
@@ -16,4 +16,5 @@ releases
.idea
# Build process #
+build
build.properties
23 helper.php
View
@@ -1,15 +1,22 @@
<?php
/**
-* GitHub Module for Joomla!
-*
-* @copyright Copyright (C) 2011 Michael Babker. All rights reserved.
-* @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
-*/
+ * GitHub Module for Joomla!
+ *
+ * @package GitHubModule
+ *
+ * @copyright Copyright (C) 2011 Michael Babker. All rights reserved.
+ * @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
+ */
-// No direct access
defined('_JEXEC') or die;
-class modGithubHelper
+/**
+ * Helper class for the GitHub Module
+ *
+ * @package GitHubModule
+ * @since 1.0
+ */
+class ModGithubHelper
{
/**
* Function to compile the data to render a formatted object
@@ -116,7 +123,7 @@ static function processData($obj, $params)
if ($i <= $count)
{
// Initialize a new object
- $github[$i]->commit = new stdClass();
+ $github[$i]->commit = new stdClass;
// The commit message linked to the commit
$github[$i]->commit->message = '<a href="https://github.com/'.$uname.'/'.$frepo.'/commit/'.$o['sha'].'" target="_blank" rel="nofollow">'.substr($o['sha'], 0, 7).'</a> - ';
22 mod_github.php
View
@@ -1,12 +1,13 @@
<?php
/**
-* GitHub Module for Joomla!
-*
-* @copyright Copyright (C) 2011 Michael Babker. All rights reserved.
-* @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
-*/
+ * GitHub Module for Joomla!
+ *
+ * @package GitHubModule
+ *
+ * @copyright Copyright (C) 2011 Michael Babker. All rights reserved.
+ * @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
+ */
-// No direct access
defined('_JEXEC') or die;
// Check if cURL is loaded; if not, proceed no further
@@ -26,17 +27,12 @@
$options = array(
'defaultgroup' => 'mod_github');
$cache = JCache::getInstance('callback', $options);
- $cacheTime = $params->get('cache_time');
- // J! 1.5 and 1.6 cache is set in seconds, 1.7 caches in minutes
- if (version_compare(JVERSION,'1.7.0','ge'))
- {
- $cacheTime = round($cacheTime / 60);
- }
+ $cacheTime = round($cacheTime / 60);
$cache->setLifeTime($cacheTime);
$cache->setCaching(true);
// Call the cache; if expired, pull new data
- $github = $cache->call(array('modGithubHelper', 'compileData'), $params);
+ $github = $cache->call(array('ModGithubHelper', 'compileData'), $params);
}
else
{
13 tmpl/default.php
View
@@ -1,12 +1,13 @@
<?php
/**
-* GitHub Module for Joomla!
-*
-* @copyright Copyright (C) 2011 Michael Babker. All rights reserved.
-* @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
-*/
+ * GitHub Module for Joomla!
+ *
+ * @package GitHubModule
+ *
+ * @copyright Copyright (C) 2011 Michael Babker. All rights reserved.
+ * @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
+ */
-// No direct access
defined('_JEXEC') or die;
// Variables for the foreach
Please sign in to comment.
Something went wrong with that request. Please try again.